@assistant-ui/mcp-docs-server 0.1.39 → 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 +17 -18
- package/.docs/organized/code-examples/with-a2a.md +20 -15
- package/.docs/organized/code-examples/with-ag-ui.md +19 -17
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +17 -16
- package/.docs/organized/code-examples/with-artifacts.md +471 -145
- package/.docs/organized/code-examples/with-assistant-transport.md +23 -31
- package/.docs/organized/code-examples/with-browser-extension.md +21 -14
- package/.docs/organized/code-examples/with-chain-of-thought.md +22 -20
- package/.docs/organized/code-examples/with-cloud-standalone.md +13 -14
- package/.docs/organized/code-examples/with-cloud.md +22 -17
- package/.docs/organized/code-examples/with-custom-thread-list.md +17 -16
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -17
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +21 -19
- package/.docs/organized/code-examples/with-eve.md +70 -16
- package/.docs/organized/code-examples/with-expo.md +32 -51
- package/.docs/organized/code-examples/with-external-store.md +20 -15
- package/.docs/organized/code-examples/with-ffmpeg.md +24 -18
- package/.docs/organized/code-examples/with-generative-ui.md +20 -21
- package/.docs/organized/code-examples/with-google-adk.md +21 -16
- package/.docs/organized/code-examples/with-heat-graph.md +10 -11
- package/.docs/organized/code-examples/with-image-generation.md +13 -14
- package/.docs/organized/code-examples/with-interactables.md +17 -16
- package/.docs/organized/code-examples/with-langchain.md +13 -14
- package/.docs/organized/code-examples/with-langgraph.md +23 -17
- package/.docs/organized/code-examples/with-livekit.md +17 -17
- package/.docs/organized/code-examples/with-mcp.md +36 -32
- package/.docs/organized/code-examples/with-nuxt.md +2492 -0
- package/.docs/organized/code-examples/with-opencode.md +27 -21
- package/.docs/organized/code-examples/with-pi.md +69 -67
- package/.docs/organized/code-examples/with-react-hook-form.md +18 -17
- package/.docs/organized/code-examples/with-react-ink-web.md +10 -11
- package/.docs/organized/code-examples/with-react-ink.md +7 -7
- package/.docs/organized/code-examples/with-react-router.md +23 -17
- package/.docs/organized/code-examples/with-resumable-stream.md +15 -16
- package/.docs/organized/code-examples/with-store.md +31 -20
- package/.docs/organized/code-examples/with-tanstack.md +22 -16
- package/.docs/organized/code-examples/with-tap-runtime.md +19 -19
- package/.docs/organized/code-examples/with-virtualized-thread.md +12 -13
- package/.docs/organized/code-examples/with-vue.md +408 -0
- package/.docs/raw/docs/(docs)/cli.mdx +3 -1
- package/.docs/raw/docs/(docs)/devtools.mdx +7 -2
- 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/generative-ui/a2ui.mdx +40 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +3 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +19 -420
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +8 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +21 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +1 -9
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +1 -18
- 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/cloud/langgraph.mdx +1 -1
- package/.docs/raw/docs/copilots/model-context.mdx +5 -4
- package/.docs/raw/docs/copilots/motivation.mdx +5 -5
- package/.docs/raw/docs/guides/attachments.mdx +3 -3
- package/.docs/raw/docs/guides/branching.mdx +2 -2
- package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
- package/.docs/raw/docs/guides/context-api.mdx +89 -111
- package/.docs/raw/docs/guides/editing.mdx +5 -5
- package/.docs/raw/docs/guides/electron.mdx +369 -0
- package/.docs/raw/docs/guides/index.mdx +10 -0
- package/.docs/raw/docs/guides/quoting.mdx +3 -3
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +2 -2
- 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 +12 -7
- package/.docs/raw/docs/ink/primitives.mdx +18 -10
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +16 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +3 -3
- package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -3
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +4 -4
- 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 +3 -3
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +36 -9
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +15 -13
- package/.docs/raw/docs/migrations/v0-15.mdx +236 -0
- package/.docs/raw/docs/primitives/attachment.mdx +2 -2
- package/.docs/raw/docs/primitives/composer.mdx +3 -3
- package/.docs/raw/docs/primitives/message.mdx +33 -1
- package/.docs/raw/docs/primitives/suggestion.mdx +1 -1
- package/.docs/raw/docs/primitives/thread-list.mdx +2 -2
- package/.docs/raw/docs/react-native/hooks.mdx +17 -7
- package/.docs/raw/docs/react-native/index.mdx +3 -3
- package/.docs/raw/docs/react-native/primitives.mdx +41 -7
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +3 -3
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +5 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +5 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +13 -14
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +11 -12
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +50 -11
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +20 -2
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +31 -2
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +39 -12
- package/.docs/raw/docs/runtimes/eve/overview.mdx +51 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +51 -2
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +9 -12
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +1 -1
- 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 +4 -1
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +10 -0
- package/.docs/raw/docs/tools/a2ui.mdx +107 -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 +28 -15
- package/.docs/raw/docs/tools/interactables.mdx +27 -16
- package/.docs/raw/docs/tools/mcp-apps.mdx +96 -8
- 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 +64 -14
- package/.docs/raw/docs/ui/file.mdx +6 -1
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +2 -0
- package/.docs/raw/docs/ui/mcp-config.mdx +8 -3
- package/.docs/raw/docs/ui/model-selector.mdx +9 -9
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -5
- package/.docs/raw/docs/ui/reasoning.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.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +1 -1
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/stdio.d.ts +1 -1
- package/dist/tools/docs.d.ts +6 -10
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +6 -4
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +4 -8
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +4 -3
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +1 -1
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/resources.js +3 -2
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/search.d.ts +4 -10
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +2 -2
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/tests/mcp-test-client.d.ts +15 -0
- package/dist/tools/tests/mcp-test-client.d.ts.map +1 -0
- package/dist/tools/tests/mcp-test-client.js +68 -0
- package/dist/tools/tests/mcp-test-client.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts.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.d.ts +9 -23
- package/dist/tools/xulux-templates.d.ts.map +1 -1
- package/dist/tools/xulux-templates.js +8 -6
- package/dist/tools/xulux-templates.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/mdx.js +2 -1
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/security.js.map +1 -1
- package/dist/xulux/catalog-client.js +1 -1
- package/dist/xulux/catalog-client.js.map +1 -1
- package/package.json +6 -5
- package/src/index.ts +2 -2
- package/src/tools/docs.ts +2 -2
- package/src/tools/examples.ts +2 -2
- package/src/tools/resources.ts +1 -4
- package/src/tools/search.ts +2 -2
- package/src/tools/tests/completions.test.ts +40 -26
- package/src/tools/tests/docs.test.ts +2 -2
- package/src/tools/tests/integration.test.ts +3 -4
- package/src/tools/tests/mcp-protocol.test.ts +160 -175
- package/src/tools/tests/mcp-test-client.ts +111 -0
- package/src/tools/tests/resources.test.ts +97 -66
- package/src/tools/xulux-templates.ts +4 -4
|
@@ -1,102 +1,133 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
2
2
|
import { server } from "../../index.js";
|
|
3
|
+
import { createMcpTestClient, type McpTestClient } from "./mcp-test-client.js";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
type Resource = {
|
|
6
|
+
uri: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type ResourceListResult = {
|
|
10
|
+
resources: Resource[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type ResourceReadResult = {
|
|
14
|
+
contents: Array<{
|
|
15
|
+
mimeType?: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function requireResource(resources: Resource[], prefix: string): Resource {
|
|
21
|
+
const resource = resources.find((candidate) =>
|
|
22
|
+
candidate.uri.startsWith(prefix),
|
|
23
|
+
);
|
|
24
|
+
expect(resource).toBeDefined();
|
|
25
|
+
if (!resource) throw new Error(`Missing resource with URI prefix: ${prefix}`);
|
|
26
|
+
return resource;
|
|
9
27
|
}
|
|
10
28
|
|
|
11
29
|
describe("MCP resources", () => {
|
|
30
|
+
let client: McpTestClient;
|
|
31
|
+
|
|
32
|
+
beforeEach(async () => {
|
|
33
|
+
client = await createMcpTestClient(server);
|
|
34
|
+
await client.initialize();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
afterEach(async () => {
|
|
38
|
+
await client?.close();
|
|
39
|
+
});
|
|
40
|
+
|
|
12
41
|
it("lists docs and example resources", async () => {
|
|
13
|
-
const result = await
|
|
14
|
-
|
|
15
|
-
{},
|
|
16
|
-
);
|
|
42
|
+
const result = await client.request<ResourceListResult>({
|
|
43
|
+
method: "resources/list",
|
|
44
|
+
params: {},
|
|
45
|
+
});
|
|
46
|
+
|
|
17
47
|
expect(result.resources.length).toBeGreaterThan(0);
|
|
18
48
|
expect(
|
|
19
|
-
result.resources.some((
|
|
49
|
+
result.resources.some((resource) =>
|
|
50
|
+
resource.uri.startsWith("aui-docs:///"),
|
|
51
|
+
),
|
|
20
52
|
).toBe(true);
|
|
21
53
|
expect(
|
|
22
|
-
result.resources.some((
|
|
54
|
+
result.resources.some((resource) =>
|
|
55
|
+
resource.uri.startsWith("aui-example:///"),
|
|
56
|
+
),
|
|
23
57
|
).toBe(true);
|
|
24
58
|
});
|
|
25
59
|
|
|
26
60
|
it("reads a documentation resource as markdown", async () => {
|
|
27
|
-
const list = await
|
|
28
|
-
|
|
29
|
-
{},
|
|
30
|
-
);
|
|
31
|
-
const doc = list.resources
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
expect(read.contents[0]
|
|
39
|
-
expect(
|
|
40
|
-
expect(read.contents[0].text.length).toBeGreaterThan(0);
|
|
61
|
+
const list = await client.request<ResourceListResult>({
|
|
62
|
+
method: "resources/list",
|
|
63
|
+
params: {},
|
|
64
|
+
});
|
|
65
|
+
const doc = requireResource(list.resources, "aui-docs:///");
|
|
66
|
+
const read = await client.request<ResourceReadResult>({
|
|
67
|
+
method: "resources/read",
|
|
68
|
+
params: { uri: doc.uri },
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
expect(read.contents[0]?.mimeType).toBe("text/markdown");
|
|
72
|
+
expect(typeof read.contents[0]?.text).toBe("string");
|
|
73
|
+
expect(read.contents[0]?.text.length).toBeGreaterThan(0);
|
|
41
74
|
});
|
|
42
75
|
|
|
43
76
|
it("reads a slash-containing documentation resource", async () => {
|
|
44
|
-
const list = await
|
|
45
|
-
|
|
46
|
-
{},
|
|
47
|
-
);
|
|
77
|
+
const list = await client.request<ResourceListResult>({
|
|
78
|
+
method: "resources/list",
|
|
79
|
+
params: {},
|
|
80
|
+
});
|
|
48
81
|
const prefix = "aui-docs:///";
|
|
49
82
|
const nested = list.resources.find(
|
|
50
|
-
(
|
|
51
|
-
|
|
83
|
+
(resource) =>
|
|
84
|
+
resource.uri.startsWith(prefix) &&
|
|
85
|
+
resource.uri.slice(prefix.length).includes("/"),
|
|
52
86
|
);
|
|
87
|
+
|
|
53
88
|
expect(nested).toBeDefined();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
89
|
+
if (!nested) throw new Error("Missing nested documentation resource");
|
|
90
|
+
|
|
91
|
+
const read = await client.request<ResourceReadResult>({
|
|
92
|
+
method: "resources/read",
|
|
93
|
+
params: { uri: nested.uri },
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
expect(read.contents[0]?.mimeType).toBe("text/markdown");
|
|
97
|
+
expect(read.contents[0]?.text.length).toBeGreaterThan(0);
|
|
60
98
|
});
|
|
61
99
|
|
|
62
100
|
it("errors on an unknown documentation resource", async () => {
|
|
63
101
|
await expect(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
{},
|
|
70
|
-
),
|
|
102
|
+
client.request({
|
|
103
|
+
method: "resources/read",
|
|
104
|
+
params: { uri: "aui-docs:///definitely-not-a-real-doc" },
|
|
105
|
+
}),
|
|
71
106
|
).rejects.toThrow();
|
|
72
107
|
});
|
|
73
108
|
|
|
74
109
|
it("reads an example resource as markdown", async () => {
|
|
75
|
-
const list = await
|
|
76
|
-
|
|
77
|
-
{},
|
|
78
|
-
);
|
|
79
|
-
const example = list.resources
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
);
|
|
86
|
-
expect(read.contents[0]
|
|
87
|
-
expect(
|
|
88
|
-
expect(read.contents[0].text.length).toBeGreaterThan(0);
|
|
110
|
+
const list = await client.request<ResourceListResult>({
|
|
111
|
+
method: "resources/list",
|
|
112
|
+
params: {},
|
|
113
|
+
});
|
|
114
|
+
const example = requireResource(list.resources, "aui-example:///");
|
|
115
|
+
const read = await client.request<ResourceReadResult>({
|
|
116
|
+
method: "resources/read",
|
|
117
|
+
params: { uri: example.uri },
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
expect(read.contents[0]?.mimeType).toBe("text/markdown");
|
|
121
|
+
expect(typeof read.contents[0]?.text).toBe("string");
|
|
122
|
+
expect(read.contents[0]?.text.length).toBeGreaterThan(0);
|
|
89
123
|
});
|
|
90
124
|
|
|
91
125
|
it("errors on an unknown example resource", async () => {
|
|
92
126
|
await expect(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
{},
|
|
99
|
-
),
|
|
127
|
+
client.request({
|
|
128
|
+
method: "resources/read",
|
|
129
|
+
params: { uri: "aui-example:///definitely-not-a-real-example" },
|
|
130
|
+
}),
|
|
100
131
|
).rejects.toThrow();
|
|
101
132
|
});
|
|
102
133
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from "zod
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import { logger } from "../utils/logger.js";
|
|
3
3
|
import { formatMCPResponse } from "../utils/mcp-format.js";
|
|
4
4
|
import { getXuluxCatalog } from "../xulux/catalog-client.js";
|
|
@@ -56,7 +56,7 @@ export const xuluxTemplatesListTool = {
|
|
|
56
56
|
"Call this first for any assistant-ui app-building request. Use the features and customizable fields to decide which template fits. " +
|
|
57
57
|
"If customizable is empty, the entry is a fixed demo that should be used as-is rather than configured. " +
|
|
58
58
|
"Call assistantUITemplateDetails on the chosen template before requesting a preview.",
|
|
59
|
-
parameters: emptyInputSchema
|
|
59
|
+
parameters: emptyInputSchema,
|
|
60
60
|
execute: async (_args: z.infer<typeof emptyInputSchema>) => {
|
|
61
61
|
logger.info("Listing assistant-ui templates");
|
|
62
62
|
try {
|
|
@@ -82,7 +82,7 @@ export const xuluxTemplateDetailsTool = {
|
|
|
82
82
|
"Fixed demos return no configRoots; use those as-is without config. " +
|
|
83
83
|
"Use this before calling assistantUITemplatePreview to understand exactly what config to write. " +
|
|
84
84
|
"If assistantUITemplatePreview returns validationWarnings, call this again and cross-reference configRoots to correct the config.",
|
|
85
|
-
parameters: detailsInputSchema
|
|
85
|
+
parameters: detailsInputSchema,
|
|
86
86
|
execute: async (args: z.infer<typeof detailsInputSchema>) => {
|
|
87
87
|
logger.info(
|
|
88
88
|
`Getting assistant-ui template details for: ${args.templateId}`,
|
|
@@ -115,7 +115,7 @@ export const xuluxTemplatePreviewTool = {
|
|
|
115
115
|
"If you pass config, a preview session is created on the hosted template sandbox and the returned URLs reflect that configuration. " +
|
|
116
116
|
"Do not pass config for fixed demos that have no configRoots in assistantUITemplateDetails. " +
|
|
117
117
|
"This tool only returns URLs.",
|
|
118
|
-
parameters: previewInputSchema
|
|
118
|
+
parameters: previewInputSchema,
|
|
119
119
|
execute: async (args: z.infer<typeof previewInputSchema>) => {
|
|
120
120
|
logger.info(
|
|
121
121
|
`Creating assistant-ui template preview for: ${args.templateId}`,
|