@assistant-ui/mcp-docs-server 0.1.17 → 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 +518 -234
- package/.docs/organized/code-examples/{with-ai-sdk-v5.md → with-ai-sdk-v6.md} +476 -189
- package/.docs/organized/code-examples/with-assistant-transport.md +503 -301
- package/.docs/organized/code-examples/with-cloud.md +524 -226
- package/.docs/organized/code-examples/with-custom-thread-list.md +433 -146
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +2241 -0
- package/.docs/organized/code-examples/with-external-store.md +517 -231
- package/.docs/organized/code-examples/with-ffmpeg.md +500 -220
- package/.docs/organized/code-examples/with-langgraph.md +630 -319
- package/.docs/organized/code-examples/with-parent-id-grouping.md +517 -231
- package/.docs/organized/code-examples/with-react-hook-form.md +517 -233
- package/.docs/organized/code-examples/with-react-router.md +2167 -0
- package/.docs/organized/code-examples/{store-example.md → with-store.md} +18 -22
- package/.docs/organized/code-examples/with-tanstack.md +23 -41
- 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 +38 -3
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -8
- package/.docs/raw/docs/runtimes/custom/local.mdx +43 -16
- 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 -7
- 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/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -0
- package/dist/prepare-docs/code-examples.d.ts +2 -0
- package/dist/prepare-docs/code-examples.d.ts.map +1 -0
- package/dist/prepare-docs/code-examples.js +129 -0
- package/dist/prepare-docs/code-examples.js.map +1 -0
- package/dist/prepare-docs/copy-raw.d.ts +2 -0
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -0
- package/dist/prepare-docs/copy-raw.js +50 -0
- package/dist/prepare-docs/copy-raw.js.map +1 -0
- package/dist/prepare-docs/prepare.d.ts +2 -0
- package/dist/prepare-docs/prepare.d.ts.map +1 -0
- package/dist/prepare-docs/prepare.js +18 -195
- package/dist/prepare-docs/prepare.js.map +1 -0
- package/dist/stdio.d.ts +3 -0
- package/dist/stdio.d.ts.map +1 -0
- package/dist/stdio.js +4 -5
- package/dist/stdio.js.map +1 -0
- package/dist/tools/docs.d.ts +23 -0
- package/dist/tools/docs.d.ts.map +1 -0
- package/dist/tools/docs.js +168 -0
- package/dist/tools/docs.js.map +1 -0
- package/dist/tools/examples.d.ts +23 -0
- package/dist/tools/examples.d.ts.map +1 -0
- package/dist/tools/examples.js +95 -0
- package/dist/tools/examples.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts +4 -0
- package/dist/tools/tests/test-setup.d.ts.map +1 -0
- package/dist/tools/tests/test-setup.js +36 -0
- package/dist/tools/tests/test-setup.js.map +1 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +20 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/mcp-format.d.ts +7 -0
- package/dist/utils/mcp-format.d.ts.map +1 -0
- package/dist/utils/mcp-format.js +11 -0
- package/dist/utils/mcp-format.js.map +1 -0
- package/dist/utils/mdx.d.ts +9 -0
- package/dist/utils/mdx.d.ts.map +1 -0
- package/dist/utils/mdx.js +27 -0
- package/dist/utils/mdx.js.map +1 -0
- package/dist/utils/paths.d.ts +8 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +84 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/security.d.ts +2 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +43 -0
- package/dist/utils/security.js.map +1 -0
- package/package.json +37 -19
- package/src/constants.ts +22 -0
- package/src/index.ts +51 -0
- package/src/prepare-docs/code-examples.ts +158 -0
- package/src/prepare-docs/copy-raw.ts +55 -0
- package/src/prepare-docs/prepare.ts +24 -0
- package/src/stdio.ts +7 -0
- package/src/tools/docs.ts +207 -0
- package/src/tools/examples.ts +107 -0
- package/src/tools/tests/docs.test.ts +124 -0
- package/src/tools/tests/examples.test.ts +94 -0
- package/src/tools/tests/integration.test.ts +46 -0
- package/src/tools/tests/json-parsing.test.ts +23 -0
- package/src/tools/tests/mcp-protocol.test.ts +133 -0
- package/src/tools/tests/path-traversal.test.ts +81 -0
- package/src/tools/tests/test-setup.ts +40 -0
- package/src/utils/logger.ts +20 -0
- package/src/utils/mcp-format.ts +12 -0
- package/src/utils/mdx.ts +39 -0
- package/src/utils/paths.ts +114 -0
- package/src/utils/security.ts +52 -0
- package/src/utils/tests/security.test.ts +119 -0
- 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/dist/chunk-M2RKUM66.js +0 -38
- package/dist/chunk-NVNFQ5ZO.js +0 -423
- /package/.docs/raw/docs/{copilots → (docs)/copilots}/assistant-frame.mdx +0 -0
|
@@ -86,43 +86,41 @@ export const OPTIONS = () => {
|
|
|
86
86
|
@custom-variant dark (&:is(.dark *));
|
|
87
87
|
|
|
88
88
|
@theme inline {
|
|
89
|
-
--color-background: var(--background);
|
|
90
|
-
--color-foreground: var(--foreground);
|
|
91
|
-
--font-sans: var(--font-geist-sans);
|
|
92
|
-
--font-mono: var(--font-geist-mono);
|
|
93
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
94
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
95
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
96
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
97
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
98
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
99
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
100
|
-
--color-sidebar: var(--sidebar);
|
|
101
|
-
--color-chart-5: var(--chart-5);
|
|
102
|
-
--color-chart-4: var(--chart-4);
|
|
103
|
-
--color-chart-3: var(--chart-3);
|
|
104
|
-
--color-chart-2: var(--chart-2);
|
|
105
|
-
--color-chart-1: var(--chart-1);
|
|
106
|
-
--color-ring: var(--ring);
|
|
107
|
-
--color-input: var(--input);
|
|
108
|
-
--color-border: var(--border);
|
|
109
|
-
--color-destructive: var(--destructive);
|
|
110
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
111
|
-
--color-accent: var(--accent);
|
|
112
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
113
|
-
--color-muted: var(--muted);
|
|
114
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
115
|
-
--color-secondary: var(--secondary);
|
|
116
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
117
|
-
--color-primary: var(--primary);
|
|
118
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
119
|
-
--color-popover: var(--popover);
|
|
120
|
-
--color-card-foreground: var(--card-foreground);
|
|
121
|
-
--color-card: var(--card);
|
|
122
89
|
--radius-sm: calc(var(--radius) - 4px);
|
|
123
90
|
--radius-md: calc(var(--radius) - 2px);
|
|
124
91
|
--radius-lg: var(--radius);
|
|
125
92
|
--radius-xl: calc(var(--radius) + 4px);
|
|
93
|
+
--color-background: var(--background);
|
|
94
|
+
--color-foreground: var(--foreground);
|
|
95
|
+
--color-card: var(--card);
|
|
96
|
+
--color-card-foreground: var(--card-foreground);
|
|
97
|
+
--color-popover: var(--popover);
|
|
98
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
99
|
+
--color-primary: var(--primary);
|
|
100
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
101
|
+
--color-secondary: var(--secondary);
|
|
102
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
103
|
+
--color-muted: var(--muted);
|
|
104
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
105
|
+
--color-accent: var(--accent);
|
|
106
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
107
|
+
--color-destructive: var(--destructive);
|
|
108
|
+
--color-border: var(--border);
|
|
109
|
+
--color-input: var(--input);
|
|
110
|
+
--color-ring: var(--ring);
|
|
111
|
+
--color-chart-1: var(--chart-1);
|
|
112
|
+
--color-chart-2: var(--chart-2);
|
|
113
|
+
--color-chart-3: var(--chart-3);
|
|
114
|
+
--color-chart-4: var(--chart-4);
|
|
115
|
+
--color-chart-5: var(--chart-5);
|
|
116
|
+
--color-sidebar: var(--sidebar);
|
|
117
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
118
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
119
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
120
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
121
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
122
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
123
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
126
124
|
}
|
|
127
125
|
|
|
128
126
|
:root {
|
|
@@ -329,8 +327,12 @@ export default function Home() {
|
|
|
329
327
|
},
|
|
330
328
|
"aliases": {
|
|
331
329
|
"components": "@/components",
|
|
332
|
-
"utils": "@/lib/utils"
|
|
333
|
-
|
|
330
|
+
"utils": "@/lib/utils",
|
|
331
|
+
"ui": "@/components/ui",
|
|
332
|
+
"lib": "@/lib",
|
|
333
|
+
"hooks": "@/hooks"
|
|
334
|
+
},
|
|
335
|
+
"iconLibrary": "lucide"
|
|
334
336
|
}
|
|
335
337
|
|
|
336
338
|
```
|
|
@@ -565,7 +567,7 @@ export const ComposerAddAttachment: FC = () => {
|
|
|
565
567
|
side="bottom"
|
|
566
568
|
variant="ghost"
|
|
567
569
|
size="icon"
|
|
568
|
-
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"
|
|
569
571
|
aria-label="Add Attachment"
|
|
570
572
|
>
|
|
571
573
|
<PlusIcon className="aui-attachment-add-icon size-5 stroke-[1.5px]" />
|
|
@@ -813,15 +815,15 @@ const defaultComponents = memoizeMarkdownComponents({
|
|
|
813
815
|
## components/assistant-ui/thread-list.tsx
|
|
814
816
|
|
|
815
817
|
```tsx
|
|
816
|
-
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
|
|
817
818
|
import { Button } from "@/components/ui/button";
|
|
818
819
|
import { Skeleton } from "@/components/ui/skeleton";
|
|
819
820
|
import {
|
|
820
821
|
AssistantIf,
|
|
822
|
+
ThreadListItemMorePrimitive,
|
|
821
823
|
ThreadListItemPrimitive,
|
|
822
824
|
ThreadListPrimitive,
|
|
823
825
|
} from "@assistant-ui/react";
|
|
824
|
-
import { ArchiveIcon, PlusIcon } from "lucide-react";
|
|
826
|
+
import { ArchiveIcon, MoreHorizontalIcon, PlusIcon } from "lucide-react";
|
|
825
827
|
import type { FC } from "react";
|
|
826
828
|
|
|
827
829
|
export const ThreadList: FC = () => {
|
|
@@ -871,26 +873,41 @@ const ThreadListSkeleton: FC = () => {
|
|
|
871
873
|
|
|
872
874
|
const ThreadListItem: FC = () => {
|
|
873
875
|
return (
|
|
874
|
-
<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">
|
|
875
|
-
<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">
|
|
876
878
|
<ThreadListItemPrimitive.Title fallback="New Chat" />
|
|
877
879
|
</ThreadListItemPrimitive.Trigger>
|
|
878
|
-
<
|
|
880
|
+
<ThreadListItemMore />
|
|
879
881
|
</ThreadListItemPrimitive.Root>
|
|
880
882
|
);
|
|
881
883
|
};
|
|
882
884
|
|
|
883
|
-
const
|
|
885
|
+
const ThreadListItemMore: FC = () => {
|
|
884
886
|
return (
|
|
885
|
-
<
|
|
886
|
-
<
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
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"
|
|
890
902
|
>
|
|
891
|
-
<
|
|
892
|
-
|
|
893
|
-
|
|
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>
|
|
894
911
|
);
|
|
895
912
|
};
|
|
896
913
|
|
|
@@ -910,6 +927,7 @@ import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button
|
|
|
910
927
|
import { Button } from "@/components/ui/button";
|
|
911
928
|
import { cn } from "@/lib/utils";
|
|
912
929
|
import {
|
|
930
|
+
ActionBarMorePrimitive,
|
|
913
931
|
ActionBarPrimitive,
|
|
914
932
|
AssistantIf,
|
|
915
933
|
BranchPickerPrimitive,
|
|
@@ -926,6 +944,7 @@ import {
|
|
|
926
944
|
ChevronRightIcon,
|
|
927
945
|
CopyIcon,
|
|
928
946
|
DownloadIcon,
|
|
947
|
+
MoreHorizontalIcon,
|
|
929
948
|
PencilIcon,
|
|
930
949
|
RefreshCwIcon,
|
|
931
950
|
SquareIcon,
|
|
@@ -971,7 +990,7 @@ const ThreadScrollToBottom: FC = () => {
|
|
|
971
990
|
<TooltipIconButton
|
|
972
991
|
tooltip="Scroll to bottom"
|
|
973
992
|
variant="outline"
|
|
974
|
-
className="aui-thread-scroll-to-bottom -top-12
|
|
993
|
+
className="aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent"
|
|
975
994
|
>
|
|
976
995
|
<ArrowDownIcon />
|
|
977
996
|
</TooltipIconButton>
|
|
@@ -1135,7 +1154,7 @@ const AssistantActionBar: FC = () => {
|
|
|
1135
1154
|
hideWhenRunning
|
|
1136
1155
|
autohide="not-last"
|
|
1137
1156
|
autohideFloat="single-branch"
|
|
1138
|
-
className="aui-assistant-action-bar-root
|
|
1157
|
+
className="aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm"
|
|
1139
1158
|
>
|
|
1140
1159
|
<ActionBarPrimitive.Copy asChild>
|
|
1141
1160
|
<TooltipIconButton tooltip="Copy">
|
|
@@ -1147,16 +1166,33 @@ const AssistantActionBar: FC = () => {
|
|
|
1147
1166
|
</AssistantIf>
|
|
1148
1167
|
</TooltipIconButton>
|
|
1149
1168
|
</ActionBarPrimitive.Copy>
|
|
1150
|
-
<ActionBarPrimitive.ExportMarkdown asChild>
|
|
1151
|
-
<TooltipIconButton tooltip="Export as Markdown">
|
|
1152
|
-
<DownloadIcon />
|
|
1153
|
-
</TooltipIconButton>
|
|
1154
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
1155
1169
|
<ActionBarPrimitive.Reload asChild>
|
|
1156
1170
|
<TooltipIconButton tooltip="Refresh">
|
|
1157
1171
|
<RefreshCwIcon />
|
|
1158
1172
|
</TooltipIconButton>
|
|
1159
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>
|
|
1160
1196
|
</ActionBarPrimitive.Root>
|
|
1161
1197
|
);
|
|
1162
1198
|
};
|
|
@@ -1173,12 +1209,12 @@ const UserMessage: FC = () => {
|
|
|
1173
1209
|
<div className="aui-user-message-content wrap-break-word rounded-2xl bg-muted px-4 py-2.5 text-foreground">
|
|
1174
1210
|
<MessagePrimitive.Parts />
|
|
1175
1211
|
</div>
|
|
1176
|
-
<div className="aui-user-action-bar-wrapper -translate-x-full -translate-y-1/2
|
|
1212
|
+
<div className="aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2">
|
|
1177
1213
|
<UserActionBar />
|
|
1178
1214
|
</div>
|
|
1179
1215
|
</div>
|
|
1180
1216
|
|
|
1181
|
-
<BranchPicker className="aui-user-branch-picker
|
|
1217
|
+
<BranchPicker className="aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end" />
|
|
1182
1218
|
</MessagePrimitive.Root>
|
|
1183
1219
|
);
|
|
1184
1220
|
};
|
|
@@ -1230,7 +1266,7 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1230
1266
|
<BranchPickerPrimitive.Root
|
|
1231
1267
|
hideWhenSingleBranch
|
|
1232
1268
|
className={cn(
|
|
1233
|
-
"aui-branch-picker-root -
|
|
1269
|
+
"aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-muted-foreground text-xs",
|
|
1234
1270
|
className,
|
|
1235
1271
|
)}
|
|
1236
1272
|
{...rest}
|
|
@@ -1257,98 +1293,329 @@ const BranchPicker: FC<BranchPickerPrimitive.Root.Props> = ({
|
|
|
1257
1293
|
## components/assistant-ui/tool-fallback.tsx
|
|
1258
1294
|
|
|
1259
1295
|
```tsx
|
|
1260
|
-
|
|
1296
|
+
"use client";
|
|
1297
|
+
|
|
1298
|
+
import { memo, useCallback, useRef, useState } from "react";
|
|
1261
1299
|
import {
|
|
1300
|
+
AlertCircleIcon,
|
|
1262
1301
|
CheckIcon,
|
|
1263
1302
|
ChevronDownIcon,
|
|
1264
|
-
|
|
1303
|
+
LoaderIcon,
|
|
1265
1304
|
XCircleIcon,
|
|
1266
1305
|
} from "lucide-react";
|
|
1267
|
-
import {
|
|
1268
|
-
|
|
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";
|
|
1269
1316
|
import { cn } from "@/lib/utils";
|
|
1270
1317
|
|
|
1271
|
-
|
|
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({
|
|
1272
1389
|
toolName,
|
|
1273
|
-
argsText,
|
|
1274
|
-
result,
|
|
1275
1390
|
status,
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
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";
|
|
1279
1399
|
const isCancelled =
|
|
1280
1400
|
status?.type === "incomplete" && status.reason === "cancelled";
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
? status.error
|
|
1285
|
-
: JSON.stringify(status.error)
|
|
1286
|
-
: null;
|
|
1401
|
+
|
|
1402
|
+
const Icon = statusIconMap[statusType];
|
|
1403
|
+
const label = isCancelled ? "Cancelled tool" : "Used tool";
|
|
1287
1404
|
|
|
1288
1405
|
return (
|
|
1289
|
-
<
|
|
1406
|
+
<CollapsibleTrigger
|
|
1407
|
+
data-slot="tool-fallback-trigger"
|
|
1290
1408
|
className={cn(
|
|
1291
|
-
"aui-tool-fallback-
|
|
1292
|
-
|
|
1409
|
+
"aui-tool-fallback-trigger group/trigger flex w-full items-center gap-2 px-4 text-sm transition-colors",
|
|
1410
|
+
className,
|
|
1293
1411
|
)}
|
|
1412
|
+
{...props}
|
|
1294
1413
|
>
|
|
1295
|
-
<
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
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",
|
|
1300
1420
|
)}
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
<div className="aui-tool-fallback-cancelled-root px-4">
|
|
1318
|
-
<p className="aui-tool-fallback-cancelled-header font-semibold text-muted-foreground">
|
|
1319
|
-
Cancelled reason:
|
|
1320
|
-
</p>
|
|
1321
|
-
<p className="aui-tool-fallback-cancelled-reason text-muted-foreground">
|
|
1322
|
-
{cancelledReason}
|
|
1323
|
-
</p>
|
|
1324
|
-
</div>
|
|
1325
|
-
)}
|
|
1326
|
-
<div
|
|
1327
|
-
className={cn(
|
|
1328
|
-
"aui-tool-fallback-args-root px-4",
|
|
1329
|
-
isCancelled && "opacity-60",
|
|
1330
|
-
)}
|
|
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"
|
|
1331
1437
|
>
|
|
1332
|
-
<
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
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,
|
|
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,
|
|
1349
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>
|
|
1350
1525
|
</div>
|
|
1351
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>
|
|
1562
|
+
</div>
|
|
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,
|
|
1352
1619
|
};
|
|
1353
1620
|
|
|
1354
1621
|
```
|
|
@@ -1749,47 +2016,50 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
|
1749
2016
|
|
|
1750
2017
|
import { cn } from "@/lib/utils";
|
|
1751
2018
|
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
)
|
|
1792
|
-
|
|
2019
|
+
function Avatar({
|
|
2020
|
+
className,
|
|
2021
|
+
...props
|
|
2022
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Root>) {
|
|
2023
|
+
return (
|
|
2024
|
+
<AvatarPrimitive.Root
|
|
2025
|
+
data-slot="avatar"
|
|
2026
|
+
className={cn(
|
|
2027
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
2028
|
+
className,
|
|
2029
|
+
)}
|
|
2030
|
+
{...props}
|
|
2031
|
+
/>
|
|
2032
|
+
);
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
function AvatarImage({
|
|
2036
|
+
className,
|
|
2037
|
+
...props
|
|
2038
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Image>) {
|
|
2039
|
+
return (
|
|
2040
|
+
<AvatarPrimitive.Image
|
|
2041
|
+
data-slot="avatar-image"
|
|
2042
|
+
className={cn("aspect-square size-full", className)}
|
|
2043
|
+
{...props}
|
|
2044
|
+
/>
|
|
2045
|
+
);
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
function AvatarFallback({
|
|
2049
|
+
className,
|
|
2050
|
+
...props
|
|
2051
|
+
}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
|
|
2052
|
+
return (
|
|
2053
|
+
<AvatarPrimitive.Fallback
|
|
2054
|
+
data-slot="avatar-fallback"
|
|
2055
|
+
className={cn(
|
|
2056
|
+
"flex size-full items-center justify-center rounded-full bg-muted",
|
|
2057
|
+
className,
|
|
2058
|
+
)}
|
|
2059
|
+
{...props}
|
|
2060
|
+
/>
|
|
2061
|
+
);
|
|
2062
|
+
}
|
|
1793
2063
|
|
|
1794
2064
|
export { Avatar, AvatarImage, AvatarFallback };
|
|
1795
2065
|
|
|
@@ -1805,26 +2075,28 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
1805
2075
|
import { cn } from "@/lib/utils";
|
|
1806
2076
|
|
|
1807
2077
|
const buttonVariants = cva(
|
|
1808
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm transition-
|
|
2078
|
+
"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1809
2079
|
{
|
|
1810
2080
|
variants: {
|
|
1811
2081
|
variant: {
|
|
1812
|
-
default:
|
|
1813
|
-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
2082
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
1814
2083
|
destructive:
|
|
1815
|
-
"bg-destructive text-destructive
|
|
2084
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
|
|
1816
2085
|
outline:
|
|
1817
|
-
"border
|
|
2086
|
+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
1818
2087
|
secondary:
|
|
1819
|
-
"bg-secondary text-secondary-foreground
|
|
1820
|
-
ghost:
|
|
2088
|
+
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
2089
|
+
ghost:
|
|
2090
|
+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
1821
2091
|
link: "text-primary underline-offset-4 hover:underline",
|
|
1822
2092
|
},
|
|
1823
2093
|
size: {
|
|
1824
|
-
default: "h-9 px-4 py-2",
|
|
1825
|
-
sm: "h-8 rounded-md px-3
|
|
1826
|
-
lg: "h-10 rounded-md px-
|
|
1827
|
-
icon: "
|
|
2094
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
2095
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
2096
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
2097
|
+
icon: "size-9",
|
|
2098
|
+
"icon-sm": "size-8",
|
|
2099
|
+
"icon-lg": "size-10",
|
|
1828
2100
|
},
|
|
1829
2101
|
},
|
|
1830
2102
|
defaultVariants: {
|
|
@@ -1834,25 +2106,28 @@ const buttonVariants = cva(
|
|
|
1834
2106
|
},
|
|
1835
2107
|
);
|
|
1836
2108
|
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
2109
|
+
function Button({
|
|
2110
|
+
className,
|
|
2111
|
+
variant = "default",
|
|
2112
|
+
size = "default",
|
|
2113
|
+
asChild = false,
|
|
2114
|
+
...props
|
|
2115
|
+
}: React.ComponentProps<"button"> &
|
|
2116
|
+
VariantProps<typeof buttonVariants> & {
|
|
2117
|
+
asChild?: boolean;
|
|
2118
|
+
}) {
|
|
2119
|
+
const Comp = asChild ? Slot : "button";
|
|
1842
2120
|
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
},
|
|
1854
|
-
);
|
|
1855
|
-
Button.displayName = "Button";
|
|
2121
|
+
return (
|
|
2122
|
+
<Comp
|
|
2123
|
+
data-slot="button"
|
|
2124
|
+
data-variant={variant}
|
|
2125
|
+
data-size={size}
|
|
2126
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
2127
|
+
{...props}
|
|
2128
|
+
/>
|
|
2129
|
+
);
|
|
2130
|
+
}
|
|
1856
2131
|
|
|
1857
2132
|
export { Button, buttonVariants };
|
|
1858
2133
|
|
|
@@ -1865,88 +2140,136 @@ import * as React from "react";
|
|
|
1865
2140
|
|
|
1866
2141
|
import { cn } from "@/lib/utils";
|
|
1867
2142
|
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
)
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
)
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
CardFooter
|
|
2143
|
+
function Card({ className, ...props }: React.ComponentProps<"div">) {
|
|
2144
|
+
return (
|
|
2145
|
+
<div
|
|
2146
|
+
data-slot="card"
|
|
2147
|
+
className={cn(
|
|
2148
|
+
"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
|
|
2149
|
+
className,
|
|
2150
|
+
)}
|
|
2151
|
+
{...props}
|
|
2152
|
+
/>
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
2157
|
+
return (
|
|
2158
|
+
<div
|
|
2159
|
+
data-slot="card-header"
|
|
2160
|
+
className={cn(
|
|
2161
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
2162
|
+
className,
|
|
2163
|
+
)}
|
|
2164
|
+
{...props}
|
|
2165
|
+
/>
|
|
2166
|
+
);
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
2170
|
+
return (
|
|
2171
|
+
<div
|
|
2172
|
+
data-slot="card-title"
|
|
2173
|
+
className={cn("font-semibold leading-none", className)}
|
|
2174
|
+
{...props}
|
|
2175
|
+
/>
|
|
2176
|
+
);
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
2180
|
+
return (
|
|
2181
|
+
<div
|
|
2182
|
+
data-slot="card-description"
|
|
2183
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
2184
|
+
{...props}
|
|
2185
|
+
/>
|
|
2186
|
+
);
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
function CardAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
2190
|
+
return (
|
|
2191
|
+
<div
|
|
2192
|
+
data-slot="card-action"
|
|
2193
|
+
className={cn(
|
|
2194
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
2195
|
+
className,
|
|
2196
|
+
)}
|
|
2197
|
+
{...props}
|
|
2198
|
+
/>
|
|
2199
|
+
);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
2203
|
+
return (
|
|
2204
|
+
<div
|
|
2205
|
+
data-slot="card-content"
|
|
2206
|
+
className={cn("px-6", className)}
|
|
2207
|
+
{...props}
|
|
2208
|
+
/>
|
|
2209
|
+
);
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
2213
|
+
return (
|
|
2214
|
+
<div
|
|
2215
|
+
data-slot="card-footer"
|
|
2216
|
+
className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
|
|
2217
|
+
{...props}
|
|
2218
|
+
/>
|
|
2219
|
+
);
|
|
2220
|
+
}
|
|
1938
2221
|
|
|
1939
2222
|
export {
|
|
1940
2223
|
Card,
|
|
1941
2224
|
CardHeader,
|
|
1942
2225
|
CardFooter,
|
|
1943
2226
|
CardTitle,
|
|
2227
|
+
CardAction,
|
|
1944
2228
|
CardDescription,
|
|
1945
2229
|
CardContent,
|
|
1946
2230
|
};
|
|
1947
2231
|
|
|
1948
2232
|
```
|
|
1949
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
|
+
|
|
1950
2273
|
## components/ui/dialog.tsx
|
|
1951
2274
|
|
|
1952
2275
|
```tsx
|
|
@@ -1990,7 +2313,7 @@ function DialogOverlay({
|
|
|
1990
2313
|
<DialogPrimitive.Overlay
|
|
1991
2314
|
data-slot="dialog-overlay"
|
|
1992
2315
|
className={cn(
|
|
1993
|
-
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/
|
|
2316
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
1994
2317
|
className,
|
|
1995
2318
|
)}
|
|
1996
2319
|
{...props}
|
|
@@ -2001,24 +2324,32 @@ function DialogOverlay({
|
|
|
2001
2324
|
function DialogContent({
|
|
2002
2325
|
className,
|
|
2003
2326
|
children,
|
|
2327
|
+
showCloseButton = true,
|
|
2004
2328
|
...props
|
|
2005
|
-
}: React.ComponentProps<typeof DialogPrimitive.Content>
|
|
2329
|
+
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
2330
|
+
showCloseButton?: boolean;
|
|
2331
|
+
}) {
|
|
2006
2332
|
return (
|
|
2007
2333
|
<DialogPortal data-slot="dialog-portal">
|
|
2008
2334
|
<DialogOverlay />
|
|
2009
2335
|
<DialogPrimitive.Content
|
|
2010
2336
|
data-slot="dialog-content"
|
|
2011
2337
|
className={cn(
|
|
2012
|
-
"data-[state=closed]:fade-out-0 data-[state=
|
|
2338
|
+
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg outline-none duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",
|
|
2013
2339
|
className,
|
|
2014
2340
|
)}
|
|
2015
2341
|
{...props}
|
|
2016
2342
|
>
|
|
2017
2343
|
{children}
|
|
2018
|
-
|
|
2019
|
-
<
|
|
2020
|
-
|
|
2021
|
-
|
|
2344
|
+
{showCloseButton && (
|
|
2345
|
+
<DialogPrimitive.Close
|
|
2346
|
+
data-slot="dialog-close"
|
|
2347
|
+
className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
2348
|
+
>
|
|
2349
|
+
<XIcon />
|
|
2350
|
+
<span className="sr-only">Close</span>
|
|
2351
|
+
</DialogPrimitive.Close>
|
|
2352
|
+
)}
|
|
2022
2353
|
</DialogPrimitive.Content>
|
|
2023
2354
|
</DialogPortal>
|
|
2024
2355
|
);
|
|
@@ -2158,13 +2489,13 @@ function TooltipContent({
|
|
|
2158
2489
|
data-slot="tooltip-content"
|
|
2159
2490
|
sideOffset={sideOffset}
|
|
2160
2491
|
className={cn(
|
|
2161
|
-
"fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-
|
|
2492
|
+
"fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out",
|
|
2162
2493
|
className,
|
|
2163
2494
|
)}
|
|
2164
2495
|
{...props}
|
|
2165
2496
|
>
|
|
2166
2497
|
{children}
|
|
2167
|
-
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-
|
|
2498
|
+
<TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
|
|
2168
2499
|
</TooltipPrimitive.Content>
|
|
2169
2500
|
</TooltipPrimitive.Portal>
|
|
2170
2501
|
);
|
|
@@ -2288,10 +2619,11 @@ export default nextConfig;
|
|
|
2288
2619
|
```json
|
|
2289
2620
|
{
|
|
2290
2621
|
"name": "with-langgraph",
|
|
2291
|
-
"version": "0.
|
|
2622
|
+
"version": "0.0.0",
|
|
2292
2623
|
"private": true,
|
|
2624
|
+
"type": "module",
|
|
2293
2625
|
"scripts": {
|
|
2294
|
-
"dev": "next dev
|
|
2626
|
+
"dev": "next dev",
|
|
2295
2627
|
"build": "next build",
|
|
2296
2628
|
"start": "next start"
|
|
2297
2629
|
},
|
|
@@ -2299,34 +2631,31 @@ export default nextConfig;
|
|
|
2299
2631
|
"@assistant-ui/react": "workspace:*",
|
|
2300
2632
|
"@assistant-ui/react-langgraph": "workspace:*",
|
|
2301
2633
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
2302
|
-
"@langchain/langgraph-sdk": "^1.
|
|
2634
|
+
"@langchain/langgraph-sdk": "^1.5.4",
|
|
2303
2635
|
"@radix-ui/react-avatar": "^1.1.11",
|
|
2636
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
2304
2637
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
2305
2638
|
"@radix-ui/react-slot": "^1.2.4",
|
|
2306
2639
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
2307
2640
|
"class-variance-authority": "^0.7.1",
|
|
2308
2641
|
"clsx": "^2.1.1",
|
|
2309
|
-
"
|
|
2310
|
-
"
|
|
2311
|
-
"
|
|
2312
|
-
"
|
|
2313
|
-
"next": "16.0.10",
|
|
2314
|
-
"react": "19.2.3",
|
|
2315
|
-
"react-dom": "19.2.3",
|
|
2642
|
+
"lucide-react": "^0.562.0",
|
|
2643
|
+
"next": "^16.1.4",
|
|
2644
|
+
"react": "^19.2.3",
|
|
2645
|
+
"react-dom": "^19.2.3",
|
|
2316
2646
|
"remark-gfm": "^4.0.1",
|
|
2317
2647
|
"tailwind-merge": "^3.4.0",
|
|
2318
|
-
"
|
|
2319
|
-
"zustand": "^5.0.9"
|
|
2648
|
+
"zustand": "^5.0.10"
|
|
2320
2649
|
},
|
|
2321
2650
|
"devDependencies": {
|
|
2322
2651
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
2323
|
-
"@
|
|
2324
|
-
"@types/
|
|
2325
|
-
"@types/
|
|
2326
|
-
"@types/react": "^19",
|
|
2327
|
-
"
|
|
2328
|
-
"postcss": "^8",
|
|
2652
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
2653
|
+
"@types/node": "^25.0.9",
|
|
2654
|
+
"@types/react": "^19.2.9",
|
|
2655
|
+
"@types/react-dom": "^19.2.3",
|
|
2656
|
+
"postcss": "^8.5.6",
|
|
2329
2657
|
"tailwindcss": "^4.1.18",
|
|
2658
|
+
"tw-animate-css": "^1.4.0",
|
|
2330
2659
|
"typescript": "^5.9.3"
|
|
2331
2660
|
}
|
|
2332
2661
|
}
|
|
@@ -2364,29 +2693,11 @@ npm run dev
|
|
|
2364
2693
|
|
|
2365
2694
|
```json
|
|
2366
2695
|
{
|
|
2367
|
-
"extends": "@assistant-ui/x-buildutils/ts/
|
|
2696
|
+
"extends": "@assistant-ui/x-buildutils/ts/next",
|
|
2368
2697
|
"compilerOptions": {
|
|
2369
|
-
"
|
|
2370
|
-
"module": "ESNext",
|
|
2371
|
-
"incremental": true,
|
|
2372
|
-
"plugins": [
|
|
2373
|
-
{
|
|
2374
|
-
"name": "next"
|
|
2375
|
-
}
|
|
2376
|
-
],
|
|
2377
|
-
"allowJs": true,
|
|
2378
|
-
"strictNullChecks": true,
|
|
2379
|
-
"jsx": "preserve",
|
|
2380
|
-
"paths": {
|
|
2381
|
-
"@/*": ["./*"],
|
|
2382
|
-
"@assistant-ui/*": ["../../packages/*/src"],
|
|
2383
|
-
"@assistant-ui/react/*": ["../../packages/react/src/*"],
|
|
2384
|
-
"@assistant-ui/tap/*": ["../../packages/tap/src/*"],
|
|
2385
|
-
"assistant-stream": ["../../packages/assistant-stream/src"],
|
|
2386
|
-
"assistant-stream/*": ["../../packages/assistant-stream/src/*"]
|
|
2387
|
-
}
|
|
2698
|
+
"paths": { "@/*": ["./*"] }
|
|
2388
2699
|
},
|
|
2389
|
-
"include": ["
|
|
2700
|
+
"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
2390
2701
|
"exclude": ["node_modules"]
|
|
2391
2702
|
}
|
|
2392
2703
|
|