@assistant-ui/mcp-docs-server 0.1.22 → 0.1.23
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 +801 -0
- package/.docs/organized/code-examples/with-ag-ui.md +38 -26
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +38 -28
- package/.docs/organized/code-examples/with-artifacts.md +467 -0
- package/.docs/organized/code-examples/with-assistant-transport.md +31 -24
- package/.docs/organized/code-examples/with-chain-of-thought.md +41 -32
- package/.docs/organized/code-examples/with-cloud-standalone.md +675 -0
- package/.docs/organized/code-examples/with-cloud.md +34 -27
- package/.docs/organized/code-examples/with-custom-thread-list.md +34 -27
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +41 -30
- package/.docs/organized/code-examples/with-expo.md +2031 -0
- package/.docs/organized/code-examples/with-external-store.md +32 -25
- package/.docs/organized/code-examples/with-ffmpeg.md +31 -27
- package/.docs/organized/code-examples/with-langgraph.md +96 -38
- package/.docs/organized/code-examples/with-parent-id-grouping.md +32 -25
- package/.docs/organized/code-examples/with-react-hook-form.md +63 -58
- package/.docs/organized/code-examples/with-react-router.md +38 -30
- package/.docs/organized/code-examples/with-store.md +16 -24
- package/.docs/organized/code-examples/with-tanstack.md +36 -26
- package/.docs/organized/code-examples/with-tap-runtime.md +10 -24
- package/.docs/raw/docs/(docs)/cli.mdx +13 -6
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +26 -3
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +53 -52
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +0 -2
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +169 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +327 -0
- package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -1
- package/.docs/raw/docs/(docs)/index.mdx +12 -2
- package/.docs/raw/docs/(docs)/installation.mdx +8 -2
- package/.docs/raw/docs/(docs)/llm.mdx +9 -7
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +27 -27
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +60 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +78 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +32 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +61 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +1 -1
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +1 -6
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +2 -2
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +1 -6
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +1 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +17 -17
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +205 -0
- package/.docs/raw/docs/cloud/ai-sdk.mdx +292 -0
- package/.docs/raw/docs/cloud/authorization.mdx +178 -79
- package/.docs/raw/docs/cloud/{persistence/langgraph.mdx → langgraph.mdx} +2 -2
- package/.docs/raw/docs/cloud/overview.mdx +29 -39
- package/.docs/raw/docs/react-native/adapters.mdx +118 -0
- package/.docs/raw/docs/react-native/custom-backend.mdx +210 -0
- package/.docs/raw/docs/react-native/hooks.mdx +364 -0
- package/.docs/raw/docs/react-native/index.mdx +332 -0
- package/.docs/raw/docs/react-native/primitives.mdx +653 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +7 -15
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +103 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +25 -2
- package/.docs/raw/docs/runtimes/data-stream.mdx +1 -3
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +113 -9
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +1 -4
- package/.docs/raw/docs/ui/attachment.mdx +4 -2
- package/.docs/raw/docs/ui/message-timing.mdx +92 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/reasoning.mdx +4 -4
- package/.docs/raw/docs/ui/scrollbar.mdx +2 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +55 -50
- package/.docs/raw/docs/ui/thread.mdx +16 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/tools/tests/integration.test.ts +2 -2
- package/src/tools/tests/json-parsing.test.ts +1 -1
- package/src/tools/tests/mcp-protocol.test.ts +1 -3
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +0 -108
|
@@ -16,11 +16,11 @@ attachments, and conditional UI states. Fully customizable and composable.
|
|
|
16
16
|
The `Thread` component is built with the following primitives:
|
|
17
17
|
|
|
18
18
|
```tsx
|
|
19
|
-
import { ThreadPrimitive, AuiIf } from "@assistant-ui/react";
|
|
19
|
+
import { ThreadPrimitive, SelectionToolbarPrimitive, AuiIf } from "@assistant-ui/react";
|
|
20
20
|
|
|
21
21
|
<ThreadPrimitive.Root>
|
|
22
22
|
<ThreadPrimitive.Viewport>
|
|
23
|
-
<
|
|
23
|
+
<AuiIf condition={(s) => s.thread.isEmpty} />
|
|
24
24
|
<ThreadPrimitive.Messages
|
|
25
25
|
components={{
|
|
26
26
|
EditComposer,
|
|
@@ -32,6 +32,11 @@ import { ThreadPrimitive, AuiIf } from "@assistant-ui/react";
|
|
|
32
32
|
</ThreadPrimitive.Viewport>
|
|
33
33
|
<ThreadPrimitive.Suggestions />
|
|
34
34
|
<AuiIf condition={...} />
|
|
35
|
+
|
|
36
|
+
{/* Floating toolbar — appears when text is selected in a message */}
|
|
37
|
+
<SelectionToolbarPrimitive.Root>
|
|
38
|
+
<SelectionToolbarPrimitive.Quote>Quote</SelectionToolbarPrimitive.Quote>
|
|
39
|
+
</SelectionToolbarPrimitive.Root>
|
|
35
40
|
</ThreadPrimitive.Root>
|
|
36
41
|
```
|
|
37
42
|
|
|
@@ -71,7 +76,7 @@ export default function Chat() {
|
|
|
71
76
|
### Welcome Screen
|
|
72
77
|
|
|
73
78
|
```tsx
|
|
74
|
-
<AuiIf condition={(
|
|
79
|
+
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
75
80
|
<ThreadWelcome />
|
|
76
81
|
</AuiIf>
|
|
77
82
|
```
|
|
@@ -79,7 +84,7 @@ export default function Chat() {
|
|
|
79
84
|
### Viewport Spacer
|
|
80
85
|
|
|
81
86
|
```tsx
|
|
82
|
-
<AuiIf condition={(
|
|
87
|
+
<AuiIf condition={(s) => !s.thread.isEmpty}>
|
|
83
88
|
<div className="min-h-8 grow" />
|
|
84
89
|
</AuiIf>
|
|
85
90
|
```
|
|
@@ -87,13 +92,13 @@ export default function Chat() {
|
|
|
87
92
|
### Conditional Send/Cancel Button
|
|
88
93
|
|
|
89
94
|
```tsx
|
|
90
|
-
<AuiIf condition={(
|
|
95
|
+
<AuiIf condition={(s) => !s.thread.isRunning}>
|
|
91
96
|
<ComposerPrimitive.Send>
|
|
92
97
|
Send
|
|
93
98
|
</ComposerPrimitive.Send>
|
|
94
99
|
</AuiIf>
|
|
95
100
|
|
|
96
|
-
<AuiIf condition={(
|
|
101
|
+
<AuiIf condition={(s) => s.thread.isRunning}>
|
|
97
102
|
<ComposerPrimitive.Cancel>
|
|
98
103
|
Cancel
|
|
99
104
|
</ComposerPrimitive.Cancel>
|
|
@@ -349,15 +354,15 @@ Conditionally renders children based on assistant state. This is a generic compo
|
|
|
349
354
|
```tsx
|
|
350
355
|
import { AuiIf } from "@assistant-ui/react";
|
|
351
356
|
|
|
352
|
-
<AuiIf condition={(
|
|
357
|
+
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
353
358
|
<WelcomeScreen />
|
|
354
359
|
</AuiIf>
|
|
355
360
|
|
|
356
|
-
<AuiIf condition={(
|
|
361
|
+
<AuiIf condition={(s) => s.thread.isRunning}>
|
|
357
362
|
<LoadingIndicator />
|
|
358
363
|
</AuiIf>
|
|
359
364
|
|
|
360
|
-
<AuiIf condition={(
|
|
365
|
+
<AuiIf condition={(s) => s.message.role === "assistant"}>
|
|
361
366
|
<AssistantAvatar />
|
|
362
367
|
</AuiIf>
|
|
363
368
|
```
|
|
@@ -382,3 +387,5 @@ The condition function receives an `AssistantState` object with access to `threa
|
|
|
382
387
|
## Related Components
|
|
383
388
|
|
|
384
389
|
- [ThreadList](/docs/ui/thread-list) - List of threads, with or without sidebar
|
|
390
|
+
- [Quoting guide](/docs/guides/quoting) - Quote selected text from messages
|
|
391
|
+
- [SelectionToolbarPrimitive](/docs/reference/primitives/selection-toolbar) - Floating toolbar API reference
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kCAAgD;AAcpE,eAAO,MAAM,MAAM,WAGjB,CAAC;AAeH,wBAAsB,SAAS,kBAW9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/mcp-docs-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "MCP server for assistant-ui documentation and examples",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
],
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
37
37
|
"gray-matter": "^4.0.3",
|
|
38
38
|
"zod": "^4.3.6"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/node": "^25.
|
|
41
|
+
"@types/node": "^25.3.0",
|
|
42
42
|
"tsx": "^4.21.0",
|
|
43
43
|
"vitest": "^4.0.18",
|
|
44
44
|
"@assistant-ui/x-buildutils": "0.0.1"
|
|
@@ -36,11 +36,11 @@ describe("MCP Server Integration", () => {
|
|
|
36
36
|
const docsResult = await docsTools.execute({ paths: ["/"] });
|
|
37
37
|
expect(docsResult).toBeDefined();
|
|
38
38
|
expect(docsResult.content).toBeDefined();
|
|
39
|
-
expect(docsResult.content[0]
|
|
39
|
+
expect(docsResult.content[0]!.type).toBe("text");
|
|
40
40
|
|
|
41
41
|
const examplesResult = await examplesTools.execute({});
|
|
42
42
|
expect(examplesResult).toBeDefined();
|
|
43
43
|
expect(examplesResult.content).toBeDefined();
|
|
44
|
-
expect(examplesResult.content[0]
|
|
44
|
+
expect(examplesResult.content[0]!.type).toBe("text");
|
|
45
45
|
});
|
|
46
46
|
});
|
|
@@ -9,7 +9,7 @@ describe("JSON parsing error handling", () => {
|
|
|
9
9
|
|
|
10
10
|
it("should provide helpful error message for invalid JSON", async () => {
|
|
11
11
|
vi.spyOn(docsTools, "execute").mockResolvedValue({
|
|
12
|
-
content: [{ text: "invalid json {not valid}" }],
|
|
12
|
+
content: [{ type: "text" as const, text: "invalid json {not valid}" }],
|
|
13
13
|
});
|
|
14
14
|
|
|
15
15
|
await expect(
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Chat History for AI SDK
|
|
3
|
-
description: Integrate cloud persistence and thread management with Vercel AI SDK.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
assistant-cloud provides thread management and persistent chat history for applications built with the [AI SDK by Vercel](https://sdk.vercel.ai/). This guide shows you how to integrate cloud persistence into your AI SDK application.
|
|
10
|
-
|
|
11
|
-
## Prerequisites
|
|
12
|
-
|
|
13
|
-
<Callout type="info">
|
|
14
|
-
You need an assistant-cloud account to follow this guide. [Sign up here](https://cloud.assistant-ui.com/) to get started.
|
|
15
|
-
</Callout>
|
|
16
|
-
|
|
17
|
-
## Setup Guide
|
|
18
|
-
|
|
19
|
-
<Steps>
|
|
20
|
-
|
|
21
|
-
<Step>
|
|
22
|
-
|
|
23
|
-
### Create a Cloud Project
|
|
24
|
-
|
|
25
|
-
Create a new project in the [assistant-cloud dashboard](https://cloud.assistant-ui.com/) and from the settings page, copy:
|
|
26
|
-
|
|
27
|
-
- **Frontend API URL**: `https://proj-[ID].assistant-api.com`
|
|
28
|
-
- **Assistant Cloud API Key**: `sk_aui_proj_*`
|
|
29
|
-
|
|
30
|
-
</Step>
|
|
31
|
-
|
|
32
|
-
<Step>
|
|
33
|
-
|
|
34
|
-
### Configure Environment Variables
|
|
35
|
-
|
|
36
|
-
Add the following environment variables to your project:
|
|
37
|
-
|
|
38
|
-
```bash title=".env.local"
|
|
39
|
-
# Frontend API URL from your cloud project settings
|
|
40
|
-
NEXT_PUBLIC_ASSISTANT_BASE_URL=https://proj-[YOUR-ID].assistant-api.com
|
|
41
|
-
|
|
42
|
-
# API key for server-side operations
|
|
43
|
-
ASSISTANT_API_KEY=your-api-key-here
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
</Step>
|
|
47
|
-
|
|
48
|
-
<Step>
|
|
49
|
-
|
|
50
|
-
### Install Dependencies
|
|
51
|
-
|
|
52
|
-
Install the required packages:
|
|
53
|
-
|
|
54
|
-
<InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-ai-sdk"]} />
|
|
55
|
-
|
|
56
|
-
</Step>
|
|
57
|
-
|
|
58
|
-
<Step>
|
|
59
|
-
|
|
60
|
-
### Set Up the Cloud Runtime
|
|
61
|
-
|
|
62
|
-
Create a client-side AssistantCloud instance and integrate it with your AI SDK runtime:
|
|
63
|
-
|
|
64
|
-
```tsx title="app/chat/page.tsx"
|
|
65
|
-
"use client";
|
|
66
|
-
|
|
67
|
-
import { AssistantCloud, AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
68
|
-
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
69
|
-
import { ThreadList } from "@/components/assistant-ui/thread-list";
|
|
70
|
-
import { Thread } from "@/components/assistant-ui/thread";
|
|
71
|
-
|
|
72
|
-
export default function ChatPage() {
|
|
73
|
-
const cloud = new AssistantCloud({
|
|
74
|
-
baseUrl: process.env.NEXT_PUBLIC_ASSISTANT_BASE_URL!,
|
|
75
|
-
anonymous: true, // Creates browser-session based user ID
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const runtime = useChatRuntime({
|
|
79
|
-
api: "/api/chat", // Your AI SDK endpoint
|
|
80
|
-
cloud,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
85
|
-
<div className="grid h-dvh grid-cols-[200px_1fr] gap-x-2 px-4 py-4">
|
|
86
|
-
<ThreadList />
|
|
87
|
-
<Thread />
|
|
88
|
-
</div>
|
|
89
|
-
</AssistantRuntimeProvider>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
</Step>
|
|
95
|
-
|
|
96
|
-
</Steps>
|
|
97
|
-
|
|
98
|
-
## Authentication
|
|
99
|
-
|
|
100
|
-
The example above uses `anonymous: true` which creates a browser session-based user ID. This is suitable for public demos or prototypes.
|
|
101
|
-
|
|
102
|
-
For production apps with user accounts, see the [Cloud Authorization](/docs/cloud/authorization) guide to persist threads per user or workspace.
|
|
103
|
-
|
|
104
|
-
## Next Steps
|
|
105
|
-
|
|
106
|
-
- Learn about [user authentication](/docs/cloud/authorization) for multi-user applications
|
|
107
|
-
- Explore [runtime hooks](/docs/api-reference/integrations/vercel-ai-sdk) and integration options
|
|
108
|
-
- Check out the [complete example](https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-cloud) on GitHub
|