@assistant-ui/mcp-docs-server 0.2.0 → 0.2.1
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 +14 -12
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +13 -12
- package/.docs/organized/code-examples/with-artifacts.md +13 -12
- package/.docs/organized/code-examples/with-assistant-transport.md +19 -27
- package/.docs/organized/code-examples/with-browser-extension.md +17 -10
- package/.docs/organized/code-examples/with-chain-of-thought.md +16 -14
- package/.docs/organized/code-examples/with-cloud-standalone.md +9 -10
- package/.docs/organized/code-examples/with-cloud.md +18 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +13 -12
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +13 -13
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +17 -15
- package/.docs/organized/code-examples/with-eve.md +65 -11
- package/.docs/organized/code-examples/with-expo.md +20 -19
- package/.docs/organized/code-examples/with-external-store.md +16 -11
- package/.docs/organized/code-examples/with-ffmpeg.md +20 -14
- package/.docs/organized/code-examples/with-generative-ui.md +16 -17
- 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 +13 -12
- package/.docs/organized/code-examples/with-langchain.md +7 -8
- package/.docs/organized/code-examples/with-langgraph.md +17 -11
- package/.docs/organized/code-examples/with-livekit.md +12 -12
- package/.docs/organized/code-examples/with-mcp.md +13 -14
- package/.docs/organized/code-examples/with-nuxt.md +2492 -0
- package/.docs/organized/code-examples/with-opencode.md +23 -14
- package/.docs/organized/code-examples/with-pi.md +59 -57
- package/.docs/organized/code-examples/with-react-hook-form.md +14 -13
- package/.docs/organized/code-examples/with-react-ink-web.md +7 -8
- package/.docs/organized/code-examples/with-react-ink.md +5 -5
- package/.docs/organized/code-examples/with-react-router.md +15 -9
- package/.docs/organized/code-examples/with-resumable-stream.md +11 -12
- package/.docs/organized/code-examples/with-store.md +27 -16
- package/.docs/organized/code-examples/with-tanstack.md +18 -12
- 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 +1 -1
- package/.docs/raw/docs/(docs)/index.mdx +9 -76
- package/.docs/raw/docs/(docs)/installation.mdx +4 -18
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +8 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +24 -1
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +1 -1
- package/.docs/raw/docs/cloud/ai-sdk.mdx +2 -2
- package/.docs/raw/docs/copilots/model-context.mdx +4 -3
- package/.docs/raw/docs/copilots/motivation.mdx +4 -4
- package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
- package/.docs/raw/docs/guides/electron.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-streams.mdx +74 -3
- package/.docs/raw/docs/guides/suggestions.mdx +9 -9
- package/.docs/raw/docs/ink/hooks.mdx +9 -4
- package/.docs/raw/docs/ink/primitives.mdx +4 -3
- 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/migrations/toolkit-tools.mdx +15 -13
- package/.docs/raw/docs/migrations/v0-15.mdx +84 -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 +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/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/concepts/threads.mdx +40 -1
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +18 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +30 -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/langgraph/streaming.mdx +1 -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/tools/backend.mdx +2 -2
- package/.docs/raw/docs/tools/defining-tools.mdx +9 -7
- package/.docs/raw/docs/tools/dynamic-tools.mdx +6 -4
- package/.docs/raw/docs/tools/interactables-legacy.mdx +24 -11
- package/.docs/raw/docs/tools/interactables.mdx +24 -13
- package/.docs/raw/docs/tools/mcp-apps.mdx +35 -6
- package/.docs/raw/docs/tools/mcp.mdx +9 -7
- package/.docs/raw/docs/tools/tool-ui.mdx +26 -22
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +12 -7
- package/.docs/raw/docs/ui/file.mdx +6 -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
|
@@ -41,7 +41,7 @@ Interactables allow both agents and users to read and edit tool UIs and componen
|
|
|
41
41
|
|
|
42
42
|
```tsx
|
|
43
43
|
import {
|
|
44
|
-
|
|
44
|
+
AuiConfig,
|
|
45
45
|
unstable_Interactables,
|
|
46
46
|
AssistantRuntimeProvider,
|
|
47
47
|
Tools,
|
|
@@ -50,13 +50,15 @@ import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
|
50
50
|
|
|
51
51
|
function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
52
52
|
const runtime = useChatRuntime();
|
|
53
|
-
|
|
54
|
-
const aui = useAui({
|
|
53
|
+
const config = AuiConfig({
|
|
55
54
|
unstable_interactables: unstable_Interactables(), // [!code ++]
|
|
56
55
|
});
|
|
57
56
|
|
|
58
57
|
return (
|
|
59
|
-
<AssistantRuntimeProvider
|
|
58
|
+
<AssistantRuntimeProvider
|
|
59
|
+
runtime={runtime}
|
|
60
|
+
config={config}
|
|
61
|
+
>
|
|
60
62
|
{children}
|
|
61
63
|
</AssistantRuntimeProvider>
|
|
62
64
|
);
|
|
@@ -66,7 +68,7 @@ function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
|
66
68
|
<Callout type="idea">
|
|
67
69
|
The legacy `interactables: Interactables()` scope and the new
|
|
68
70
|
`unstable_interactables: unstable_Interactables()` scope are mutually
|
|
69
|
-
exclusive. Mount only one interactables API in a single
|
|
71
|
+
exclusive. Mount only one interactables API in a single provider config.
|
|
70
72
|
</Callout>
|
|
71
73
|
|
|
72
74
|
This scope is needed for both kinds of interactable. Thread-scoped interactables also live in a toolkit, which you register with `Tools` (shown below).
|
|
@@ -166,7 +168,7 @@ const toolkit = defineToolkit({
|
|
|
166
168
|
Register the toolkit alongside the `unstable_Interactables` scope:
|
|
167
169
|
|
|
168
170
|
```tsx
|
|
169
|
-
|
|
171
|
+
AuiConfig({
|
|
170
172
|
unstable_interactables: unstable_Interactables(),
|
|
171
173
|
tools: Tools({ toolkit }), // [!code ++]
|
|
172
174
|
});
|
|
@@ -199,7 +201,7 @@ export async function POST(req: Request) {
|
|
|
199
201
|
const { messages } = await req.json();
|
|
200
202
|
|
|
201
203
|
const result = streamText({
|
|
202
|
-
model: openai("gpt-5.
|
|
204
|
+
model: openai("gpt-5.6-luna"),
|
|
203
205
|
messages: await convertToModelMessages(injectInteractableContext(messages)), // [!code ++]
|
|
204
206
|
});
|
|
205
207
|
|
|
@@ -592,7 +594,12 @@ An app-scoped item's history covers the current conversation, not its full cross
|
|
|
592
594
|
By default, app-scoped interactable state is in-memory and lost on page refresh. You can add persistence by passing an adapter to `unstable_Interactables`:
|
|
593
595
|
|
|
594
596
|
```tsx
|
|
595
|
-
import {
|
|
597
|
+
import {
|
|
598
|
+
AuiConfig,
|
|
599
|
+
AuiProvider,
|
|
600
|
+
useAui,
|
|
601
|
+
unstable_Interactables,
|
|
602
|
+
} from "@assistant-ui/react";
|
|
596
603
|
|
|
597
604
|
// Module-level (or memoized) so the adapter identity is stable across renders.
|
|
598
605
|
const persistenceAdapter = {
|
|
@@ -606,13 +613,17 @@ const persistenceAdapter = {
|
|
|
606
613
|
};
|
|
607
614
|
|
|
608
615
|
function MyRuntimeProvider({ children }) {
|
|
609
|
-
const aui = useAui(
|
|
616
|
+
const aui = useAui();
|
|
617
|
+
const config = AuiConfig({
|
|
610
618
|
unstable_interactables: unstable_Interactables({
|
|
611
619
|
persistence: persistenceAdapter,
|
|
612
620
|
}),
|
|
613
621
|
});
|
|
614
|
-
|
|
615
|
-
|
|
622
|
+
return (
|
|
623
|
+
<AuiProvider extends={aui} config={config}>
|
|
624
|
+
{children}
|
|
625
|
+
</AuiProvider>
|
|
626
|
+
);
|
|
616
627
|
}
|
|
617
628
|
```
|
|
618
629
|
|
|
@@ -1040,10 +1051,10 @@ Every version of an interactable recorded in the current thread, oldest first. E
|
|
|
1040
1051
|
|
|
1041
1052
|
### `unstable_Interactables`
|
|
1042
1053
|
|
|
1043
|
-
The scope resource that manages all interactables. Register it via `
|
|
1054
|
+
The scope resource that manages all interactables. Register it via your provider's `config`, optionally with a [persistence adapter](#persistence):
|
|
1044
1055
|
|
|
1045
1056
|
```tsx
|
|
1046
|
-
|
|
1057
|
+
AuiConfig({
|
|
1047
1058
|
unstable_interactables: unstable_Interactables({ persistence: myAdapter }),
|
|
1048
1059
|
});
|
|
1049
1060
|
```
|
|
@@ -36,14 +36,17 @@ Compose `McpAppRenderer({...})` into your `Tools` resource. Provide `host.url` p
|
|
|
36
36
|
|
|
37
37
|
```tsx
|
|
38
38
|
import {
|
|
39
|
-
|
|
39
|
+
AuiConfig,
|
|
40
|
+
AuiProvider,
|
|
40
41
|
Tools,
|
|
41
42
|
McpAppRenderer,
|
|
42
43
|
McpAppsRemoteHost,
|
|
44
|
+
useAui,
|
|
43
45
|
} from "@assistant-ui/react";
|
|
44
46
|
|
|
45
|
-
function MyAssistant() {
|
|
46
|
-
useAui(
|
|
47
|
+
function MyAssistant({ children }) {
|
|
48
|
+
const aui = useAui();
|
|
49
|
+
const config = AuiConfig({
|
|
47
50
|
tools: Tools({
|
|
48
51
|
toolkit: myToolkit,
|
|
49
52
|
mcpApp: McpAppRenderer({
|
|
@@ -53,12 +56,38 @@ function MyAssistant() {
|
|
|
53
56
|
}),
|
|
54
57
|
}),
|
|
55
58
|
});
|
|
56
|
-
|
|
59
|
+
return (
|
|
60
|
+
<AuiProvider extends={aui} config={config}>
|
|
61
|
+
{children}
|
|
62
|
+
</AuiProvider>
|
|
63
|
+
);
|
|
57
64
|
}
|
|
58
65
|
```
|
|
59
66
|
|
|
60
67
|
`McpAppsRemoteHost` is the default host strategy — it POSTs `{ method, params }` to your route. A different strategy (e.g. a client-side MCP client) can be plugged in by writing a custom resource that returns the same `McpAppsHost` shape (`{ loadResource, callTool, readResource, listResources }`).
|
|
61
68
|
|
|
69
|
+
Changes to `headers` or a custom `fetch` function apply to subsequent host requests without reloading the widget. When the account or workspace identity changes, key the host resource explicitly so its UI resource reloads.
|
|
70
|
+
|
|
71
|
+
Install the resource helper:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pnpm add @assistant-ui/tap
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { withKey } from "@assistant-ui/tap";
|
|
79
|
+
|
|
80
|
+
const mcpApp = McpAppRenderer({
|
|
81
|
+
host: withKey(
|
|
82
|
+
workspaceId,
|
|
83
|
+
McpAppsRemoteHost({
|
|
84
|
+
url: "/api/mcp-apps",
|
|
85
|
+
headers: () => getWorkspaceHeaders(workspaceId),
|
|
86
|
+
}),
|
|
87
|
+
),
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
62
91
|
`openLink` is auto-wired to `window.open(url, "_blank", "noopener,noreferrer")`. `sendMessage` is auto-wired to append a user message to the current thread (accepts `string`, `{ prompt }`, `{ text }`, or `{ message }`).
|
|
63
92
|
|
|
64
93
|
### Route handler
|
|
@@ -154,7 +183,7 @@ const tools = await client.listTools();
|
|
|
154
183
|
const { modelVisible } = splitMcpAppTools(tools);
|
|
155
184
|
|
|
156
185
|
const result = streamText({
|
|
157
|
-
model: openai("gpt-5.
|
|
186
|
+
model: openai("gpt-5.6-luna"),
|
|
158
187
|
tools: modelVisible.tools,
|
|
159
188
|
// ...
|
|
160
189
|
});
|
|
@@ -314,4 +343,4 @@ McpAppRenderer({
|
|
|
314
343
|
- Widgets run cross-origin in a sandboxed iframe. The bridge filters incoming messages by both source window and origin.
|
|
315
344
|
- The host route is your auth boundary — apply session checks, rate limiting, and per-tool allowlists there. The renderer trusts whatever the route returns.
|
|
316
345
|
- `openLink` rejects non-`http(s)` URLs at the bridge layer, but your `openLink` handler should still treat the URL as untrusted (e.g. always use `noopener,noreferrer`).
|
|
317
|
-
- Keep `host` and `handlers` references stable across renders (e.g. module-scope constants or `useMemo`); an unstable identity
|
|
346
|
+
- Keep custom `host` and `handlers` references stable across renders (e.g. module-scope constants or `useMemo`); an unstable custom-host identity keeps the widget in `loadingFallback` while refetching on every parent re-render.
|
|
@@ -177,7 +177,7 @@ export async function POST(req: Request) {
|
|
|
177
177
|
const aiToolkit = new AISDKToolkit({ toolkit });
|
|
178
178
|
|
|
179
179
|
const result = streamText({
|
|
180
|
-
model: openai("gpt-5.
|
|
180
|
+
model: openai("gpt-5.6-luna"),
|
|
181
181
|
messages: await convertToModelMessages(messages),
|
|
182
182
|
tools: await aiToolkit.tools({ frontend: tools }),
|
|
183
183
|
onFinish: async () => {
|
|
@@ -220,7 +220,7 @@ export async function POST(req: Request) {
|
|
|
220
220
|
const tools = await mcpClient.tools();
|
|
221
221
|
|
|
222
222
|
const result = streamText({
|
|
223
|
-
model: openai("gpt-5.
|
|
223
|
+
model: openai("gpt-5.6-luna"),
|
|
224
224
|
messages: await convertToModelMessages(messages),
|
|
225
225
|
tools,
|
|
226
226
|
onFinish: async () => {
|
|
@@ -369,7 +369,7 @@ Register the toolkit once with `Tools({ toolkit })`. Renderer keys such as
|
|
|
369
369
|
```tsx title="app/components/RuntimeProvider.tsx"
|
|
370
370
|
"use client";
|
|
371
371
|
|
|
372
|
-
import { AssistantRuntimeProvider,
|
|
372
|
+
import { AssistantRuntimeProvider, AuiConfig, Tools } from "@assistant-ui/react";
|
|
373
373
|
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
374
374
|
import type { ReactNode } from "react";
|
|
375
375
|
|
|
@@ -377,10 +377,12 @@ import { toolkit } from "./GitHubIssueToolUI";
|
|
|
377
377
|
|
|
378
378
|
export function MyRuntimeProvider({ children }: { children: ReactNode }) {
|
|
379
379
|
const runtime = useChatRuntime();
|
|
380
|
-
const
|
|
381
|
-
|
|
380
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
382
381
|
return (
|
|
383
|
-
<AssistantRuntimeProvider
|
|
382
|
+
<AssistantRuntimeProvider
|
|
383
|
+
runtime={runtime}
|
|
384
|
+
config={config}
|
|
385
|
+
>
|
|
384
386
|
{children}
|
|
385
387
|
</AssistantRuntimeProvider>
|
|
386
388
|
);
|
|
@@ -400,7 +402,7 @@ MCP tools execute on the server, so approval is a server-side tool gate, not a `
|
|
|
400
402
|
const tools = await mcpClient.tools();
|
|
401
403
|
|
|
402
404
|
const result = streamText({
|
|
403
|
-
model: openai("gpt-5.
|
|
405
|
+
model: openai("gpt-5.6-luna"),
|
|
404
406
|
messages: await convertToModelMessages(messages),
|
|
405
407
|
tools,
|
|
406
408
|
toolApproval: {
|
|
@@ -69,15 +69,15 @@ export default defineToolkit({
|
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
```tsx title="app/MyRuntimeProvider.tsx"
|
|
72
|
-
import { AssistantRuntimeProvider,
|
|
72
|
+
import { AssistantRuntimeProvider, AuiConfig, Tools } from "@assistant-ui/react";
|
|
73
73
|
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
74
74
|
import toolkit from "./toolkit";
|
|
75
75
|
|
|
76
76
|
function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
77
77
|
const runtime = useChatRuntime();
|
|
78
|
-
const
|
|
78
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
79
79
|
return (
|
|
80
|
-
<AssistantRuntimeProvider
|
|
80
|
+
<AssistantRuntimeProvider runtime={runtime} config={config}>
|
|
81
81
|
{children}
|
|
82
82
|
</AssistantRuntimeProvider>
|
|
83
83
|
);
|
|
@@ -190,10 +190,9 @@ const toolkit = defineToolkit({
|
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
function App({ runtime }: { runtime: AssistantRuntime }) {
|
|
193
|
-
const
|
|
194
|
-
|
|
193
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
195
194
|
return (
|
|
196
|
-
<AssistantRuntimeProvider
|
|
195
|
+
<AssistantRuntimeProvider runtime={runtime} config={config}>
|
|
197
196
|
<Thread />
|
|
198
197
|
</AssistantRuntimeProvider>
|
|
199
198
|
);
|
|
@@ -215,7 +214,7 @@ export async function POST(req: Request) {
|
|
|
215
214
|
const { messages } = await req.json();
|
|
216
215
|
|
|
217
216
|
const result = streamText({
|
|
218
|
-
model: openai("gpt-5.
|
|
217
|
+
model: openai("gpt-5.6-luna"),
|
|
219
218
|
messages: await convertToModelMessages(messages),
|
|
220
219
|
tools: {
|
|
221
220
|
getWeather: tool({
|
|
@@ -331,19 +330,21 @@ export function useAnalyzeDataToolkit(theme: "light" | "dark") {
|
|
|
331
330
|
```
|
|
332
331
|
|
|
333
332
|
```tsx title="DynamicToolUI.tsx"
|
|
334
|
-
import { AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
333
|
+
import { AuiConfig, AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
335
334
|
import { useState } from "react";
|
|
336
335
|
import { useAnalyzeDataToolkit } from "./analyze-data-toolkit";
|
|
337
336
|
|
|
338
337
|
function DynamicToolUI({ children }: { children: React.ReactNode }) {
|
|
339
338
|
const [theme] = useState<"light" | "dark">("light");
|
|
340
339
|
const toolkit = useAnalyzeDataToolkit(theme);
|
|
340
|
+
const aui = useAui();
|
|
341
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
341
342
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
343
|
+
return (
|
|
344
|
+
<AuiProvider extends={aui} config={config}>
|
|
345
|
+
{children}
|
|
346
|
+
</AuiProvider>
|
|
347
|
+
);
|
|
347
348
|
}
|
|
348
349
|
```
|
|
349
350
|
|
|
@@ -390,18 +391,16 @@ export function useInventoryToolkit(productId: string, productName: string) {
|
|
|
390
391
|
```
|
|
391
392
|
|
|
392
393
|
```tsx title="ProductPage.tsx"
|
|
393
|
-
import { AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
394
|
+
import { AuiConfig, AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
394
395
|
import { useInventoryToolkit } from "./inventory-toolkit";
|
|
395
396
|
|
|
396
397
|
function ProductPage({ productId, productName }) {
|
|
397
398
|
const toolkit = useInventoryToolkit(productId, productName);
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
tools: Tools({ toolkit }),
|
|
401
|
-
});
|
|
399
|
+
const aui = useAui();
|
|
400
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
402
401
|
|
|
403
402
|
return (
|
|
404
|
-
<AuiProvider
|
|
403
|
+
<AuiProvider extends={aui} config={config}>
|
|
405
404
|
<div>Product details...</div>
|
|
406
405
|
</AuiProvider>
|
|
407
406
|
);
|
|
@@ -942,15 +941,20 @@ export function useHeavyComputationToolkit() {
|
|
|
942
941
|
```
|
|
943
942
|
|
|
944
943
|
```tsx title="HeavyComputationToolProvider.tsx"
|
|
945
|
-
import { AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
944
|
+
import { AuiConfig, AuiProvider, Tools, useAui } from "@assistant-ui/react";
|
|
946
945
|
import type { ReactNode } from "react";
|
|
947
946
|
import { useHeavyComputationToolkit } from "./heavy-computation-toolkit";
|
|
948
947
|
|
|
949
948
|
function HeavyComputationToolProvider({ children }: { children: ReactNode }) {
|
|
950
949
|
const toolkit = useHeavyComputationToolkit();
|
|
951
|
-
const aui = useAui(
|
|
950
|
+
const aui = useAui();
|
|
951
|
+
const config = AuiConfig({ tools: Tools({ toolkit }) });
|
|
952
952
|
|
|
953
|
-
return
|
|
953
|
+
return (
|
|
954
|
+
<AuiProvider extends={aui} config={config}>
|
|
955
|
+
{children}
|
|
956
|
+
</AuiProvider>
|
|
957
|
+
);
|
|
954
958
|
}
|
|
955
959
|
```
|
|
956
960
|
|
|
@@ -15,14 +15,14 @@ Both flow through one connection lifecycle, one persisted state surface, and one
|
|
|
15
15
|
## How it works
|
|
16
16
|
|
|
17
17
|
```
|
|
18
|
-
|
|
18
|
+
AuiConfig({ mcp: McpManagerResource({ connectors }) })
|
|
19
19
|
│
|
|
20
20
|
├─ Resource — connection lifecycle, server lookup, OAuth/bearer auth
|
|
21
21
|
├─ Auto-mounts the modelContext scope when no chat runtime provides one
|
|
22
22
|
└─ Registers connected tools as frontend tools — your chat sees them automatically
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
The manager is a single resource. Mount it with `
|
|
25
|
+
The manager is a single resource. Mount it with `AuiProvider` like any other scope. OAuth (PKCE + RFC 7591 dynamic client registration), bearer, and "no auth" are first-class. Token refresh runs inside the MCP SDK on 401; this package mediates persistence and the redirect step.
|
|
26
26
|
|
|
27
27
|
## Setup
|
|
28
28
|
|
|
@@ -38,12 +38,12 @@ The manager is a single resource. Mount it with `useAui` like any other scope. O
|
|
|
38
38
|
|
|
39
39
|
### Mount the manager
|
|
40
40
|
|
|
41
|
-
Declare your connectors and provide the `mcp` scope
|
|
41
|
+
Declare your connectors and provide the `mcp` scope via `AuiProvider`. No imperative hooks:
|
|
42
42
|
|
|
43
43
|
```tsx title="app/providers.tsx"
|
|
44
44
|
"use client";
|
|
45
45
|
|
|
46
|
-
import { AuiProvider, useAui } from "@assistant-ui/react";
|
|
46
|
+
import { AuiConfig, AuiProvider, useAui } from "@assistant-ui/react";
|
|
47
47
|
import { McpManagerResource, defineConnector } from "@assistant-ui/react-mcp";
|
|
48
48
|
|
|
49
49
|
const connectors = [
|
|
@@ -64,13 +64,18 @@ const connectors = [
|
|
|
64
64
|
];
|
|
65
65
|
|
|
66
66
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
67
|
-
const aui = useAui(
|
|
67
|
+
const aui = useAui();
|
|
68
|
+
const config = AuiConfig({
|
|
68
69
|
mcp: McpManagerResource({
|
|
69
70
|
connectors,
|
|
70
71
|
connectionTimeout: 15_000,
|
|
71
72
|
}),
|
|
72
73
|
});
|
|
73
|
-
return
|
|
74
|
+
return (
|
|
75
|
+
<AuiProvider extends={aui} config={config}>
|
|
76
|
+
{children}
|
|
77
|
+
</AuiProvider>
|
|
78
|
+
);
|
|
74
79
|
}
|
|
75
80
|
```
|
|
76
81
|
|
|
@@ -297,7 +302,7 @@ All persisted state — custom server records, OAuth tokens, PKCE verifiers, DCR
|
|
|
297
302
|
```tsx
|
|
298
303
|
import { McpManagerResource, McpCustomStorage } from "@assistant-ui/react-mcp";
|
|
299
304
|
|
|
300
|
-
|
|
305
|
+
AuiConfig({
|
|
301
306
|
mcp: McpManagerResource({
|
|
302
307
|
connectors,
|
|
303
308
|
storage: McpCustomStorage({
|
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
| `File.Icon` | MIME type-aware icon, or pass custom `children` |
|
|
116
116
|
| `File.Name` | Truncated filename |
|
|
117
117
|
| `File.Size` | Human-readable file size |
|
|
118
|
-
| `File.Download` | Download link button |
|
|
118
|
+
| `File.Download` | Download link button; renders nothing without a browser-resolvable target (`sourceType: "id"`, urls that are not http(s)/blob/data) |
|
|
119
119
|
|
|
120
120
|
### Custom Icon
|
|
121
121
|
|
|
@@ -134,6 +134,7 @@ The component also exports utility functions:
|
|
|
134
134
|
```tsx
|
|
135
135
|
import {
|
|
136
136
|
getMimeTypeIcon,
|
|
137
|
+
getFileDataKind,
|
|
137
138
|
getBase64Size,
|
|
138
139
|
formatFileSize,
|
|
139
140
|
} from "@/components/assistant-ui/file";
|
|
@@ -141,6 +142,10 @@ import {
|
|
|
141
142
|
// Get icon component for a MIME type
|
|
142
143
|
const Icon = getMimeTypeIcon("application/pdf"); // FileTextIcon
|
|
143
144
|
|
|
145
|
+
// Classify the data field of a file part; a declared sourceType wins over sniffing, except a data: payload declared as "url"
|
|
146
|
+
const kind = getFileDataKind("https://example.com/report.pdf"); // "url"
|
|
147
|
+
const ref = getFileDataKind("file-abc123", "id"); // "id"
|
|
148
|
+
|
|
144
149
|
// Calculate size from base64 string
|
|
145
150
|
const bytes = getBase64Size("SGVsbG8gV29ybGQh"); // 12
|
|
146
151
|
|
|
@@ -25,7 +25,7 @@ platforms: ["react"]
|
|
|
25
25
|
```tsx title="app/providers.tsx"
|
|
26
26
|
"use client";
|
|
27
27
|
|
|
28
|
-
import { AuiProvider, useAui } from "@assistant-ui/react";
|
|
28
|
+
import { AuiConfig, AuiProvider, useAui } from "@assistant-ui/react";
|
|
29
29
|
import { McpManagerResource, defineConnector } from "@assistant-ui/react-mcp";
|
|
30
30
|
|
|
31
31
|
const connectors = [
|
|
@@ -38,8 +38,13 @@ const connectors = [
|
|
|
38
38
|
];
|
|
39
39
|
|
|
40
40
|
export function Providers({ children }: { children: React.ReactNode }) {
|
|
41
|
-
const aui = useAui(
|
|
42
|
-
|
|
41
|
+
const aui = useAui();
|
|
42
|
+
const config = AuiConfig({ mcp: McpManagerResource({ connectors }) });
|
|
43
|
+
return (
|
|
44
|
+
<AuiProvider extends={aui} config={config}>
|
|
45
|
+
{children}
|
|
46
|
+
</AuiProvider>
|
|
47
|
+
);
|
|
43
48
|
}
|
|
44
49
|
```
|
|
45
50
|
|
|
@@ -38,11 +38,11 @@ const ComposerAction: FC = () => {
|
|
|
38
38
|
<div className="flex items-center gap-1">
|
|
39
39
|
<ModelSelector
|
|
40
40
|
models={[
|
|
41
|
-
{ id: "gpt-5.
|
|
42
|
-
{ id: "gpt-5.
|
|
43
|
-
{ id: "gpt-5.
|
|
41
|
+
{ id: "gpt-5.6-luna", name: "GPT-5.6 Luna", description: "Fast and efficient" },
|
|
42
|
+
{ id: "gpt-5.6-terra", name: "GPT-5.6 Terra", description: "Balanced performance" },
|
|
43
|
+
{ id: "gpt-5.6-sol", name: "GPT-5.6 Sol", description: "Most capable", efforts: true },
|
|
44
44
|
]}
|
|
45
|
-
defaultValue="gpt-5.
|
|
45
|
+
defaultValue="gpt-5.6-luna"
|
|
46
46
|
defaultEffort="medium"
|
|
47
47
|
size="sm"
|
|
48
48
|
/>
|
|
@@ -63,7 +63,7 @@ export async function POST(req: Request) {
|
|
|
63
63
|
const { messages, config } = await req.json();
|
|
64
64
|
|
|
65
65
|
const result = streamText({
|
|
66
|
-
model: openai(config?.modelName ?? "gpt-5.
|
|
66
|
+
model: openai(config?.modelName ?? "gpt-5.6-luna"),
|
|
67
67
|
providerOptions: {
|
|
68
68
|
openai:
|
|
69
69
|
config?.reasoningEffort !== undefined
|
|
@@ -88,8 +88,8 @@ A model that declares `efforts` shows a "Thinking" row at the bottom of the popo
|
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
90
|
{
|
|
91
|
-
id: "gpt-5.
|
|
92
|
-
name: "GPT-5.
|
|
91
|
+
id: "gpt-5.6-sol",
|
|
92
|
+
name: "GPT-5.6 Sol",
|
|
93
93
|
efforts: [
|
|
94
94
|
{ id: "minimal", name: "Minimal" },
|
|
95
95
|
{ id: "high", name: "High" },
|
|
@@ -156,7 +156,7 @@ import { ClaudeLogo, GeminiLogo, OpenAILogo } from "@/components/assistant-ui/lo
|
|
|
156
156
|
|
|
157
157
|
<ModelSelector
|
|
158
158
|
models={[
|
|
159
|
-
{ id: "gpt-5.
|
|
159
|
+
{ id: "gpt-5.6-sol", name: "GPT-5.6 Sol", icon: <OpenAILogo /> },
|
|
160
160
|
{ id: "claude-opus-4.5", name: "Claude Opus 4.5", icon: <ClaudeLogo /> },
|
|
161
161
|
{ id: "gemini-3-pro", name: "Gemini 3 Pro", icon: <GeminiLogo /> },
|
|
162
162
|
]}
|
|
@@ -575,7 +575,7 @@ Use `MessagePrimitive.Unstable_PartsGrouped` only when you need to collect non-a
|
|
|
575
575
|
name: "Unstable_Audio",
|
|
576
576
|
type: "Unstable_AudioMessagePartComponent",
|
|
577
577
|
description:
|
|
578
|
-
"Component for rendering audio content (
|
|
578
|
+
"Component for rendering audio content (deprecated, render audio/* from File)",
|
|
579
579
|
},
|
|
580
580
|
{
|
|
581
581
|
name: "tools",
|
|
@@ -111,17 +111,36 @@ export default function Chat() {
|
|
|
111
111
|
Display suggested prompts using the Suggestions API. See the [Suggestions guide](/docs/guides/suggestions) for detailed configuration.
|
|
112
112
|
|
|
113
113
|
```tsx
|
|
114
|
-
import {
|
|
114
|
+
import type { ReactNode } from "react";
|
|
115
|
+
import {
|
|
116
|
+
AssistantRuntimeProvider,
|
|
117
|
+
AuiConfig,
|
|
118
|
+
SuggestionPrimitive,
|
|
119
|
+
Suggestions,
|
|
120
|
+
ThreadPrimitive,
|
|
121
|
+
} from "@assistant-ui/react";
|
|
122
|
+
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
|
|
115
123
|
|
|
116
124
|
// Configure suggestions in your runtime provider
|
|
117
|
-
const
|
|
125
|
+
const config = AuiConfig({
|
|
118
126
|
suggestions: Suggestions(["What's the weather?", "Tell me a joke"]),
|
|
119
127
|
});
|
|
120
128
|
|
|
129
|
+
const App = ({ children }: { children: ReactNode }) => {
|
|
130
|
+
const runtime = useChatRuntime();
|
|
131
|
+
return (
|
|
132
|
+
<AssistantRuntimeProvider runtime={runtime} config={config}>
|
|
133
|
+
{children}
|
|
134
|
+
</AssistantRuntimeProvider>
|
|
135
|
+
);
|
|
136
|
+
};
|
|
137
|
+
|
|
121
138
|
// Display suggestions in your thread component
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
139
|
+
const ThreadSuggestions = () => (
|
|
140
|
+
<ThreadPrimitive.Suggestions>
|
|
141
|
+
{() => <SuggestionItem />}
|
|
142
|
+
</ThreadPrimitive.Suggestions>
|
|
143
|
+
);
|
|
125
144
|
|
|
126
145
|
// Custom suggestion item
|
|
127
146
|
const SuggestionItem = () => (
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
SpanResource,
|
|
43
43
|
type SpanData,
|
|
44
44
|
} from "@assistant-ui/react-o11y";
|
|
45
|
-
import {
|
|
45
|
+
import { AuiConfig, AuiProvider } from "@assistant-ui/store";
|
|
46
46
|
|
|
47
47
|
function SpanRow() {
|
|
48
48
|
return (
|
|
@@ -59,10 +59,9 @@ function SpanRow() {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export function TraceView({ spans }: { spans: SpanData[] }) {
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const config = AuiConfig({ span: SpanResource({ spans }) });
|
|
64
63
|
return (
|
|
65
|
-
<AuiProvider
|
|
64
|
+
<AuiProvider extends={null} config={config}>
|
|
66
65
|
<SpanPrimitive.Children components={{ Span: SpanRow }} />
|
|
67
66
|
</AuiProvider>
|
|
68
67
|
);
|
|
@@ -106,10 +105,9 @@ import {
|
|
|
106
105
|
SpanByIndexProvider,
|
|
107
106
|
} from "@assistant-ui/react-o11y";
|
|
108
107
|
|
|
109
|
-
// Top-level: mount SpanResource via
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
<AuiProvider value={aui}>
|
|
108
|
+
// Top-level: mount SpanResource via AuiProvider
|
|
109
|
+
const config = AuiConfig({ span: SpanResource({ spans }) });
|
|
110
|
+
<AuiProvider extends={null} config={config}>
|
|
113
111
|
{/* Render visible spans (flat-list output respecting collapsed state) */}
|
|
114
112
|
<SpanPrimitive.Children components={{ Span: SpanRow }} />
|
|
115
113
|
</AuiProvider>;
|
|
@@ -140,7 +138,7 @@ Resource that ingests raw span data and exposes a tree-aware reactive state to p
|
|
|
140
138
|
SpanResource({ spans }: { spans: SpanData[] }): ClientOutput<"span">;
|
|
141
139
|
```
|
|
142
140
|
|
|
143
|
-
Mount through `
|
|
141
|
+
Mount through `config={config}`, where `const config = AuiConfig({ span: SpanResource({ spans }) })`.
|
|
144
142
|
|
|
145
143
|
The resource computes:
|
|
146
144
|
|
package/dist/constants.js
CHANGED
|
@@ -10,8 +10,8 @@ const DOCS_PATH = join(DOCS_BASE, "raw/docs");
|
|
|
10
10
|
const CODE_EXAMPLES_PATH = join(DOCS_BASE, "organized/code-examples");
|
|
11
11
|
const MDX_EXTENSION = ".mdx";
|
|
12
12
|
const MD_EXTENSION = ".md";
|
|
13
|
-
const MAX_FILE_SIZE =
|
|
14
|
-
const MAX_DIRECTORY_CONTENT_SIZE =
|
|
13
|
+
const MAX_FILE_SIZE = 10485760;
|
|
14
|
+
const MAX_DIRECTORY_CONTENT_SIZE = 1048576;
|
|
15
15
|
const IS_PREPARE_MODE = process.argv[1]?.includes("prepare-docs/prepare");
|
|
16
16
|
//#endregion
|
|
17
17
|
export { CODE_EXAMPLES_PATH, DOCS_PATH, EXAMPLES_PATH, IS_PREPARE_MODE, MAX_DIRECTORY_CONTENT_SIZE, MAX_FILE_SIZE, MDX_EXTENSION, MD_EXTENSION, PACKAGE_DIR, ROOT_DIR };
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { dirname, join } from \"node:path\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport const ROOT_DIR = join(__dirname, \"../../../\");\nexport const PACKAGE_DIR = join(__dirname, \"../\");\n\nexport const EXAMPLES_PATH = join(ROOT_DIR, \"examples\");\n\nconst DOCS_BASE = join(PACKAGE_DIR, \".docs\");\nexport const DOCS_PATH = join(DOCS_BASE, \"raw/docs\");\nexport const CODE_EXAMPLES_PATH = join(DOCS_BASE, \"organized/code-examples\");\n\nexport const MDX_EXTENSION = \".mdx\";\nexport const MD_EXTENSION = \".md\";\n\nexport const MAX_FILE_SIZE = 10 * 1024 * 1024;\n\nexport const MAX_DIRECTORY_CONTENT_SIZE = 1024 * 1024;\n\nexport const IS_PREPARE_MODE = process.argv[1]?.includes(\n \"prepare-docs/prepare\",\n);\n"],"mappings":";;;AAGA,MAAM,YAAY,QAAQ,cAAc,
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import { fileURLToPath } from \"node:url\";\nimport { dirname, join } from \"node:path\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport const ROOT_DIR = join(__dirname, \"../../../\");\nexport const PACKAGE_DIR = join(__dirname, \"../\");\n\nexport const EXAMPLES_PATH = join(ROOT_DIR, \"examples\");\n\nconst DOCS_BASE = join(PACKAGE_DIR, \".docs\");\nexport const DOCS_PATH = join(DOCS_BASE, \"raw/docs\");\nexport const CODE_EXAMPLES_PATH = join(DOCS_BASE, \"organized/code-examples\");\n\nexport const MDX_EXTENSION = \".mdx\";\nexport const MD_EXTENSION = \".md\";\n\nexport const MAX_FILE_SIZE = 10 * 1024 * 1024;\n\nexport const MAX_DIRECTORY_CONTENT_SIZE = 1024 * 1024;\n\nexport const IS_PREPARE_MODE = process.argv[1]?.includes(\n \"prepare-docs/prepare\",\n);\n"],"mappings":";;;AAGA,MAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAExD,MAAa,WAAW,KAAK,WAAW,WAAW;AACnD,MAAa,cAAc,KAAK,WAAW,KAAK;AAEhD,MAAa,gBAAgB,KAAK,UAAU,UAAU;AAEtD,MAAM,YAAY,KAAK,aAAa,OAAO;AAC3C,MAAa,YAAY,KAAK,WAAW,UAAU;AACnD,MAAa,qBAAqB,KAAK,WAAW,yBAAyB;AAE3E,MAAa,gBAAgB;AAC7B,MAAa,eAAe;AAE5B,MAAa,gBAAgB;AAE7B,MAAa,6BAA6B;AAE1C,MAAa,kBAAkB,QAAQ,KAAK,EAAE,EAAE,SAC9C,sBACF"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/server\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/server/stdio\";\nimport { docsTools } from \"./tools/docs.js\";\nimport { examplesTools } from \"./tools/examples.js\";\nimport { searchTools } from \"./tools/search.js\";\nimport {\n xuluxTemplatesListTool,\n xuluxTemplateDetailsTool,\n xuluxTemplatePreviewTool,\n} from \"./tools/xulux-templates.js\";\nimport { xuluxPlaygroundPrompt } from \"./prompts/xulux-playground.js\";\nimport { registerResources } from \"./tools/resources.js\";\nimport { logger } from \"./utils/logger.js\";\nimport { PACKAGE_DIR } from \"./constants.js\";\n\nimport { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst packageJson = JSON.parse(\n readFileSync(join(PACKAGE_DIR, \"package.json\"), \"utf-8\"),\n);\n\nexport const server = new McpServer({\n name: \"assistant-ui-docs\",\n version: packageJson.version,\n});\n\nserver.registerTool(\n docsTools.name,\n {\n title: \"assistant-ui Documentation\",\n description: docsTools.description,\n inputSchema: docsTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n docsTools.execute,\n);\nserver.registerTool(\n examplesTools.name,\n {\n title: \"assistant-ui Examples\",\n description: examplesTools.description,\n inputSchema: examplesTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n examplesTools.execute,\n);\nserver.registerTool(\n searchTools.name,\n {\n title: \"Search assistant-ui Documentation\",\n description: searchTools.description,\n inputSchema: searchTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n searchTools.execute,\n);\n\nserver.registerTool(\n xuluxTemplatesListTool.name,\n {\n title: \"assistant-ui Templates\",\n description: xuluxTemplatesListTool.description,\n inputSchema: xuluxTemplatesListTool.parameters,\n annotations: { readOnlyHint: true, openWorldHint: true },\n },\n xuluxTemplatesListTool.execute,\n);\nserver.registerTool(\n xuluxTemplateDetailsTool.name,\n {\n title: \"assistant-ui Template Details\",\n description: xuluxTemplateDetailsTool.description,\n inputSchema: xuluxTemplateDetailsTool.parameters,\n annotations: { readOnlyHint: true, openWorldHint: true },\n },\n xuluxTemplateDetailsTool.execute,\n);\nserver.registerTool(\n xuluxTemplatePreviewTool.name,\n {\n title: \"assistant-ui Template Preview URLs\",\n description: xuluxTemplatePreviewTool.description,\n inputSchema: xuluxTemplatePreviewTool.parameters,\n annotations: { readOnlyHint: false, openWorldHint: true },\n },\n xuluxTemplatePreviewTool.execute,\n);\n\nserver.registerPrompt(\n xuluxPlaygroundPrompt.name,\n {\n title: \"assistant-ui Template Workflow\",\n description: xuluxPlaygroundPrompt.description,\n },\n () => ({\n messages: [\n {\n role: \"user\" as const,\n content: { type: \"text\" as const, text: xuluxPlaygroundPrompt.text },\n },\n ],\n }),\n);\n\nregisterResources(server);\n\nexport async function runServer() {\n try {\n logger.info(\n `Starting assistant-ui MCP docs server v${packageJson.version}`,\n );\n const transport = new StdioServerTransport();\n await server.connect(transport);\n } catch (error) {\n logger.error(\"Failed to start MCP server\", error);\n process.exit(1);\n }\n}\n\nif (import.meta.url === `file://${process.argv[1]}`) {\n void runServer().catch((error) => {\n console.error(\"Failed to start server:\", error);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,cAAc,KAAK,MACvB,aAAa,KAAK,aAAa,cAAc,GAAG,OAAO,CACzD;AAEA,MAAa,SAAS,IAAI,UAAU;CAClC,MAAM;CACN,SAAS,YAAY;AACvB,CAAC;AAED,OAAO,aACL,UAAU,MACV;CACE,OAAO;CACP,aAAa,UAAU;CACvB,aAAa,UAAU;CACvB,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,UAAU,OACZ;AACA,OAAO,aACL,cAAc,MACd;CACE,OAAO;CACP,aAAa,cAAc;CAC3B,aAAa,cAAc;CAC3B,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,cAAc,OAChB;AACA,OAAO,aACL,YAAY,MACZ;CACE,OAAO;CACP,aAAa,YAAY;CACzB,aAAa,YAAY;CACzB,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,YAAY,OACd;AAEA,OAAO,aACL,uBAAuB,MACvB;CACE,OAAO;CACP,aAAa,uBAAuB;CACpC,aAAa,uBAAuB;CACpC,aAAa;EAAE,cAAc;EAAM,eAAe;CAAK;AACzD,GACA,uBAAuB,OACzB;AACA,OAAO,aACL,yBAAyB,MACzB;CACE,OAAO;CACP,aAAa,yBAAyB;CACtC,aAAa,yBAAyB;CACtC,aAAa;EAAE,cAAc;EAAM,eAAe;CAAK;AACzD,GACA,yBAAyB,OAC3B;AACA,OAAO,aACL,yBAAyB,MACzB;CACE,OAAO;CACP,aAAa,yBAAyB;CACtC,aAAa,yBAAyB;CACtC,aAAa;EAAE,cAAc;EAAO,eAAe;CAAK;AAC1D,GACA,yBAAyB,OAC3B;AAEA,OAAO,eACL,sBAAsB,MACtB;CACE,OAAO;CACP,aAAa,sBAAsB;AACrC,UACO,EACL,UAAU,CACR;CACE,MAAM;CACN,SAAS;EAAE,MAAM;EAAiB,MAAM,sBAAsB;CAAK;AACrE,CACF,EACF,EACF;AAEA,kBAAkB,MAAM;AAExB,eAAsB,YAAY;CAChC,IAAI;EACF,OAAO,KACL,0CAA0C,YAAY,SACxD;EACA,MAAM,YAAY,IAAI,qBAAqB;EAC3C,MAAM,OAAO,QAAQ,SAAS;CAChC,SAAS,OAAO;EACd,OAAO,MAAM,8BAA8B,KAAK;EAChD,QAAQ,KAAK,CAAC;CAChB;AACF;AAEA,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/server\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/server/stdio\";\nimport { docsTools } from \"./tools/docs.js\";\nimport { examplesTools } from \"./tools/examples.js\";\nimport { searchTools } from \"./tools/search.js\";\nimport {\n xuluxTemplatesListTool,\n xuluxTemplateDetailsTool,\n xuluxTemplatePreviewTool,\n} from \"./tools/xulux-templates.js\";\nimport { xuluxPlaygroundPrompt } from \"./prompts/xulux-playground.js\";\nimport { registerResources } from \"./tools/resources.js\";\nimport { logger } from \"./utils/logger.js\";\nimport { PACKAGE_DIR } from \"./constants.js\";\n\nimport { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nconst packageJson = JSON.parse(\n readFileSync(join(PACKAGE_DIR, \"package.json\"), \"utf-8\"),\n);\n\nexport const server = new McpServer({\n name: \"assistant-ui-docs\",\n version: packageJson.version,\n});\n\nserver.registerTool(\n docsTools.name,\n {\n title: \"assistant-ui Documentation\",\n description: docsTools.description,\n inputSchema: docsTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n docsTools.execute,\n);\nserver.registerTool(\n examplesTools.name,\n {\n title: \"assistant-ui Examples\",\n description: examplesTools.description,\n inputSchema: examplesTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n examplesTools.execute,\n);\nserver.registerTool(\n searchTools.name,\n {\n title: \"Search assistant-ui Documentation\",\n description: searchTools.description,\n inputSchema: searchTools.parameters,\n annotations: { readOnlyHint: true, openWorldHint: false },\n },\n searchTools.execute,\n);\n\nserver.registerTool(\n xuluxTemplatesListTool.name,\n {\n title: \"assistant-ui Templates\",\n description: xuluxTemplatesListTool.description,\n inputSchema: xuluxTemplatesListTool.parameters,\n annotations: { readOnlyHint: true, openWorldHint: true },\n },\n xuluxTemplatesListTool.execute,\n);\nserver.registerTool(\n xuluxTemplateDetailsTool.name,\n {\n title: \"assistant-ui Template Details\",\n description: xuluxTemplateDetailsTool.description,\n inputSchema: xuluxTemplateDetailsTool.parameters,\n annotations: { readOnlyHint: true, openWorldHint: true },\n },\n xuluxTemplateDetailsTool.execute,\n);\nserver.registerTool(\n xuluxTemplatePreviewTool.name,\n {\n title: \"assistant-ui Template Preview URLs\",\n description: xuluxTemplatePreviewTool.description,\n inputSchema: xuluxTemplatePreviewTool.parameters,\n annotations: { readOnlyHint: false, openWorldHint: true },\n },\n xuluxTemplatePreviewTool.execute,\n);\n\nserver.registerPrompt(\n xuluxPlaygroundPrompt.name,\n {\n title: \"assistant-ui Template Workflow\",\n description: xuluxPlaygroundPrompt.description,\n },\n () => ({\n messages: [\n {\n role: \"user\" as const,\n content: { type: \"text\" as const, text: xuluxPlaygroundPrompt.text },\n },\n ],\n }),\n);\n\nregisterResources(server);\n\nexport async function runServer() {\n try {\n logger.info(\n `Starting assistant-ui MCP docs server v${packageJson.version}`,\n );\n const transport = new StdioServerTransport();\n await server.connect(transport);\n } catch (error) {\n logger.error(\"Failed to start MCP server\", error);\n process.exit(1);\n }\n}\n\nif (import.meta.url === `file://${process.argv[1]}`) {\n void runServer().catch((error) => {\n console.error(\"Failed to start server:\", error);\n process.exit(1);\n });\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,MAAM,cAAc,KAAK,MACvB,aAAa,KAAK,aAAa,cAAc,GAAG,OAAO,CACzD;AAEA,MAAa,SAAS,IAAI,UAAU;CAClC,MAAM;CACN,SAAS,YAAY;AACvB,CAAC;AAED,OAAO,aACL,UAAU,MACV;CACE,OAAO;CACP,aAAa,UAAU;CACvB,aAAa,UAAU;CACvB,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,UAAU,OACZ;AACA,OAAO,aACL,cAAc,MACd;CACE,OAAO;CACP,aAAa,cAAc;CAC3B,aAAa,cAAc;CAC3B,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,cAAc,OAChB;AACA,OAAO,aACL,YAAY,MACZ;CACE,OAAO;CACP,aAAa,YAAY;CACzB,aAAa,YAAY;CACzB,aAAa;EAAE,cAAc;EAAM,eAAe;CAAM;AAC1D,GACA,YAAY,OACd;AAEA,OAAO,aACL,uBAAuB,MACvB;CACE,OAAO;CACP,aAAa,uBAAuB;CACpC,aAAa,uBAAuB;CACpC,aAAa;EAAE,cAAc;EAAM,eAAe;CAAK;AACzD,GACA,uBAAuB,OACzB;AACA,OAAO,aACL,yBAAyB,MACzB;CACE,OAAO;CACP,aAAa,yBAAyB;CACtC,aAAa,yBAAyB;CACtC,aAAa;EAAE,cAAc;EAAM,eAAe;CAAK;AACzD,GACA,yBAAyB,OAC3B;AACA,OAAO,aACL,yBAAyB,MACzB;CACE,OAAO;CACP,aAAa,yBAAyB;CACtC,aAAa,yBAAyB;CACtC,aAAa;EAAE,cAAc;EAAO,eAAe;CAAK;AAC1D,GACA,yBAAyB,OAC3B;AAEA,OAAO,eACL,sBAAsB,MACtB;CACE,OAAO;CACP,aAAa,sBAAsB;AACrC,UACO,EACL,UAAU,CACR;CACE,MAAM;CACN,SAAS;EAAE,MAAM;EAAiB,MAAM,sBAAsB;CAAK;AACrE,CACF,EACF,EACF;AAEA,kBAAkB,MAAM;AAExB,eAAsB,YAAY;CAChC,IAAI;EACF,OAAO,KACL,0CAA0C,YAAY,SACxD;EACA,MAAM,YAAY,IAAI,qBAAqB;EAC3C,MAAM,OAAO,QAAQ,SAAS;CAChC,SAAS,OAAO;EACd,OAAO,MAAM,8BAA8B,KAAK;EAChD,QAAQ,KAAK,CAAC;CAChB;AACF;AAEA,IAAI,YAAY,QAAQ,UAAU,QAAQ,KAAK,MAC7C,UAAe,CAAC,CAAC,OAAO,UAAU;CAChC,QAAQ,MAAM,2BAA2B,KAAK;CAC9C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.js","names":[],"sources":["../../src/prepare-docs/prepare.ts"],"sourcesContent":["import { logger } from \"../utils/logger.js\";\nimport { copyRaw } from \"./copy-raw.js\";\nimport { prepareCodeExamples } from \"./code-examples.js\";\n\nasync function prepare(): Promise<void> {\n logger.info(\"Starting documentation preparation...\");\n\n try {\n await copyRaw();\n await prepareCodeExamples();\n\n logger.info(\"Documentation preparation complete\");\n } catch (error) {\n logger.error(\"Documentation preparation failed\", error);\n throw error;\n }\n}\n\nif (import.meta.url === `file://${process.argv[1]}`) {\n prepare().catch((error) => {\n logger.error(\"Preparation failed\", error);\n process.exit(1);\n });\n}\n"],"mappings":";;;;AAIA,eAAe,UAAyB;CACtC,OAAO,KAAK,uCAAuC;CAEnD,IAAI;EACF,MAAM,QAAQ;EACd,MAAM,oBAAoB;EAE1B,OAAO,KAAK,oCAAoC;CAClD,SAAS,OAAO;EACd,OAAO,MAAM,oCAAoC,KAAK;EACtD,MAAM;CACR;AACF;AAEA,IAAI,
|
|
1
|
+
{"version":3,"file":"prepare.js","names":[],"sources":["../../src/prepare-docs/prepare.ts"],"sourcesContent":["import { logger } from \"../utils/logger.js\";\nimport { copyRaw } from \"./copy-raw.js\";\nimport { prepareCodeExamples } from \"./code-examples.js\";\n\nasync function prepare(): Promise<void> {\n logger.info(\"Starting documentation preparation...\");\n\n try {\n await copyRaw();\n await prepareCodeExamples();\n\n logger.info(\"Documentation preparation complete\");\n } catch (error) {\n logger.error(\"Documentation preparation failed\", error);\n throw error;\n }\n}\n\nif (import.meta.url === `file://${process.argv[1]}`) {\n prepare().catch((error) => {\n logger.error(\"Preparation failed\", error);\n process.exit(1);\n });\n}\n"],"mappings":";;;;AAIA,eAAe,UAAyB;CACtC,OAAO,KAAK,uCAAuC;CAEnD,IAAI;EACF,MAAM,QAAQ;EACd,MAAM,oBAAoB;EAE1B,OAAO,KAAK,oCAAoC;CAClD,SAAS,OAAO;EACd,OAAO,MAAM,oCAAoC,KAAK;EACtD,MAAM;CACR;AACF;AAEA,IAAI,YAAY,QAAQ,UAAU,QAAQ,KAAK,MAC7C,QAAQ,CAAC,CAAC,OAAO,UAAU;CACzB,OAAO,MAAM,sBAAsB,KAAK;CACxC,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|