@assistant-ui/mcp-docs-server 0.2.0 → 0.2.2
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/waterfall.md +12 -13
- package/.docs/organized/code-examples/with-a2a.md +16 -11
- package/.docs/organized/code-examples/with-ag-ui.md +15 -13
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +14 -13
- package/.docs/organized/code-examples/with-artifacts.md +14 -13
- package/.docs/organized/code-examples/with-assistant-transport.md +20 -28
- package/.docs/organized/code-examples/with-browser-extension.md +18 -11
- package/.docs/organized/code-examples/with-chain-of-thought.md +17 -15
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -11
- package/.docs/organized/code-examples/with-cloud.md +19 -14
- package/.docs/organized/code-examples/with-custom-thread-list.md +15 -14
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +14 -14
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +19 -17
- package/.docs/organized/code-examples/with-eve.md +66 -12
- package/.docs/organized/code-examples/with-expo.md +26 -31
- package/.docs/organized/code-examples/with-external-store.md +17 -12
- package/.docs/organized/code-examples/with-ffmpeg.md +21 -15
- package/.docs/organized/code-examples/with-generative-ui.md +271 -36
- package/.docs/organized/code-examples/with-google-adk.md +17 -12
- package/.docs/organized/code-examples/with-heat-graph.md +6 -7
- package/.docs/organized/code-examples/with-image-generation.md +9 -10
- package/.docs/organized/code-examples/with-interactables.md +14 -13
- package/.docs/organized/code-examples/with-langchain.md +12 -13
- package/.docs/organized/code-examples/with-langgraph.md +19 -13
- package/.docs/organized/code-examples/with-livekit.md +13 -13
- package/.docs/organized/code-examples/with-mcp.md +14 -15
- package/.docs/organized/code-examples/with-nuxt.md +2428 -0
- package/.docs/organized/code-examples/with-opencode.md +23 -14
- package/.docs/organized/code-examples/with-openui.md +449 -0
- package/.docs/organized/code-examples/with-pi.md +59 -57
- package/.docs/organized/code-examples/with-react-hook-form.md +16 -15
- package/.docs/organized/code-examples/with-react-ink-web.md +7 -8
- package/.docs/organized/code-examples/with-react-ink.md +6 -6
- package/.docs/organized/code-examples/with-react-router.md +17 -11
- package/.docs/organized/code-examples/with-resumable-stream.md +12 -13
- package/.docs/organized/code-examples/with-store.md +27 -16
- package/.docs/organized/code-examples/with-svelte.md +415 -0
- package/.docs/organized/code-examples/with-sveltekit.md +1061 -0
- package/.docs/organized/code-examples/with-tanstack.md +19 -13
- package/.docs/organized/code-examples/with-tap-runtime.md +15 -15
- package/.docs/organized/code-examples/with-virtualized-thread.md +8 -9
- package/.docs/organized/code-examples/with-vue.md +408 -0
- package/.docs/raw/docs/(docs)/cli.mdx +7 -2
- package/.docs/raw/docs/(docs)/index.mdx +9 -76
- package/.docs/raw/docs/(docs)/installation.mdx +6 -20
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +5 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +9 -2
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +47 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +29 -4
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +52 -1
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +1 -1
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +2 -2
- package/.docs/raw/docs/cloud/ai-sdk.mdx +4 -4
- package/.docs/raw/docs/cloud/index.mdx +1 -1
- package/.docs/raw/docs/copilots/model-context.mdx +4 -3
- package/.docs/raw/docs/copilots/motivation.mdx +4 -4
- package/.docs/raw/docs/guides/attachments.mdx +2 -2
- package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
- package/.docs/raw/docs/guides/context-api.mdx +15 -17
- package/.docs/raw/docs/guides/dictation.mdx +1 -1
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/mentions.mdx +2 -0
- package/.docs/raw/docs/guides/resumable-streams.mdx +74 -3
- package/.docs/raw/docs/guides/suggestions.mdx +15 -12
- package/.docs/raw/docs/ink/hooks.mdx +9 -4
- package/.docs/raw/docs/ink/primitives.mdx +5 -4
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +16 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +2 -2
- package/.docs/raw/docs/integrations/observability/helicone.mdx +2 -2
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +146 -128
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +15 -13
- package/.docs/raw/docs/migrations/v0-15.mdx +118 -4
- package/.docs/raw/docs/primitives/attachment.mdx +2 -2
- package/.docs/raw/docs/primitives/composer.mdx +2 -2
- package/.docs/raw/docs/primitives/message.mdx +33 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +4 -2
- package/.docs/raw/docs/primitives/thread.mdx +1 -1
- package/.docs/raw/docs/react-native/hooks.mdx +14 -4
- package/.docs/raw/docs/react-native/index.mdx +1 -1
- package/.docs/raw/docs/react-native/primitives.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +35 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +9 -10
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +9 -10
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +118 -0
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +2 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +106 -27
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +19 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +34 -1
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +36 -9
- package/.docs/raw/docs/runtimes/eve/overview.mdx +51 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +51 -2
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +9 -12
- package/.docs/raw/docs/runtimes/langchain.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +5 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -7
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +4 -4
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +1 -0
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +10 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +8 -1
- package/.docs/raw/docs/tools/backend.mdx +2 -2
- package/.docs/raw/docs/tools/defining-tools.mdx +28 -7
- package/.docs/raw/docs/tools/dynamic-tools.mdx +6 -4
- package/.docs/raw/docs/tools/generative-ui-primitive.mdx +180 -0
- package/.docs/raw/docs/tools/generative-ui-slack.mdx +167 -0
- package/.docs/raw/docs/tools/generative-ui-teams.mdx +160 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +224 -211
- package/.docs/raw/docs/tools/index.mdx +2 -1
- package/.docs/raw/docs/tools/interactables.mdx +29 -17
- package/.docs/raw/docs/tools/mcp-apps.mdx +35 -6
- package/.docs/raw/docs/tools/mcp.mdx +9 -7
- package/.docs/raw/docs/tools/openui.mdx +175 -0
- package/.docs/raw/docs/tools/tool-ui.mdx +27 -24
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +17 -8
- package/.docs/raw/docs/ui/attachment.mdx +27 -0
- package/.docs/raw/docs/ui/file.mdx +7 -2
- package/.docs/raw/docs/ui/image.mdx +1 -1
- package/.docs/raw/docs/ui/mcp-config.mdx +8 -3
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/thread.mdx +24 -5
- package/.docs/raw/docs/utilities/react-o11y.mdx +7 -9
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/tools/docs.js +4 -2
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.js +2 -1
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.js +2 -1
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/tests/test-setup.js +2 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/tools/xulux-templates.js +4 -2
- package/dist/tools/xulux-templates.js.map +1 -1
- package/dist/utils/mdx.js +2 -1
- package/dist/utils/mdx.js.map +1 -1
- package/dist/xulux/catalog-client.js +1 -1
- package/dist/xulux/catalog-client.js.map +1 -1
- package/package.json +4 -4
- package/src/tools/tests/docs.test.ts +2 -2
- package/.docs/raw/docs/tools/interactables-legacy.mdx +0 -410
|
@@ -13,7 +13,7 @@ export async function POST(req: Request) {
|
|
|
13
13
|
const { messages, system, tools } = await req.json();
|
|
14
14
|
|
|
15
15
|
const result = streamText({
|
|
16
|
-
model: openai("gpt-5.
|
|
16
|
+
model: openai("gpt-5.6-luna"),
|
|
17
17
|
messages: await convertToModelMessages(messages),
|
|
18
18
|
system,
|
|
19
19
|
tools: {
|
|
@@ -267,6 +267,7 @@ import {
|
|
|
267
267
|
useAui,
|
|
268
268
|
useAuiState,
|
|
269
269
|
AuiProvider,
|
|
270
|
+
AuiConfig,
|
|
270
271
|
Suggestions,
|
|
271
272
|
Tools,
|
|
272
273
|
} from "@assistant-ui/react";
|
|
@@ -316,11 +317,16 @@ const FfmpegToolsProvider: FC<{ file: File; children: ReactNode }> = ({
|
|
|
316
317
|
|
|
317
318
|
const toolkit = useFfmpegToolkit(file, ffmpegRef);
|
|
318
319
|
|
|
319
|
-
const aui = useAui(
|
|
320
|
+
const aui = useAui();
|
|
321
|
+
const config = AuiConfig({
|
|
320
322
|
tools: Tools({ toolkit }),
|
|
321
323
|
});
|
|
322
324
|
|
|
323
|
-
return
|
|
325
|
+
return (
|
|
326
|
+
<AuiProvider extends={aui} config={config}>
|
|
327
|
+
{children}
|
|
328
|
+
</AuiProvider>
|
|
329
|
+
);
|
|
324
330
|
};
|
|
325
331
|
|
|
326
332
|
export default function Home() {
|
|
@@ -332,7 +338,8 @@ export default function Home() {
|
|
|
332
338
|
setLastFile(lastAttachment.file!);
|
|
333
339
|
}, [attachments]);
|
|
334
340
|
|
|
335
|
-
const aui = useAui(
|
|
341
|
+
const aui = useAui();
|
|
342
|
+
const config = AuiConfig({
|
|
336
343
|
suggestions: Suggestions([
|
|
337
344
|
{
|
|
338
345
|
title: "Convert video to GIF",
|
|
@@ -349,7 +356,7 @@ export default function Home() {
|
|
|
349
356
|
|
|
350
357
|
return (
|
|
351
358
|
<div className="flex h-full flex-col">
|
|
352
|
-
<AuiProvider
|
|
359
|
+
<AuiProvider extends={aui} config={config}>
|
|
353
360
|
{lastFile ? (
|
|
354
361
|
<FfmpegToolsProvider file={lastFile}>
|
|
355
362
|
<Thread />
|
|
@@ -713,18 +720,18 @@ export default withAui(nextConfig);
|
|
|
713
720
|
"start": "next start"
|
|
714
721
|
},
|
|
715
722
|
"dependencies": {
|
|
716
|
-
"@ai-sdk/openai": "^4.0.
|
|
723
|
+
"@ai-sdk/openai": "^4.0.40",
|
|
717
724
|
"@assistant-ui/react": "workspace:*",
|
|
718
725
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
719
726
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
720
727
|
"@assistant-ui/ui": "workspace:*",
|
|
721
728
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
|
722
729
|
"@ffmpeg/util": "^0.12.2",
|
|
723
|
-
"ai": "^7.0.
|
|
730
|
+
"ai": "^7.0.62",
|
|
724
731
|
"class-variance-authority": "^0.7.1",
|
|
725
732
|
"clsx": "^2.1.1",
|
|
726
|
-
"lucide-react": "^1.
|
|
727
|
-
"next": "^16.
|
|
733
|
+
"lucide-react": "^1.31.0",
|
|
734
|
+
"next": "^16.3.0",
|
|
728
735
|
"react": "^19.2.8",
|
|
729
736
|
"react-dom": "^19.2.8",
|
|
730
737
|
"tailwind-merge": "^3.6.0",
|
|
@@ -734,14 +741,13 @@ export default withAui(nextConfig);
|
|
|
734
741
|
"@assistant-ui/next": "workspace:*",
|
|
735
742
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
736
743
|
"@tailwindcss/postcss": "^4.3.3",
|
|
737
|
-
"@types/node": "^26.
|
|
738
|
-
"@types/react": "^19.2.
|
|
739
|
-
"@types/react-dom": "^19.2.
|
|
740
|
-
"postcss": "^8.5.
|
|
744
|
+
"@types/node": "^26.2.0",
|
|
745
|
+
"@types/react": "^19.2.18",
|
|
746
|
+
"@types/react-dom": "^19.2.4",
|
|
747
|
+
"postcss": "^8.5.26",
|
|
741
748
|
"tailwindcss": "^4.3.3",
|
|
742
749
|
"tw-animate-css": "^1.4.0",
|
|
743
|
-
"typescript": "
|
|
744
|
-
"typescript-7": "npm:typescript@^7.0.2"
|
|
750
|
+
"typescript": "^7.0.2"
|
|
745
751
|
}
|
|
746
752
|
}
|
|
747
753
|
|
|
@@ -45,7 +45,7 @@ export async function POST(req: Request) {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
const result = streamText({
|
|
48
|
-
model: openai("gpt-5.
|
|
48
|
+
model: openai("gpt-5.6-luna"),
|
|
49
49
|
messages: await convertToModelMessages(messages),
|
|
50
50
|
stopWhen: stepCountIs(10),
|
|
51
51
|
...(system ? { system } : {}),
|
|
@@ -112,6 +112,50 @@ export async function POST(req: Request) {
|
|
|
112
112
|
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
+
## app/api/present/route.ts
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { openai } from "@ai-sdk/openai";
|
|
119
|
+
import { streamText, convertToModelMessages, stepCountIs } from "ai";
|
|
120
|
+
import type { UIMessage } from "ai";
|
|
121
|
+
import {
|
|
122
|
+
AISDKToolkit,
|
|
123
|
+
type AISDKToolkitToolsOptions,
|
|
124
|
+
} from "@assistant-ui/react-ai-sdk";
|
|
125
|
+
import presentToolkit from "../../present-toolkit";
|
|
126
|
+
|
|
127
|
+
export const maxDuration = 30;
|
|
128
|
+
|
|
129
|
+
const aiToolkit = new AISDKToolkit({ toolkit: presentToolkit });
|
|
130
|
+
|
|
131
|
+
type FrontendToolDefs = NonNullable<AISDKToolkitToolsOptions["frontend"]>;
|
|
132
|
+
|
|
133
|
+
export async function POST(req: Request) {
|
|
134
|
+
const {
|
|
135
|
+
messages,
|
|
136
|
+
system,
|
|
137
|
+
tools: clientTools,
|
|
138
|
+
}: {
|
|
139
|
+
messages: UIMessage[];
|
|
140
|
+
system?: string;
|
|
141
|
+
tools?: FrontendToolDefs;
|
|
142
|
+
} = await req.json();
|
|
143
|
+
|
|
144
|
+
const result = streamText({
|
|
145
|
+
model: openai("gpt-5.6-luna"),
|
|
146
|
+
messages: await convertToModelMessages(messages),
|
|
147
|
+
stopWhen: stepCountIs(10),
|
|
148
|
+
...(system ? { system } : {}),
|
|
149
|
+
tools: await aiToolkit.tools({
|
|
150
|
+
...(clientTools && { frontend: clientTools }),
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
return result.toUIMessageStreamResponse();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
|
|
115
159
|
## app/globals.css
|
|
116
160
|
|
|
117
161
|
```css
|
|
@@ -253,9 +297,9 @@ import {
|
|
|
253
297
|
} from "@/components/assistant-ui/thread";
|
|
254
298
|
import {
|
|
255
299
|
AssistantRuntimeProvider,
|
|
300
|
+
AuiConfig,
|
|
256
301
|
Suggestions,
|
|
257
302
|
useAssistantInstructions,
|
|
258
|
-
useAui,
|
|
259
303
|
} from "@assistant-ui/react";
|
|
260
304
|
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
261
305
|
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
@@ -289,7 +333,7 @@ export default function GuiChatPage() {
|
|
|
289
333
|
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
290
334
|
});
|
|
291
335
|
|
|
292
|
-
const
|
|
336
|
+
const config = AuiConfig({
|
|
293
337
|
suggestions: Suggestions([
|
|
294
338
|
{
|
|
295
339
|
title: "Welcome card",
|
|
@@ -307,7 +351,7 @@ export default function GuiChatPage() {
|
|
|
307
351
|
});
|
|
308
352
|
|
|
309
353
|
return (
|
|
310
|
-
<AssistantRuntimeProvider
|
|
354
|
+
<AssistantRuntimeProvider config={config} runtime={runtime}>
|
|
311
355
|
<GuiChatInstructions />
|
|
312
356
|
<div className="flex h-full flex-col">
|
|
313
357
|
<ExampleNav />
|
|
@@ -325,12 +369,13 @@ export default function GuiChatPage() {
|
|
|
325
369
|
|
|
326
370
|
```tsx
|
|
327
371
|
import type { Metadata } from "next";
|
|
372
|
+
import { GenerativeUIStyle } from "@/components/generative-ui-style";
|
|
328
373
|
import "./globals.css";
|
|
329
374
|
|
|
330
375
|
export const metadata: Metadata = {
|
|
331
376
|
title: "assistant-ui Generative UI Example",
|
|
332
377
|
description:
|
|
333
|
-
"Example showcasing
|
|
378
|
+
"Example showcasing model-composed interfaces with the present tool and a custom component vocabulary",
|
|
334
379
|
};
|
|
335
380
|
|
|
336
381
|
export default function RootLayout({
|
|
@@ -340,6 +385,9 @@ export default function RootLayout({
|
|
|
340
385
|
}>) {
|
|
341
386
|
return (
|
|
342
387
|
<html lang="en">
|
|
388
|
+
<head>
|
|
389
|
+
<GenerativeUIStyle />
|
|
390
|
+
</head>
|
|
343
391
|
<body className="h-dvh">{children}</body>
|
|
344
392
|
</html>
|
|
345
393
|
);
|
|
@@ -355,50 +403,56 @@ export default function RootLayout({
|
|
|
355
403
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
356
404
|
import {
|
|
357
405
|
AssistantRuntimeProvider,
|
|
406
|
+
AuiConfig,
|
|
358
407
|
Suggestions,
|
|
359
408
|
Tools,
|
|
360
|
-
useAui,
|
|
361
409
|
} from "@assistant-ui/react";
|
|
362
|
-
import {
|
|
410
|
+
import {
|
|
411
|
+
AssistantChatTransport,
|
|
412
|
+
useChatRuntime,
|
|
413
|
+
} from "@assistant-ui/react-ai-sdk";
|
|
363
414
|
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
364
415
|
import { ExampleNav } from "@/components/example-nav";
|
|
365
|
-
import toolkit from "./toolkit";
|
|
416
|
+
import toolkit from "./present-toolkit";
|
|
366
417
|
|
|
367
418
|
export default function Home() {
|
|
368
419
|
const runtime = useChatRuntime({
|
|
420
|
+
transport: new AssistantChatTransport({ api: "/api/present" }),
|
|
369
421
|
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
370
422
|
});
|
|
371
423
|
|
|
372
|
-
const
|
|
424
|
+
const config = AuiConfig({
|
|
373
425
|
tools: Tools({ toolkit }),
|
|
374
426
|
suggestions: Suggestions([
|
|
375
427
|
{
|
|
376
|
-
title: "
|
|
377
|
-
label: "
|
|
428
|
+
title: "Sales dashboard",
|
|
429
|
+
label: "for last quarter",
|
|
378
430
|
prompt:
|
|
379
|
-
"
|
|
431
|
+
"Show me a Q2 2026 sales dashboard. Revenue was $412k in April, $488k in May and $551k in June, on 1,284 orders, at a 3.4% conversion rate.",
|
|
380
432
|
},
|
|
381
433
|
{
|
|
382
|
-
title: "
|
|
383
|
-
label: "
|
|
384
|
-
prompt:
|
|
434
|
+
title: "Product analytics",
|
|
435
|
+
label: "activation and retention",
|
|
436
|
+
prompt:
|
|
437
|
+
"How did we trend over the last six weeks? Activation went 41%, 44%, 43%, 48%, 52%, 55%, and week-4 retention went 22%, 24%, 23%, 27%, 29%, 31%.",
|
|
385
438
|
},
|
|
386
439
|
{
|
|
387
|
-
title: "
|
|
388
|
-
label: "
|
|
440
|
+
title: "Support overview",
|
|
441
|
+
label: "tickets and response time",
|
|
389
442
|
prompt:
|
|
390
|
-
"
|
|
443
|
+
"Give me a support overview. Open tickets: 12 urgent, 38 high, 91 normal, 24 low. Median first response is 47 minutes, down from 62 last week.",
|
|
391
444
|
},
|
|
392
445
|
{
|
|
393
|
-
title: "
|
|
394
|
-
label: "
|
|
395
|
-
prompt:
|
|
446
|
+
title: "Channel performance",
|
|
447
|
+
label: "compare acquisition sources",
|
|
448
|
+
prompt:
|
|
449
|
+
"Compare our acquisition channels. Search: $18k spend, 420 conversions. Social: $11k, 260. Email: $3k, 190. Referral: $6k, 150.",
|
|
396
450
|
},
|
|
397
451
|
]),
|
|
398
452
|
});
|
|
399
453
|
|
|
400
454
|
return (
|
|
401
|
-
<AssistantRuntimeProvider
|
|
455
|
+
<AssistantRuntimeProvider config={config} runtime={runtime}>
|
|
402
456
|
<div className="flex h-full flex-col">
|
|
403
457
|
<ExampleNav />
|
|
404
458
|
<main className="min-h-0 flex-1">
|
|
@@ -411,6 +465,60 @@ export default function Home() {
|
|
|
411
465
|
|
|
412
466
|
```
|
|
413
467
|
|
|
468
|
+
## app/present-toolkit.tsx
|
|
469
|
+
|
|
470
|
+
```tsx
|
|
471
|
+
"use generative";
|
|
472
|
+
|
|
473
|
+
import { defineToolkit } from "@assistant-ui/react";
|
|
474
|
+
import {
|
|
475
|
+
JSONGenerativeUI,
|
|
476
|
+
defaultGenerativeUILibrary,
|
|
477
|
+
defineGenerativeComponents,
|
|
478
|
+
} from "@assistant-ui/react-generative-ui";
|
|
479
|
+
import { styledGenerativeUILibrary } from "@/components/assistant-ui/generative-ui";
|
|
480
|
+
import { DashboardHeader } from "@/components/dashboard-header";
|
|
481
|
+
import { z } from "zod";
|
|
482
|
+
|
|
483
|
+
const markdown = defaultGenerativeUILibrary.Markdown!;
|
|
484
|
+
|
|
485
|
+
const generative = new JSONGenerativeUI({
|
|
486
|
+
library: {
|
|
487
|
+
...defaultGenerativeUILibrary,
|
|
488
|
+
...defineGenerativeComponents({
|
|
489
|
+
Markdown: {
|
|
490
|
+
properties: markdown.properties,
|
|
491
|
+
streamProperties: markdown.streamProperties,
|
|
492
|
+
description:
|
|
493
|
+
"A markdown string, rendered with GitHub-flavored markdown.",
|
|
494
|
+
render: styledGenerativeUILibrary.Markdown!.render,
|
|
495
|
+
},
|
|
496
|
+
DashboardHeader: {
|
|
497
|
+
description:
|
|
498
|
+
"A heading for a dashboard, with an optional description and reporting period.",
|
|
499
|
+
properties: z.object({
|
|
500
|
+
title: z.string().describe("The dashboard title."),
|
|
501
|
+
description: z
|
|
502
|
+
.string()
|
|
503
|
+
.optional()
|
|
504
|
+
.describe("A short description of the dashboard."),
|
|
505
|
+
period: z
|
|
506
|
+
.string()
|
|
507
|
+
.optional()
|
|
508
|
+
.describe("The reporting period shown beside the title."),
|
|
509
|
+
}),
|
|
510
|
+
render: (props) => <DashboardHeader {...props} />,
|
|
511
|
+
},
|
|
512
|
+
}),
|
|
513
|
+
},
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
export default defineToolkit({
|
|
517
|
+
present: generative.present({ display: "standalone" }),
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
```
|
|
521
|
+
|
|
414
522
|
## app/primitive/page.tsx
|
|
415
523
|
|
|
416
524
|
```tsx
|
|
@@ -512,6 +620,70 @@ export default function GenerativeUIPrimitivePage() {
|
|
|
512
620
|
|
|
513
621
|
```
|
|
514
622
|
|
|
623
|
+
## app/tool-ui/page.tsx
|
|
624
|
+
|
|
625
|
+
```tsx
|
|
626
|
+
"use client";
|
|
627
|
+
|
|
628
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
629
|
+
import {
|
|
630
|
+
AssistantRuntimeProvider,
|
|
631
|
+
AuiConfig,
|
|
632
|
+
Suggestions,
|
|
633
|
+
Tools,
|
|
634
|
+
} from "@assistant-ui/react";
|
|
635
|
+
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
636
|
+
import { lastAssistantMessageIsCompleteWithToolCalls } from "ai";
|
|
637
|
+
import { ExampleNav } from "@/components/example-nav";
|
|
638
|
+
import toolkit from "../toolkit";
|
|
639
|
+
|
|
640
|
+
export default function Home() {
|
|
641
|
+
const runtime = useChatRuntime({
|
|
642
|
+
sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls,
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
const config = AuiConfig({
|
|
646
|
+
tools: Tools({ toolkit }),
|
|
647
|
+
suggestions: Suggestions([
|
|
648
|
+
{
|
|
649
|
+
title: "Show a bar chart",
|
|
650
|
+
label: "of quarterly revenue",
|
|
651
|
+
prompt:
|
|
652
|
+
"Create a bar chart showing quarterly revenue: Q1 $45k, Q2 $52k, Q3 $61k, Q4 $58k",
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
title: "Pick a date",
|
|
656
|
+
label: "for a meeting",
|
|
657
|
+
prompt: "I need to schedule a meeting. Ask me to pick a date.",
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
title: "Collect my contact info",
|
|
661
|
+
label: "name, email, phone",
|
|
662
|
+
prompt:
|
|
663
|
+
"I want to sign up for the newsletter. Ask for my name, email, and phone number.",
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
title: "Show me on the map",
|
|
667
|
+
label: "the Eiffel Tower",
|
|
668
|
+
prompt: "Show me the Eiffel Tower on a map",
|
|
669
|
+
},
|
|
670
|
+
]),
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
return (
|
|
674
|
+
<AssistantRuntimeProvider config={config} runtime={runtime}>
|
|
675
|
+
<div className="flex h-full flex-col">
|
|
676
|
+
<ExampleNav />
|
|
677
|
+
<main className="min-h-0 flex-1">
|
|
678
|
+
<Thread />
|
|
679
|
+
</main>
|
|
680
|
+
</div>
|
|
681
|
+
</AssistantRuntimeProvider>
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
```
|
|
686
|
+
|
|
515
687
|
## app/toolkit.tsx
|
|
516
688
|
|
|
517
689
|
```tsx
|
|
@@ -1069,6 +1241,41 @@ export const ContactFormToolUI: ToolCallMessagePartComponent<
|
|
|
1069
1241
|
|
|
1070
1242
|
```
|
|
1071
1243
|
|
|
1244
|
+
## components/dashboard-header.tsx
|
|
1245
|
+
|
|
1246
|
+
```tsx
|
|
1247
|
+
"use client";
|
|
1248
|
+
|
|
1249
|
+
type DashboardHeaderProps = {
|
|
1250
|
+
title: string;
|
|
1251
|
+
description?: string;
|
|
1252
|
+
period?: string;
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
export function DashboardHeader({
|
|
1256
|
+
title,
|
|
1257
|
+
description,
|
|
1258
|
+
period,
|
|
1259
|
+
}: DashboardHeaderProps) {
|
|
1260
|
+
return (
|
|
1261
|
+
<header className="flex flex-wrap items-start justify-between gap-3">
|
|
1262
|
+
<div className="min-w-0">
|
|
1263
|
+
<h2 className="text-lg font-semibold tracking-tight">{title}</h2>
|
|
1264
|
+
{description ? (
|
|
1265
|
+
<p className="text-muted-foreground mt-1 text-sm">{description}</p>
|
|
1266
|
+
) : null}
|
|
1267
|
+
</div>
|
|
1268
|
+
{period ? (
|
|
1269
|
+
<span className="bg-muted text-muted-foreground rounded-full px-2.5 py-1 text-xs font-medium">
|
|
1270
|
+
{period}
|
|
1271
|
+
</span>
|
|
1272
|
+
) : null}
|
|
1273
|
+
</header>
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
```
|
|
1278
|
+
|
|
1072
1279
|
## components/date-picker-tool-ui.tsx
|
|
1073
1280
|
|
|
1074
1281
|
```tsx
|
|
@@ -1141,9 +1348,10 @@ export const DatePickerToolUI: ToolCallMessagePartComponent<
|
|
|
1141
1348
|
import Link from "next/link";
|
|
1142
1349
|
|
|
1143
1350
|
const links = [
|
|
1144
|
-
{ href: "/", label: "
|
|
1145
|
-
{ href: "/
|
|
1146
|
-
{ href: "/
|
|
1351
|
+
{ href: "/", label: "Generative UI" },
|
|
1352
|
+
{ href: "/tool-ui", label: "Tool UI" },
|
|
1353
|
+
{ href: "/primitive", label: "Static primitive (legacy)" },
|
|
1354
|
+
{ href: "/gui-chat", label: "GUI chat (legacy)" },
|
|
1147
1355
|
] as const;
|
|
1148
1356
|
|
|
1149
1357
|
export function ExampleNav() {
|
|
@@ -1165,6 +1373,33 @@ export function ExampleNav() {
|
|
|
1165
1373
|
|
|
1166
1374
|
```
|
|
1167
1375
|
|
|
1376
|
+
## components/generative-ui-style.tsx
|
|
1377
|
+
|
|
1378
|
+
```tsx
|
|
1379
|
+
import {
|
|
1380
|
+
generativeUiCssText,
|
|
1381
|
+
generativeUiThemeVars,
|
|
1382
|
+
} from "@assistant-ui/ui/lib/generative-ui-vocabulary-css";
|
|
1383
|
+
|
|
1384
|
+
function themeVarsBlock(selector: string, vars: Record<string, string>) {
|
|
1385
|
+
const body = Object.entries(vars)
|
|
1386
|
+
.map(([name, value]) => ` ${name}: ${value};`)
|
|
1387
|
+
.join("\n");
|
|
1388
|
+
return `${selector} {\n${body}\n}`;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
export function GenerativeUIStyle() {
|
|
1392
|
+
const css = [
|
|
1393
|
+
themeVarsBlock(":root", generativeUiThemeVars.light),
|
|
1394
|
+
themeVarsBlock(".dark", generativeUiThemeVars.dark),
|
|
1395
|
+
generativeUiCssText(),
|
|
1396
|
+
].join("\n\n");
|
|
1397
|
+
|
|
1398
|
+
return <style>{css}</style>;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
```
|
|
1402
|
+
|
|
1168
1403
|
## components/gui/index.tsx
|
|
1169
1404
|
|
|
1170
1405
|
```tsx
|
|
@@ -1500,18 +1735,19 @@ export default withAui(nextConfig);
|
|
|
1500
1735
|
"test": "vitest run"
|
|
1501
1736
|
},
|
|
1502
1737
|
"dependencies": {
|
|
1503
|
-
"@ai-sdk/openai": "^4.0.
|
|
1738
|
+
"@ai-sdk/openai": "^4.0.40",
|
|
1504
1739
|
"@assistant-ui/react": "workspace:*",
|
|
1505
1740
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
1741
|
+
"@assistant-ui/react-generative-ui": "workspace:*",
|
|
1506
1742
|
"@assistant-ui/ui": "workspace:*",
|
|
1507
|
-
"ai": "^7.0.
|
|
1743
|
+
"ai": "^7.0.62",
|
|
1508
1744
|
"class-variance-authority": "^0.7.1",
|
|
1509
1745
|
"clsx": "^2.1.1",
|
|
1510
|
-
"lucide-react": "^1.
|
|
1511
|
-
"next": "^16.
|
|
1746
|
+
"lucide-react": "^1.31.0",
|
|
1747
|
+
"next": "^16.3.0",
|
|
1512
1748
|
"react": "^19.2.8",
|
|
1513
1749
|
"react-dom": "^19.2.8",
|
|
1514
|
-
"recharts": "^3.10.
|
|
1750
|
+
"recharts": "^3.10.1",
|
|
1515
1751
|
"tailwind-merge": "^3.6.0",
|
|
1516
1752
|
"zod": "^4.4.3"
|
|
1517
1753
|
},
|
|
@@ -1519,14 +1755,13 @@ export default withAui(nextConfig);
|
|
|
1519
1755
|
"@assistant-ui/next": "workspace:*",
|
|
1520
1756
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1521
1757
|
"@tailwindcss/postcss": "^4.3.3",
|
|
1522
|
-
"@types/node": "^26.
|
|
1523
|
-
"@types/react": "^19.2.
|
|
1524
|
-
"@types/react-dom": "^19.2.
|
|
1525
|
-
"postcss": "^8.5.
|
|
1758
|
+
"@types/node": "^26.2.0",
|
|
1759
|
+
"@types/react": "^19.2.18",
|
|
1760
|
+
"@types/react-dom": "^19.2.4",
|
|
1761
|
+
"postcss": "^8.5.26",
|
|
1526
1762
|
"tailwindcss": "^4.3.3",
|
|
1527
1763
|
"tw-animate-css": "^1.4.0",
|
|
1528
|
-
"typescript": "
|
|
1529
|
-
"typescript-7": "npm:typescript@^7.0.2",
|
|
1764
|
+
"typescript": "^7.0.2",
|
|
1530
1765
|
"vitest": "^4.1.10"
|
|
1531
1766
|
}
|
|
1532
1767
|
}
|
|
@@ -240,10 +240,16 @@ export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
|
240
240
|
"use client";
|
|
241
241
|
|
|
242
242
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
243
|
-
import {
|
|
243
|
+
import {
|
|
244
|
+
useAui,
|
|
245
|
+
AuiProvider,
|
|
246
|
+
AuiConfig,
|
|
247
|
+
Suggestions,
|
|
248
|
+
} from "@assistant-ui/react";
|
|
244
249
|
|
|
245
250
|
function ThreadWithSuggestions() {
|
|
246
|
-
const aui = useAui(
|
|
251
|
+
const aui = useAui();
|
|
252
|
+
const config = AuiConfig({
|
|
247
253
|
suggestions: Suggestions([
|
|
248
254
|
{
|
|
249
255
|
title: "What can you do",
|
|
@@ -258,7 +264,7 @@ function ThreadWithSuggestions() {
|
|
|
258
264
|
]),
|
|
259
265
|
});
|
|
260
266
|
return (
|
|
261
|
-
<AuiProvider
|
|
267
|
+
<AuiProvider extends={aui} config={config}>
|
|
262
268
|
<Thread />
|
|
263
269
|
</AuiProvider>
|
|
264
270
|
);
|
|
@@ -305,11 +311,11 @@ export default withAui(nextConfig);
|
|
|
305
311
|
"@assistant-ui/react-google-adk": "workspace:*",
|
|
306
312
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
307
313
|
"@assistant-ui/ui": "workspace:*",
|
|
308
|
-
"@google/adk": "^1.
|
|
314
|
+
"@google/adk": "^1.6.0",
|
|
309
315
|
"class-variance-authority": "^0.7.1",
|
|
310
316
|
"clsx": "^2.1.1",
|
|
311
|
-
"lucide-react": "^1.
|
|
312
|
-
"next": "^16.
|
|
317
|
+
"lucide-react": "^1.31.0",
|
|
318
|
+
"next": "^16.3.0",
|
|
313
319
|
"react": "^19.2.8",
|
|
314
320
|
"react-dom": "^19.2.8",
|
|
315
321
|
"tailwind-merge": "^3.6.0",
|
|
@@ -319,14 +325,13 @@ export default withAui(nextConfig);
|
|
|
319
325
|
"@assistant-ui/next": "workspace:*",
|
|
320
326
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
321
327
|
"@tailwindcss/postcss": "^4.3.3",
|
|
322
|
-
"@types/node": "^26.
|
|
323
|
-
"@types/react": "^19.2.
|
|
324
|
-
"@types/react-dom": "^19.2.
|
|
325
|
-
"postcss": "^8.5.
|
|
328
|
+
"@types/node": "^26.2.0",
|
|
329
|
+
"@types/react": "^19.2.18",
|
|
330
|
+
"@types/react-dom": "^19.2.4",
|
|
331
|
+
"postcss": "^8.5.26",
|
|
326
332
|
"tailwindcss": "^4.3.3",
|
|
327
333
|
"tw-animate-css": "^1.4.0",
|
|
328
|
-
"typescript": "
|
|
329
|
-
"typescript-7": "npm:typescript@^7.0.2"
|
|
334
|
+
"typescript": "^7.0.2"
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
337
|
|
|
@@ -269,7 +269,7 @@ export default withAui(nextConfig);
|
|
|
269
269
|
},
|
|
270
270
|
"dependencies": {
|
|
271
271
|
"heat-graph": "workspace:*",
|
|
272
|
-
"next": "^16.
|
|
272
|
+
"next": "^16.3.0",
|
|
273
273
|
"react": "^19.2.8",
|
|
274
274
|
"react-dom": "^19.2.8"
|
|
275
275
|
},
|
|
@@ -277,13 +277,12 @@ export default withAui(nextConfig);
|
|
|
277
277
|
"@assistant-ui/next": "workspace:*",
|
|
278
278
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
279
279
|
"@tailwindcss/postcss": "^4.3.3",
|
|
280
|
-
"@types/node": "^26.
|
|
281
|
-
"@types/react": "^19.2.
|
|
282
|
-
"@types/react-dom": "^19.2.
|
|
283
|
-
"postcss": "^8.5.
|
|
280
|
+
"@types/node": "^26.2.0",
|
|
281
|
+
"@types/react": "^19.2.18",
|
|
282
|
+
"@types/react-dom": "^19.2.4",
|
|
283
|
+
"postcss": "^8.5.26",
|
|
284
284
|
"tailwindcss": "^4.3.3",
|
|
285
|
-
"typescript": "
|
|
286
|
-
"typescript-7": "npm:typescript@^7.0.2"
|
|
285
|
+
"typescript": "^7.0.2"
|
|
287
286
|
}
|
|
288
287
|
}
|
|
289
288
|
|
|
@@ -380,14 +380,14 @@ export default withAui(nextConfig);
|
|
|
380
380
|
"start": "next start"
|
|
381
381
|
},
|
|
382
382
|
"dependencies": {
|
|
383
|
-
"@ai-sdk/openai": "^4.0.
|
|
383
|
+
"@ai-sdk/openai": "^4.0.40",
|
|
384
384
|
"@assistant-ui/react": "workspace:*",
|
|
385
385
|
"@assistant-ui/ui": "workspace:*",
|
|
386
|
-
"ai": "^7.0.
|
|
386
|
+
"ai": "^7.0.62",
|
|
387
387
|
"class-variance-authority": "^0.7.1",
|
|
388
388
|
"clsx": "^2.1.1",
|
|
389
|
-
"lucide-react": "^1.
|
|
390
|
-
"next": "^16.
|
|
389
|
+
"lucide-react": "^1.31.0",
|
|
390
|
+
"next": "^16.3.0",
|
|
391
391
|
"react": "^19.2.8",
|
|
392
392
|
"react-dom": "^19.2.8",
|
|
393
393
|
"tailwind-merge": "^3.6.0"
|
|
@@ -396,14 +396,13 @@ export default withAui(nextConfig);
|
|
|
396
396
|
"@assistant-ui/next": "workspace:*",
|
|
397
397
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
398
398
|
"@tailwindcss/postcss": "^4.3.3",
|
|
399
|
-
"@types/node": "^26.
|
|
400
|
-
"@types/react": "^19.2.
|
|
401
|
-
"@types/react-dom": "^19.2.
|
|
402
|
-
"postcss": "^8.5.
|
|
399
|
+
"@types/node": "^26.2.0",
|
|
400
|
+
"@types/react": "^19.2.18",
|
|
401
|
+
"@types/react-dom": "^19.2.4",
|
|
402
|
+
"postcss": "^8.5.26",
|
|
403
403
|
"tailwindcss": "^4.3.3",
|
|
404
404
|
"tw-animate-css": "^1.4.0",
|
|
405
|
-
"typescript": "
|
|
406
|
-
"typescript-7": "npm:typescript@^7.0.2"
|
|
405
|
+
"typescript": "^7.0.2"
|
|
407
406
|
}
|
|
408
407
|
}
|
|
409
408
|
|