@assistant-ui/mcp-docs-server 0.2.1 → 0.2.3
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 +3 -3
- package/.docs/organized/code-examples/with-a2a.md +5 -4
- package/.docs/organized/code-examples/with-ag-ui.md +7 -6
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +14 -13
- package/.docs/organized/code-examples/with-artifacts.md +12 -11
- package/.docs/organized/code-examples/with-assistant-transport.md +6 -5
- package/.docs/organized/code-examples/with-browser-extension.md +6 -6
- package/.docs/organized/code-examples/with-chain-of-thought.md +16 -14
- package/.docs/organized/code-examples/with-cloud-standalone.md +7 -7
- package/.docs/organized/code-examples/with-cloud.md +11 -10
- package/.docs/organized/code-examples/with-custom-thread-list.md +11 -10
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +14 -13
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +15 -14
- package/.docs/organized/code-examples/with-eve.md +6 -5
- package/.docs/organized/code-examples/with-expo.md +213 -36
- package/.docs/organized/code-examples/with-external-store.md +6 -5
- package/.docs/organized/code-examples/with-ffmpeg.md +11 -10
- package/.docs/organized/code-examples/with-generative-ui.md +263 -29
- package/.docs/organized/code-examples/with-google-adk.md +5 -4
- package/.docs/organized/code-examples/with-heat-graph.md +3 -3
- package/.docs/organized/code-examples/with-image-generation.md +8 -7
- package/.docs/organized/code-examples/with-interactables.md +11 -10
- package/.docs/organized/code-examples/with-langchain.md +10 -9
- package/.docs/organized/code-examples/with-langgraph.md +7 -6
- package/.docs/organized/code-examples/with-livekit.md +15 -14
- package/.docs/organized/code-examples/with-mcp.md +14 -12
- package/.docs/organized/code-examples/with-nuxt.md +511 -575
- package/.docs/organized/code-examples/with-opencode.md +4 -4
- package/.docs/organized/code-examples/with-openui.md +450 -0
- package/.docs/organized/code-examples/with-pi.md +6 -5
- package/.docs/organized/code-examples/with-react-hook-form.md +16 -13
- package/.docs/organized/code-examples/with-react-ink-web.md +65 -15
- package/.docs/organized/code-examples/with-react-ink.md +5 -4
- package/.docs/organized/code-examples/with-react-router.md +8 -7
- package/.docs/organized/code-examples/with-resumable-stream.md +13 -12
- package/.docs/organized/code-examples/with-store.md +3 -3
- 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 +10 -9
- package/.docs/organized/code-examples/with-tap-runtime.md +5 -4
- package/.docs/organized/code-examples/with-virtualized-thread.md +6 -5
- package/.docs/organized/code-examples/with-vue.md +2 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/cli.mdx +6 -1
- package/.docs/raw/docs/{(docs) → (getting-started)}/devtools.mdx +1 -1
- package/.docs/raw/docs/{(docs) → (getting-started)}/index.mdx +4 -2
- package/.docs/raw/docs/{(docs) → (getting-started)}/installation.mdx +26 -26
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +6 -1
- 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/{react-ai-sdk.mdx → ai-sdk.mdx} +43 -18
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +61 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +3 -3
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +20 -2
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +32 -1
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +1 -1
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +10 -10
- package/.docs/raw/docs/cloud/ai-sdk.mdx +4 -2
- package/.docs/raw/docs/cloud/index.mdx +1 -1
- package/.docs/raw/docs/copilots/assistant-frame.mdx +19 -8
- package/.docs/raw/docs/guides/attachments.mdx +4 -4
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +1 -1
- package/.docs/raw/docs/guides/context-api.mdx +15 -17
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/latex.mdx +1 -1
- package/.docs/raw/docs/guides/mentions.mdx +2 -0
- package/.docs/raw/docs/guides/message-timing.mdx +11 -5
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-streams.mdx +3 -3
- package/.docs/raw/docs/guides/speech.mdx +1 -1
- package/.docs/raw/docs/guides/suggestions.mdx +8 -5
- package/.docs/raw/docs/guides/voice.mdx +1 -1
- package/.docs/raw/docs/ink/hooks.mdx +1 -1
- package/.docs/raw/docs/ink/index.mdx +3 -2
- package/.docs/raw/docs/ink/migration.mdx +1 -1
- package/.docs/raw/docs/ink/primitives.mdx +1 -1
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/{cloudflare-agents/overview.mdx → cloudflare-agents.mdx} +4 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/index.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +149 -131
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +2 -2
- package/.docs/raw/docs/migrations/v0-15.mdx +34 -0
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -1
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -1
- package/.docs/raw/docs/primitives/attachment.mdx +1 -1
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +3 -3
- package/.docs/raw/docs/primitives/composer.mdx +1 -1
- package/.docs/raw/docs/primitives/error.mdx +1 -1
- package/.docs/raw/docs/primitives/message.mdx +1 -1
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +4 -2
- package/.docs/raw/docs/primitives/thread-list.mdx +1 -1
- package/.docs/raw/docs/primitives/thread.mdx +2 -2
- package/.docs/raw/docs/react-native/adapters.mdx +1 -1
- package/.docs/raw/docs/react-native/index.mdx +2 -2
- package/.docs/raw/docs/react-native/migration.mdx +2 -2
- package/.docs/raw/docs/react-native/primitives.mdx +142 -5
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +48 -6
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +3 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +4 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +31 -16
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +118 -0
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +3 -3
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +2 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +73 -33
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +6 -2
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +4 -0
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +9 -2
- package/.docs/raw/docs/tools/backend.mdx +4 -4
- package/.docs/raw/docs/tools/defining-tools.mdx +21 -2
- 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 +8 -7
- package/.docs/raw/docs/tools/mcp-apps.mdx +18 -1
- package/.docs/raw/docs/tools/mcp.mdx +2 -2
- package/.docs/raw/docs/tools/openui.mdx +175 -0
- package/.docs/raw/docs/tools/tool-ui.mdx +18 -7
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +7 -3
- package/.docs/raw/docs/ui/assistant-modal.mdx +3 -3
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -1
- package/.docs/raw/docs/ui/attachment.mdx +50 -3
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +36 -1
- package/.docs/raw/docs/ui/context-display.mdx +1 -1
- package/.docs/raw/docs/ui/directive-text.mdx +1 -1
- package/.docs/raw/docs/ui/file.mdx +2 -2
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +1 -1
- package/.docs/raw/docs/ui/image.mdx +2 -2
- package/.docs/raw/docs/ui/markdown.mdx +40 -1
- package/.docs/raw/docs/ui/mermaid.mdx +1 -1
- package/.docs/raw/docs/ui/message-timing.mdx +1 -1
- package/.docs/raw/docs/ui/model-selector.mdx +4 -4
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/quote.mdx +3 -3
- package/.docs/raw/docs/ui/reasoning.mdx +31 -3
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -1
- package/.docs/raw/docs/ui/sources.mdx +10 -1
- package/.docs/raw/docs/ui/streamdown.mdx +2 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -1
- package/.docs/raw/docs/ui/thread-list.mdx +40 -1
- package/.docs/raw/docs/ui/thread.mdx +49 -2
- package/.docs/raw/docs/ui/tool-fallback.mdx +23 -9
- package/.docs/raw/docs/ui/tool-group.mdx +1 -1
- package/.docs/raw/docs/ui/voice.mdx +1 -1
- package/.docs/raw/docs/utilities/react-o11y.mdx +2 -2
- package/dist/xulux/catalog-client.d.ts.map +1 -1
- package/dist/xulux/catalog-client.js +51 -6
- package/dist/xulux/catalog-client.js.map +1 -1
- package/dist/xulux/types.d.ts +7 -7
- package/dist/xulux/types.d.ts.map +1 -1
- package/dist/xulux/types.js.map +1 -1
- package/package.json +5 -5
- package/src/tools/tests/docs.test.ts +10 -7
- package/src/tools/tests/path-traversal.test.ts +5 -2
- package/src/tools/tests/xulux-templates.test.ts +63 -0
- package/src/xulux/catalog-client.ts +68 -23
- package/src/xulux/types.ts +17 -13
- package/.docs/raw/docs/tools/interactables-legacy.mdx +0 -423
- package/.docs/raw/docs/ui/accordion.mdx +0 -266
- package/.docs/raw/docs/ui/badge.mdx +0 -150
- package/.docs/raw/docs/ui/diff-viewer.mdx +0 -280
- package/.docs/raw/docs/ui/dot-matrix.mdx +0 -133
- package/.docs/raw/docs/ui/number-roll.mdx +0 -154
- package/.docs/raw/docs/ui/select.mdx +0 -254
- package/.docs/raw/docs/ui/tabs.mdx +0 -271
- /package/.docs/raw/docs/{(docs) → (getting-started)}/architecture.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/base-ui.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/llm.mdx +0 -0
- /package/.docs/raw/docs/{(docs) → (getting-started)}/rtl.mdx +0 -0
|
@@ -1902,8 +1902,8 @@ export default withAui(nextConfig);
|
|
|
1902
1902
|
"@pierre/diffs": "^1.3.5",
|
|
1903
1903
|
"class-variance-authority": "^0.7.1",
|
|
1904
1904
|
"clsx": "^2.1.1",
|
|
1905
|
-
"lucide-react": "^1.
|
|
1906
|
-
"next": "^16.3.
|
|
1905
|
+
"lucide-react": "^1.33.0",
|
|
1906
|
+
"next": "^16.3.2",
|
|
1907
1907
|
"react": "^19.2.8",
|
|
1908
1908
|
"react-dom": "^19.2.8",
|
|
1909
1909
|
"tailwind-merge": "^3.6.0",
|
|
@@ -1913,9 +1913,9 @@ export default withAui(nextConfig);
|
|
|
1913
1913
|
"@assistant-ui/next": "workspace:*",
|
|
1914
1914
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1915
1915
|
"@tailwindcss/postcss": "^4.3.3",
|
|
1916
|
-
"@types/node": "^26.
|
|
1916
|
+
"@types/node": "^26.2.0",
|
|
1917
1917
|
"@types/react": "^19.2.18",
|
|
1918
|
-
"@types/react-dom": "^19.2.
|
|
1918
|
+
"@types/react-dom": "^19.2.5",
|
|
1919
1919
|
"postcss": "^8.5.26",
|
|
1920
1920
|
"tailwindcss": "^4.3.3",
|
|
1921
1921
|
"tw-animate-css": "^1.4.0",
|
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
# Example: with-openui
|
|
2
|
+
|
|
3
|
+
## app/api/chat/route.ts
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { openai } from "@ai-sdk/openai";
|
|
7
|
+
import { frontendTools } from "@assistant-ui/ai-sdk";
|
|
8
|
+
import {
|
|
9
|
+
type JSONSchema7,
|
|
10
|
+
streamText,
|
|
11
|
+
convertToModelMessages,
|
|
12
|
+
type UIMessage,
|
|
13
|
+
createUIMessageStreamResponse,
|
|
14
|
+
toUIMessageStream,
|
|
15
|
+
} from "ai";
|
|
16
|
+
|
|
17
|
+
// Allow streaming responses up to 30 seconds
|
|
18
|
+
export const maxDuration = 30;
|
|
19
|
+
|
|
20
|
+
export async function POST(req: Request) {
|
|
21
|
+
const {
|
|
22
|
+
messages,
|
|
23
|
+
system,
|
|
24
|
+
tools,
|
|
25
|
+
}: {
|
|
26
|
+
messages: UIMessage[];
|
|
27
|
+
system?: string;
|
|
28
|
+
tools?: Record<string, { description?: string; parameters: JSONSchema7 }>;
|
|
29
|
+
} = await req.json();
|
|
30
|
+
|
|
31
|
+
const result = streamText({
|
|
32
|
+
model: openai("gpt-5.6-luna"),
|
|
33
|
+
messages: await convertToModelMessages(messages),
|
|
34
|
+
...(system ? { system } : {}),
|
|
35
|
+
tools: frontendTools(tools ?? {}),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return createUIMessageStreamResponse({
|
|
39
|
+
stream: toUIMessageStream({ stream: result.stream }),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## app/globals.css
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
@import "tailwindcss";
|
|
49
|
+
@import "tw-animate-css";
|
|
50
|
+
@import "@openuidev/react-ui/layered/styles/index.css";
|
|
51
|
+
|
|
52
|
+
@source "../../../packages/ui/src";
|
|
53
|
+
|
|
54
|
+
@custom-variant dark (&:is(.dark *));
|
|
55
|
+
|
|
56
|
+
@theme inline {
|
|
57
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
58
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
59
|
+
--radius-lg: var(--radius);
|
|
60
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
61
|
+
--color-background: var(--background);
|
|
62
|
+
--color-foreground: var(--foreground);
|
|
63
|
+
--color-card: var(--card);
|
|
64
|
+
--color-card-foreground: var(--card-foreground);
|
|
65
|
+
--color-popover: var(--popover);
|
|
66
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
67
|
+
--color-primary: var(--primary);
|
|
68
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
69
|
+
--color-secondary: var(--secondary);
|
|
70
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
71
|
+
--color-muted: var(--muted);
|
|
72
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
73
|
+
--color-accent: var(--accent);
|
|
74
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
75
|
+
--color-destructive: var(--destructive);
|
|
76
|
+
--color-border: var(--border);
|
|
77
|
+
--color-input: var(--input);
|
|
78
|
+
--color-ring: var(--ring);
|
|
79
|
+
--color-chart-1: var(--chart-1);
|
|
80
|
+
--color-chart-2: var(--chart-2);
|
|
81
|
+
--color-chart-3: var(--chart-3);
|
|
82
|
+
--color-chart-4: var(--chart-4);
|
|
83
|
+
--color-chart-5: var(--chart-5);
|
|
84
|
+
--color-sidebar: var(--sidebar);
|
|
85
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
86
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
87
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
88
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
89
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
90
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
91
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:root {
|
|
95
|
+
--radius: 0.625rem;
|
|
96
|
+
--background: oklch(1 0 0);
|
|
97
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
98
|
+
--card: oklch(1 0 0);
|
|
99
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
100
|
+
--popover: oklch(1 0 0);
|
|
101
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
102
|
+
--primary: oklch(0.21 0.006 285.885);
|
|
103
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
104
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
105
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
106
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
107
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
108
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
109
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
110
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
111
|
+
--border: oklch(0.92 0.004 286.32);
|
|
112
|
+
--input: oklch(0.92 0.004 286.32);
|
|
113
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
114
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
115
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
116
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
117
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
118
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
119
|
+
--sidebar: oklch(0.985 0 0);
|
|
120
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
121
|
+
--sidebar-primary: oklch(0.21 0.006 285.885);
|
|
122
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
123
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
124
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
125
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
126
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dark {
|
|
130
|
+
--background: oklch(0.141 0.005 285.823);
|
|
131
|
+
--foreground: oklch(0.985 0 0);
|
|
132
|
+
--card: oklch(0.21 0.006 285.885);
|
|
133
|
+
--card-foreground: oklch(0.985 0 0);
|
|
134
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
135
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
136
|
+
--primary: oklch(0.92 0.004 286.32);
|
|
137
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
138
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
139
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
140
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
141
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
142
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
143
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
144
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
145
|
+
--border: oklch(1 0 0 / 10%);
|
|
146
|
+
--input: oklch(1 0 0 / 15%);
|
|
147
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
148
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
149
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
150
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
151
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
152
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
153
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
154
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
155
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
156
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
157
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
158
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
159
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
160
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@layer base {
|
|
164
|
+
* {
|
|
165
|
+
@apply border-border outline-ring/50;
|
|
166
|
+
}
|
|
167
|
+
body {
|
|
168
|
+
@apply bg-background text-foreground;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## app/layout.tsx
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import type { Metadata } from "next";
|
|
178
|
+
import "./globals.css";
|
|
179
|
+
|
|
180
|
+
export const metadata: Metadata = {
|
|
181
|
+
title: "OpenUI Example",
|
|
182
|
+
description:
|
|
183
|
+
"Example using @assistant-ui/react with the OpenUI renderer via @openuidev/assistant-ui",
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export default function RootLayout({
|
|
187
|
+
children,
|
|
188
|
+
}: Readonly<{
|
|
189
|
+
children: React.ReactNode;
|
|
190
|
+
}>) {
|
|
191
|
+
return (
|
|
192
|
+
<html lang="en">
|
|
193
|
+
<body className="h-dvh">{children}</body>
|
|
194
|
+
</html>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## app/page.tsx
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
"use client";
|
|
204
|
+
|
|
205
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
206
|
+
import {
|
|
207
|
+
AssistantRuntimeProvider,
|
|
208
|
+
AuiConfig,
|
|
209
|
+
Suggestions,
|
|
210
|
+
Tools,
|
|
211
|
+
} from "@assistant-ui/react";
|
|
212
|
+
import { useChatRuntime } from "@assistant-ui/ai-sdk";
|
|
213
|
+
import { OpenUIInstructions, openuiIntegration } from "@openuidev/assistant-ui";
|
|
214
|
+
import { shouldContinueAfterOpenUIPrompt } from "@openuidev/assistant-ui/ai-sdk";
|
|
215
|
+
|
|
216
|
+
export default function Home() {
|
|
217
|
+
const runtime = useChatRuntime({
|
|
218
|
+
sendAutomaticallyWhen: shouldContinueAfterOpenUIPrompt,
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const config = AuiConfig({
|
|
222
|
+
tools: Tools({ toolkit: openuiIntegration.toolkit }),
|
|
223
|
+
suggestions: Suggestions([
|
|
224
|
+
{
|
|
225
|
+
title: "Trip summary",
|
|
226
|
+
label: "as a display-only card",
|
|
227
|
+
prompt:
|
|
228
|
+
"Show a trip summary for my Tokyo trip: flying March 14 to 21, staying at Park Hyatt Tokyo at $310 a night, total budget $4,200, with three confirmed activities: teamLab Planets, a Tsukiji food tour, and a Hakone day trip.",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
title: "Pick a slot",
|
|
232
|
+
label: "with an interactive choice",
|
|
233
|
+
prompt:
|
|
234
|
+
"Ask me to pick a meeting slot from Tuesday 10:00, Wednesday 14:30, or Friday 09:15.",
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
title: "Registration form",
|
|
238
|
+
label: "collect structured input",
|
|
239
|
+
prompt:
|
|
240
|
+
"Collect my conference registration with a form: full name, email, company, and a t-shirt size choice of S, M, L, or XL.",
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
title: "Sprint metrics",
|
|
244
|
+
label: "summarized visually",
|
|
245
|
+
prompt:
|
|
246
|
+
"Summarize our sprint: 34 of 41 planned issues closed, velocity 62 points versus 55 last sprint, 3 escaped bugs, and a median cycle time of 2.4 days.",
|
|
247
|
+
},
|
|
248
|
+
]),
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<AssistantRuntimeProvider config={config} runtime={runtime}>
|
|
253
|
+
<OpenUIInstructions />
|
|
254
|
+
<div className="h-full">
|
|
255
|
+
<Thread />
|
|
256
|
+
</div>
|
|
257
|
+
</AssistantRuntimeProvider>
|
|
258
|
+
);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## components.json
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
268
|
+
"style": "new-york",
|
|
269
|
+
"rsc": true,
|
|
270
|
+
"tsx": true,
|
|
271
|
+
"tailwind": {
|
|
272
|
+
"config": "",
|
|
273
|
+
"css": "app/globals.css",
|
|
274
|
+
"baseColor": "zinc",
|
|
275
|
+
"cssVariables": true,
|
|
276
|
+
"prefix": ""
|
|
277
|
+
},
|
|
278
|
+
"aliases": {
|
|
279
|
+
"components": "@/components",
|
|
280
|
+
"utils": "@/lib/utils",
|
|
281
|
+
"ui": "@/components/ui",
|
|
282
|
+
"lib": "@/lib",
|
|
283
|
+
"hooks": "@/hooks"
|
|
284
|
+
},
|
|
285
|
+
"iconLibrary": "lucide",
|
|
286
|
+
"registries": {
|
|
287
|
+
"@assistant-ui": "https://r.assistant-ui.com/{name}.json"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## next.config.js
|
|
294
|
+
|
|
295
|
+
```javascript
|
|
296
|
+
/** @type {import('next').NextConfig} */
|
|
297
|
+
const nextConfig = {
|
|
298
|
+
transpilePackages: ["@assistant-ui/react", "@assistant-ui/ai-sdk"],
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export default nextConfig;
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## package.json
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
{
|
|
309
|
+
"name": "with-openui",
|
|
310
|
+
"version": "0.0.0",
|
|
311
|
+
"private": true,
|
|
312
|
+
"type": "module",
|
|
313
|
+
"scripts": {
|
|
314
|
+
"dev": "next dev",
|
|
315
|
+
"build": "next build",
|
|
316
|
+
"start": "next start"
|
|
317
|
+
},
|
|
318
|
+
"dependencies": {
|
|
319
|
+
"@ai-sdk/openai": "^4.0.46",
|
|
320
|
+
"@assistant-ui/ai-sdk": "workspace:*",
|
|
321
|
+
"@assistant-ui/react": "workspace:*",
|
|
322
|
+
"@assistant-ui/react-markdown": "workspace:*",
|
|
323
|
+
"@assistant-ui/ui": "workspace:*",
|
|
324
|
+
"@openuidev/assistant-ui": "^0.0.3",
|
|
325
|
+
"@openuidev/react-headless": "^0.9.11",
|
|
326
|
+
"@openuidev/react-lang": "^0.2.14",
|
|
327
|
+
"@openuidev/react-ui": "^0.13.8",
|
|
328
|
+
"ai": "^7.0.77",
|
|
329
|
+
"class-variance-authority": "^0.7.1",
|
|
330
|
+
"clsx": "^2.1.1",
|
|
331
|
+
"lucide-react": "^1.33.0",
|
|
332
|
+
"next": "^16.3.2",
|
|
333
|
+
"react": "^19.2.8",
|
|
334
|
+
"react-dom": "^19.2.8",
|
|
335
|
+
"tailwind-merge": "^3.6.0",
|
|
336
|
+
"zod": "^4.4.3",
|
|
337
|
+
"zustand": "^5.0.15"
|
|
338
|
+
},
|
|
339
|
+
"devDependencies": {
|
|
340
|
+
"@assistant-ui/x-buildutils": "workspace:*",
|
|
341
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
342
|
+
"@types/node": "^26.2.0",
|
|
343
|
+
"@types/react": "^19.2.18",
|
|
344
|
+
"@types/react-dom": "^19.2.5",
|
|
345
|
+
"postcss": "^8.5.26",
|
|
346
|
+
"tailwindcss": "^4.3.3",
|
|
347
|
+
"tw-animate-css": "^1.4.0",
|
|
348
|
+
"typescript": "^7.0.2"
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## README.md
|
|
355
|
+
|
|
356
|
+
```markdown
|
|
357
|
+
# OpenUI Example
|
|
358
|
+
|
|
359
|
+
This example renders streaming [OpenUI Lang](https://www.openui.com) interfaces inside an assistant-ui conversation using [`@openuidev/assistant-ui`](https://www.npmjs.com/package/@openuidev/assistant-ui), the integration package published and maintained by OpenUI.
|
|
360
|
+
|
|
361
|
+
assistant-ui owns the chat shell, runtime, messages, streaming, and tool lifecycle. OpenUI renders the `ui` argument of two tool calls: `present_openui` for display-only interfaces and `prompt_openui` for forms and choices that wait for the user to submit.
|
|
362
|
+
|
|
363
|
+
## Quick Start
|
|
364
|
+
|
|
365
|
+
### Using CLI (Recommended)
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
npx assistant-ui@latest create my-app --example with-openui
|
|
369
|
+
cd my-app
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
### Environment Variables
|
|
373
|
+
|
|
374
|
+
Create `.env.local`:
|
|
375
|
+
|
|
376
|
+
```sh
|
|
377
|
+
OPENAI_API_KEY=your-api-key-here
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Run
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
pnpm install
|
|
384
|
+
pnpm dev
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Open [http://localhost:3000](http://localhost:3000) to see the result.
|
|
388
|
+
|
|
389
|
+
### Run inside the monorepo
|
|
390
|
+
|
|
391
|
+
To develop against the workspace packages directly, clone the repository and build the packages the example imports before starting the dev server. Create `examples/with-openui/.env.local` with your `OPENAI_API_KEY` first.
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
git clone https://github.com/assistant-ui/assistant-ui.git
|
|
395
|
+
cd assistant-ui
|
|
396
|
+
pnpm install
|
|
397
|
+
pnpm exec turbo build --filter='with-openui^...'
|
|
398
|
+
pnpm -C examples/with-openui dev
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## Key Features
|
|
402
|
+
|
|
403
|
+
- Registers `openuiIntegration.toolkit` so the model can call `present_openui` and `prompt_openui`
|
|
404
|
+
- Mounts `OpenUIInstructions` so the model learns the OpenUI component vocabulary through assistant instructions
|
|
405
|
+
- Uses `sendAutomaticallyWhen: shouldContinueAfterOpenUIPrompt` so a display-only call ends the turn while an interactive submission continues the conversation
|
|
406
|
+
- Forwards the instructions and both frontend tools to the backend through `AssistantChatTransport`, so the API route stays generic
|
|
407
|
+
- Loads the OpenUI layered stylesheet once in `app/globals.css`
|
|
408
|
+
|
|
409
|
+
## How it works
|
|
410
|
+
|
|
411
|
+
- `app/page.tsx` wires the runtime, toolkit, instructions, and suggestions
|
|
412
|
+
- `app/api/chat/route.ts` streams with the AI SDK and exposes the forwarded frontend tools with `frontendTools`
|
|
413
|
+
- Submitted form state is returned through `addResult` and hydrates again on replay
|
|
414
|
+
|
|
415
|
+
## Related Documentation
|
|
416
|
+
|
|
417
|
+
- [assistant-ui OpenUI guide](https://www.assistant-ui.com/docs/tools/openui)
|
|
418
|
+
- [OpenUI assistant-ui integration reference](https://www.openui.com/docs/api-reference/assistant-ui)
|
|
419
|
+
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## tsconfig.json
|
|
423
|
+
|
|
424
|
+
```json
|
|
425
|
+
{
|
|
426
|
+
"extends": "@assistant-ui/x-buildutils/ts/next",
|
|
427
|
+
"compilerOptions": {
|
|
428
|
+
"paths": {
|
|
429
|
+
"@/*": ["./*"],
|
|
430
|
+
"@/components/assistant-ui/*": [
|
|
431
|
+
"../../packages/ui/src/components/assistant-ui/*"
|
|
432
|
+
],
|
|
433
|
+
"@/hooks/*": ["../../packages/ui/src/hooks/*"],
|
|
434
|
+
"@/components/ui/*": [
|
|
435
|
+
"../../packages/ui/src/components/ui/base/*",
|
|
436
|
+
"../../packages/ui/src/components/ui/radix/*"
|
|
437
|
+
],
|
|
438
|
+
"@/components/ui/radix/*": [
|
|
439
|
+
"../../packages/ui/src/components/ui/radix/*"
|
|
440
|
+
],
|
|
441
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
442
|
+
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
446
|
+
"exclude": ["node_modules"]
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
|
|
@@ -1961,11 +1961,11 @@ export default withAui(nextConfig);
|
|
|
1961
1961
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
1962
1962
|
"@assistant-ui/react-pi": "workspace:*",
|
|
1963
1963
|
"@assistant-ui/ui": "workspace:*",
|
|
1964
|
-
"@earendil-works/pi-coding-agent": "^0.84.
|
|
1964
|
+
"@earendil-works/pi-coding-agent": "^0.84.2",
|
|
1965
1965
|
"class-variance-authority": "^0.7.1",
|
|
1966
1966
|
"clsx": "^2.1.1",
|
|
1967
|
-
"lucide-react": "^1.
|
|
1968
|
-
"next": "^16.3.
|
|
1967
|
+
"lucide-react": "^1.33.0",
|
|
1968
|
+
"next": "^16.3.2",
|
|
1969
1969
|
"radix-ui": "^1.6.7",
|
|
1970
1970
|
"react": "^19.2.8",
|
|
1971
1971
|
"react-dom": "^19.2.8",
|
|
@@ -1975,9 +1975,9 @@ export default withAui(nextConfig);
|
|
|
1975
1975
|
"@assistant-ui/next": "workspace:*",
|
|
1976
1976
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
1977
1977
|
"@tailwindcss/postcss": "^4.3.3",
|
|
1978
|
-
"@types/node": "^26.
|
|
1978
|
+
"@types/node": "^26.2.0",
|
|
1979
1979
|
"@types/react": "^19.2.18",
|
|
1980
|
-
"@types/react-dom": "^19.2.
|
|
1980
|
+
"@types/react-dom": "^19.2.5",
|
|
1981
1981
|
"postcss": "^8.5.26",
|
|
1982
1982
|
"tailwindcss": "^4.3.3",
|
|
1983
1983
|
"tw-animate-css": "^1.4.0",
|
|
@@ -2064,6 +2064,7 @@ Point it at a scratch directory.
|
|
|
2064
2064
|
"@/components/assistant-ui/*": [
|
|
2065
2065
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
2066
2066
|
],
|
|
2067
|
+
"@/hooks/*": ["../../packages/ui/src/hooks/*"],
|
|
2067
2068
|
"@/components/ui/*": [
|
|
2068
2069
|
"../../packages/ui/src/components/ui/base/*",
|
|
2069
2070
|
"../../packages/ui/src/components/ui/radix/*"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
```typescript
|
|
6
6
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
7
|
-
import { frontendTools } from "@assistant-ui/
|
|
7
|
+
import { frontendTools } from "@assistant-ui/ai-sdk";
|
|
8
8
|
import { convertToModelMessages, streamText } from "ai";
|
|
9
9
|
|
|
10
10
|
export const maxDuration = 30;
|
|
@@ -18,7 +18,7 @@ export async function POST(req: Request) {
|
|
|
18
18
|
const { messages, system, tools } = await req.json();
|
|
19
19
|
|
|
20
20
|
const result = streamText({
|
|
21
|
-
model: openai("gpt-5.
|
|
21
|
+
model: openai("gpt-5.6-luna"),
|
|
22
22
|
messages: await convertToModelMessages(messages),
|
|
23
23
|
system,
|
|
24
24
|
tools: {
|
|
@@ -212,7 +212,7 @@ export default function RootLayout({
|
|
|
212
212
|
"use client";
|
|
213
213
|
|
|
214
214
|
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
215
|
-
import { useChatRuntime } from "@assistant-ui/
|
|
215
|
+
import { useChatRuntime } from "@assistant-ui/ai-sdk";
|
|
216
216
|
|
|
217
217
|
export function MyRuntimeProvider({
|
|
218
218
|
children,
|
|
@@ -617,29 +617,31 @@ export default withAui(nextConfig);
|
|
|
617
617
|
"start": "next start"
|
|
618
618
|
},
|
|
619
619
|
"dependencies": {
|
|
620
|
-
"@ai-sdk/openai": "^4.0.
|
|
620
|
+
"@ai-sdk/openai": "^4.0.46",
|
|
621
|
+
"@assistant-ui/ai-sdk": "workspace:*",
|
|
621
622
|
"@assistant-ui/react": "workspace:*",
|
|
622
|
-
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
623
623
|
"@assistant-ui/react-hook-form": "workspace:*",
|
|
624
624
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
625
625
|
"@assistant-ui/ui": "workspace:*",
|
|
626
|
-
"
|
|
626
|
+
"@hookform/resolvers": "^5.9.1",
|
|
627
|
+
"ai": "^7.0.77",
|
|
627
628
|
"class-variance-authority": "^0.7.1",
|
|
628
629
|
"clsx": "^2.1.1",
|
|
629
|
-
"lucide-react": "^1.
|
|
630
|
-
"next": "^16.3.
|
|
630
|
+
"lucide-react": "^1.33.0",
|
|
631
|
+
"next": "^16.3.2",
|
|
631
632
|
"react": "^19.2.8",
|
|
632
633
|
"react-dom": "^19.2.8",
|
|
633
|
-
"react-hook-form": "^7.
|
|
634
|
-
"tailwind-merge": "^3.6.0"
|
|
634
|
+
"react-hook-form": "^7.86.0",
|
|
635
|
+
"tailwind-merge": "^3.6.0",
|
|
636
|
+
"zod": "^4.4.3"
|
|
635
637
|
},
|
|
636
638
|
"devDependencies": {
|
|
637
639
|
"@assistant-ui/next": "workspace:*",
|
|
638
640
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
639
641
|
"@tailwindcss/postcss": "^4.3.3",
|
|
640
|
-
"@types/node": "^26.
|
|
642
|
+
"@types/node": "^26.2.0",
|
|
641
643
|
"@types/react": "^19.2.18",
|
|
642
|
-
"@types/react-dom": "^19.2.
|
|
644
|
+
"@types/react-dom": "^19.2.5",
|
|
643
645
|
"postcss": "^8.5.26",
|
|
644
646
|
"tailwindcss": "^4.3.3",
|
|
645
647
|
"tw-animate-css": "^1.4.0",
|
|
@@ -690,7 +692,7 @@ npm run dev
|
|
|
690
692
|
## Related Documentation
|
|
691
693
|
|
|
692
694
|
- [assistant-ui Documentation](https://www.assistant-ui.com/docs)
|
|
693
|
-
- [
|
|
695
|
+
- [Form-Filling AI Copilot Example](https://www.assistant-ui.com/examples/form-demo)
|
|
694
696
|
|
|
695
697
|
```
|
|
696
698
|
|
|
@@ -705,6 +707,7 @@ npm run dev
|
|
|
705
707
|
"@/components/assistant-ui/*": [
|
|
706
708
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
707
709
|
],
|
|
710
|
+
"@/hooks/*": ["../../packages/ui/src/hooks/*"],
|
|
708
711
|
"@/components/ui/*": [
|
|
709
712
|
"../../packages/ui/src/components/ui/base/*",
|
|
710
713
|
"../../packages/ui/src/components/ui/radix/*"
|