@assistant-ui/mcp-docs-server 0.1.35 → 0.1.36
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 +1 -1
- package/.docs/organized/code-examples/with-a2a.md +2 -2
- package/.docs/organized/code-examples/with-ag-ui.md +2 -2
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +4 -4
- package/.docs/organized/code-examples/with-artifacts.md +4 -4
- package/.docs/organized/code-examples/with-assistant-transport.md +70 -54
- package/.docs/organized/code-examples/with-browser-extension.md +4 -4
- package/.docs/organized/code-examples/with-chain-of-thought.md +40 -89
- package/.docs/organized/code-examples/with-cloud-standalone.md +4 -4
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +4 -4
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +6 -6
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +6 -6
- package/.docs/organized/code-examples/with-eve.md +343 -0
- package/.docs/organized/code-examples/with-expo.md +909 -932
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -8
- package/.docs/organized/code-examples/with-generative-ui.md +5 -5
- package/.docs/organized/code-examples/with-google-adk.md +2 -2
- package/.docs/organized/code-examples/with-heat-graph.md +1 -1
- package/.docs/organized/code-examples/with-image-generation.md +4 -4
- package/.docs/organized/code-examples/with-interactables.md +166 -338
- package/.docs/organized/code-examples/with-langchain.md +4 -4
- package/.docs/organized/code-examples/with-langgraph.md +20 -157
- package/.docs/organized/code-examples/with-livekit.md +6 -6
- package/.docs/organized/code-examples/with-mcp.md +4 -4
- package/.docs/organized/code-examples/with-opencode.md +3 -3
- package/.docs/organized/code-examples/with-pi.md +9 -7
- package/.docs/organized/code-examples/with-react-hook-form.md +13 -6
- package/.docs/organized/code-examples/with-react-ink-web.md +5 -5
- package/.docs/organized/code-examples/with-react-ink.md +1 -1
- package/.docs/organized/code-examples/with-react-router.md +10 -10
- package/.docs/organized/code-examples/with-resumable-stream.md +5 -5
- package/.docs/organized/code-examples/with-store.md +1 -1
- package/.docs/organized/code-examples/with-tanstack.md +5 -5
- package/.docs/organized/code-examples/with-tap-runtime.md +2 -2
- package/.docs/organized/code-examples/with-virtualized-thread.md +44 -24
- package/.docs/raw/docs/(docs)/cli.mdx +4 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +25 -2
- package/.docs/raw/docs/(docs)/index.mdx +5 -2
- package/.docs/raw/docs/(docs)/installation.mdx +5 -2
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +16 -16
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +73 -42
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +3 -20
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +234 -166
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +51 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +70 -38
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +7 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +15 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +103 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +16 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +56 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +14 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +57 -1
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +55 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +151 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +15 -15
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +20 -20
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +25 -9
- package/.docs/raw/docs/guides/headless-composer-input.mdx +113 -0
- package/.docs/raw/docs/guides/latex.mdx +28 -22
- package/.docs/raw/docs/guides/mentions.mdx +32 -7
- package/.docs/raw/docs/guides/slash-commands.mdx +3 -6
- package/.docs/raw/docs/guides/speech.mdx +5 -7
- package/.docs/raw/docs/guides/virtualization.mdx +77 -7
- package/.docs/raw/docs/guides/voice.mdx +3 -2
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +4 -12
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +7 -10
- package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -9
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -8
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +8 -5
- package/.docs/raw/docs/integrations/index.mdx +5 -12
- package/.docs/raw/docs/integrations/observability/helicone.mdx +3 -4
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +3 -5
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +3 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +4 -3
- package/.docs/raw/docs/primitives/composer.mdx +8 -0
- package/.docs/raw/docs/primitives/thread.mdx +24 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +21 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +54 -0
- package/.docs/raw/docs/runtimes/eve/overview.mdx +100 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +143 -0
- package/.docs/raw/docs/runtimes/langchain.mdx +386 -18
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +6 -0
- package/.docs/raw/docs/tools/defining-tools.mdx +4 -0
- package/.docs/raw/docs/tools/interactables-legacy.mdx +410 -0
- package/.docs/raw/docs/tools/interactables.mdx +892 -223
- package/.docs/raw/docs/tools/mcp.mdx +4 -4
- package/.docs/raw/docs/tools/multi-agent.mdx +5 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +2 -0
- package/.docs/raw/docs/ui/file.mdx +1 -1
- package/.docs/raw/docs/ui/part-grouping.mdx +38 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +92 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +14 -6
- package/src/tools/tests/mcp-protocol.test.ts +9 -0
|
@@ -7,10 +7,10 @@ description: Connect MCP servers as a tool catalog in your assistant-ui app.
|
|
|
7
7
|
|
|
8
8
|
## How it works
|
|
9
9
|
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
```mermaid
|
|
11
|
+
flowchart LR
|
|
12
|
+
client["client"] --> api["/api/chat"] --> mcp["MCP client"] --> server["MCP server<br/>(HTTP, SSE, stdio)"]
|
|
13
|
+
mcp --> tools["tools()"] --> stream["passed to<br/>streamText({ tools })"]
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The MCP client lives on the server inside your AI SDK route handler. It connects to one or more MCP servers, calls `tools()` to get a tool map, and hands that map to `streamText`. assistant-ui's existing tool-call UI (`ToolFallback`, or toolkit entries with `render`) renders the results.
|
|
@@ -16,6 +16,10 @@ Key behaviors:
|
|
|
16
16
|
- **Recursive** — Sub-agent messages can contain tool calls that themselves have nested messages. Just use `MessagePartPrimitive.Messages` again.
|
|
17
17
|
- **Read-only** — Sub-agent messages are rendered in a readonly context. No editing, branching, or composing.
|
|
18
18
|
|
|
19
|
+
<Callout type="info">
|
|
20
|
+
This renders a sub-agent's **messages**. To visualize a sub-agent's **execution trace** instead (timing, span hierarchy, waterfalls), see [react-o11y](/docs/utilities/react-o11y), which renders observability spans as collapsible trees and timelines.
|
|
21
|
+
</Callout>
|
|
22
|
+
|
|
19
23
|
## Quick Start
|
|
20
24
|
|
|
21
25
|
<Steps>
|
|
@@ -226,6 +230,7 @@ function SubConversation({
|
|
|
226
230
|
## Related
|
|
227
231
|
|
|
228
232
|
- [Generative UI](/docs/tools/tool-ui) — Creating tool call UIs
|
|
233
|
+
- [react-o11y](/docs/utilities/react-o11y) — Visualize sub-agent execution as collapsible span trees, waterfalls, and call timelines
|
|
229
234
|
- [MessagePartPrimitive](/docs/api-reference/primitives/message-part) — API reference for message part primitives
|
|
230
235
|
- [Sub-Agent Model Tracking](/docs/cloud/ai-sdk#sub-agent-model-tracking) — Track delegated model usage and costs in the Cloud dashboard
|
|
231
236
|
- [LangGraph Streaming](/docs/runtimes/langgraph/streaming) — Event handlers, subgraph events, and message metadata
|
|
@@ -185,6 +185,8 @@ The popover implements the WAI-ARIA editable combobox pattern.
|
|
|
185
185
|
| `backLabel` | `string` | `"Back"` | Back button label |
|
|
186
186
|
| `emptyCategoriesLabel` | `string` | `"No items available"` | Shown when no categories are available |
|
|
187
187
|
| `emptyItemsLabel` | `string` | `"No matching items"` | Shown when no items match |
|
|
188
|
+
| `isLoading` | `boolean` | `false` | Whether the adapter is resolving items (async sources). Pair with `unstable_useLiveCompletionAdapter`. |
|
|
189
|
+
| `loadingLabel` | `string` | `"Loading…"` | Shown in place of `emptyItemsLabel` while `isLoading` and no items are present |
|
|
188
190
|
|
|
189
191
|
All other props (`className`, etc.) forward to the underlying popover `div`.
|
|
190
192
|
|
|
@@ -27,7 +27,7 @@ Pass `File` to `MessagePrimitive.Parts`:
|
|
|
27
27
|
```tsx title="/components/assistant-ui/thread.tsx" {1,8}
|
|
28
28
|
import { File } from "@/components/assistant-ui/file";
|
|
29
29
|
|
|
30
|
-
const
|
|
30
|
+
const UserMessage: FC = () => {
|
|
31
31
|
return (
|
|
32
32
|
<MessagePrimitive.Root className="...">
|
|
33
33
|
<MessagePrimitive.Parts>
|
|
@@ -252,6 +252,44 @@ The synthetic `"standalone-tool-call"` key on `groupPartByType` matches all of t
|
|
|
252
252
|
The `"mcp-app"` key is deprecated in favor of `"standalone-tool-call"`, which is a superset (it also matches MCP-app tool calls). Existing `"mcp-app"` usage keeps working.
|
|
253
253
|
</Callout>
|
|
254
254
|
|
|
255
|
+
### Render Tool Calls as Flat Rows
|
|
256
|
+
|
|
257
|
+
The previous section keeps `"tool-call"` folded into the chain-of-thought and only lifts standalone tool UIs out. To keep reasoning collapsed in a group while every tool call renders as its own row in the message flow, map both tool keys to `[]`:
|
|
258
|
+
|
|
259
|
+
```tsx
|
|
260
|
+
<MessagePrimitive.GroupedParts
|
|
261
|
+
groupBy={groupPartByType({
|
|
262
|
+
reasoning: ["group-thought", "group-reasoning"],
|
|
263
|
+
"tool-call": [],
|
|
264
|
+
"standalone-tool-call": [],
|
|
265
|
+
})}
|
|
266
|
+
>
|
|
267
|
+
{({ part, children }) => {
|
|
268
|
+
switch (part.type) {
|
|
269
|
+
case "group-thought":
|
|
270
|
+
case "group-reasoning":
|
|
271
|
+
return <ReasoningBlock>{children}</ReasoningBlock>;
|
|
272
|
+
case "reasoning":
|
|
273
|
+
return <Reasoning {...part} />;
|
|
274
|
+
case "tool-call":
|
|
275
|
+
return part.toolUI ?? <ToolFallback {...part} />;
|
|
276
|
+
case "text":
|
|
277
|
+
return <MarkdownText />;
|
|
278
|
+
case "indicator":
|
|
279
|
+
return <LoadingDots />;
|
|
280
|
+
default:
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
}}
|
|
284
|
+
</MessagePrimitive.GroupedParts>
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Adjacent `reasoning` parts still coalesce into one `group-thought`, while each tool call is a leaf at the same level as text — the `"standalone-tool-call"` entry is mapped to `[]` too so human-in-the-loop and generative-UI tools stay flat alongside routine calls instead of falling through to `"tool-call"`. Tool-call leaves keep their stable identity keys across re-renders, so rows don't remount as the message streams.
|
|
288
|
+
|
|
289
|
+
<Callout type="warn">
|
|
290
|
+
This renders tool calls flat **in the message flow** — each leaf sits where the part appears, in order. It does not pin, portal, float, or otherwise move tool UIs out of the flow into a sidebar or fixed region. For out-of-flow placement you still own the layout outside `GroupedParts`.
|
|
291
|
+
</Callout>
|
|
292
|
+
|
|
255
293
|
### Group by Custom Metadata
|
|
256
294
|
|
|
257
295
|
Use any custom metadata in your parts for grouping:
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: react-o11y
|
|
3
|
-
description: Headless primitives for visualizing observability spans
|
|
3
|
+
description: Headless primitives for visualizing observability spans as collapsible trace trees, waterfalls, and agent and LLM call timelines.
|
|
4
4
|
platforms: ["react"]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
import { WaterfallSample } from "@/components/docs/samples/o11y/waterfall";
|
|
8
|
+
import {
|
|
9
|
+
StatusSample,
|
|
10
|
+
CollapseSample,
|
|
11
|
+
StreamingSample,
|
|
12
|
+
} from "@/components/docs/samples/o11y/capability-samples";
|
|
13
|
+
|
|
7
14
|
<Callout type="warn">
|
|
8
|
-
`@assistant-ui/react-o11y` is
|
|
15
|
+
`@assistant-ui/react-o11y` is experimental. The API may change without notice.
|
|
9
16
|
</Callout>
|
|
10
17
|
|
|
11
18
|
`@assistant-ui/react-o11y` provides headless, Radix-style primitives for rendering observability spans as collapsible, indented hierarchical UIs. Use it to build trace inspectors, waterfall debug panels, or LLM call timelines on top of your own span data source.
|
|
@@ -15,6 +22,10 @@ platforms: ["react"]
|
|
|
15
22
|
- **Tree-aware** — Automatic depth, parent / child collapse, time range computation.
|
|
16
23
|
- **Reactive** — Built on the same reactive core as the runtimes, so spans stream into your UI as they change.
|
|
17
24
|
|
|
25
|
+
<div className="not-prose my-6">
|
|
26
|
+
<WaterfallSample />
|
|
27
|
+
</div>
|
|
28
|
+
|
|
18
29
|
## Installation
|
|
19
30
|
|
|
20
31
|
<InstallCommand npm={["@assistant-ui/react-o11y"]} />
|
|
@@ -43,13 +54,12 @@ function SpanRow() {
|
|
|
43
54
|
<SpanPrimitive.StatusIndicator className="size-2 rounded-full data-[span-status=running]:bg-yellow-500 data-[span-status=completed]:bg-green-500 data-[span-status=failed]:bg-red-500" />
|
|
44
55
|
<SpanPrimitive.TypeBadge className="rounded bg-muted px-1.5 text-xs" />
|
|
45
56
|
<SpanPrimitive.Name className="text-sm" />
|
|
46
|
-
<SpanPrimitive.Children components={{ Span: SpanRow }} />
|
|
47
57
|
</SpanPrimitive.Root>
|
|
48
58
|
);
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
export function TraceView({ spans }: { spans: SpanData[] }) {
|
|
52
|
-
const aui = useAui({
|
|
62
|
+
const aui = useAui({ span: SpanResource({ spans }) });
|
|
53
63
|
|
|
54
64
|
return (
|
|
55
65
|
<AuiProvider value={aui}>
|
|
@@ -61,6 +71,32 @@ export function TraceView({ spans }: { spans: SpanData[] }) {
|
|
|
61
71
|
|
|
62
72
|
`SpanData` is the input shape your code produces (see [SpanData](#spandata)). `SpanResource` enriches it with depth, child counts, time range, and collapse state.
|
|
63
73
|
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Status states
|
|
77
|
+
|
|
78
|
+
`data-span-status` exposes each span's lifecycle, so running, completed, failed, and skipped are styled with pure CSS.
|
|
79
|
+
|
|
80
|
+
<div className="not-prose my-6">
|
|
81
|
+
<StatusSample />
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
### Collapsible subtrees
|
|
85
|
+
|
|
86
|
+
`SpanPrimitive.CollapseToggle` removes a span's descendants from the visible flat list, not just hides them. Click a chevron to collapse a subtree.
|
|
87
|
+
|
|
88
|
+
<div className="not-prose my-6">
|
|
89
|
+
<CollapseSample />
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
### Streaming spans
|
|
93
|
+
|
|
94
|
+
`SpanResource` re-derives the tree whenever the `spans` prop changes, so spans stream in and update live.
|
|
95
|
+
|
|
96
|
+
<div className="not-prose my-6">
|
|
97
|
+
<StreamingSample />
|
|
98
|
+
</div>
|
|
99
|
+
|
|
64
100
|
## Anatomy
|
|
65
101
|
|
|
66
102
|
```tsx
|
|
@@ -71,7 +107,7 @@ import {
|
|
|
71
107
|
} from "@assistant-ui/react-o11y";
|
|
72
108
|
|
|
73
109
|
// Top-level: mount SpanResource via useAui
|
|
74
|
-
const aui = useAui({
|
|
110
|
+
const aui = useAui({ span: SpanResource({ spans }) });
|
|
75
111
|
|
|
76
112
|
<AuiProvider value={aui}>
|
|
77
113
|
{/* Render visible spans (flat-list output respecting collapsed state) */}
|
|
@@ -104,7 +140,7 @@ Resource that ingests raw span data and exposes a tree-aware reactive state to p
|
|
|
104
140
|
SpanResource({ spans }: { spans: SpanData[] }): ClientOutput<"span">;
|
|
105
141
|
```
|
|
106
142
|
|
|
107
|
-
Mount through `useAui({
|
|
143
|
+
Mount through `useAui({ span: SpanResource({ spans }) })`.
|
|
108
144
|
|
|
109
145
|
The resource computes:
|
|
110
146
|
|
|
@@ -243,6 +279,56 @@ Convenience component that pairs `SpanByIndexProvider` with a render component:
|
|
|
243
279
|
|
|
244
280
|
Useful when you want explicit control over which child indices to render (e.g. for virtualization).
|
|
245
281
|
|
|
282
|
+
### SpanPrimitive.Timeline
|
|
283
|
+
|
|
284
|
+
A `<div>` that provides a timeline range to descendant `TimelineBar` primitives and exposes range CSS variables.
|
|
285
|
+
|
|
286
|
+
| Prop | Type | Default | Description |
|
|
287
|
+
| --- | --- | --- | --- |
|
|
288
|
+
| `timeRange` | `{ min: number; max: number }` | `span.timeRange` | Override the range used for positioning bars. |
|
|
289
|
+
| `paddingEnd` | `number` | `0` | Extends the max by this ratio of the range duration, useful for right-side breathing room. |
|
|
290
|
+
|
|
291
|
+
Exposes `data-span-timeline` and CSS variables:
|
|
292
|
+
|
|
293
|
+
| Variable | Description |
|
|
294
|
+
| --- | --- |
|
|
295
|
+
| `--span-timeline-min-ms` | Timeline start timestamp. |
|
|
296
|
+
| `--span-timeline-max-ms` | Timeline end timestamp after padding. |
|
|
297
|
+
| `--span-timeline-range-ms` | Timeline duration after padding. |
|
|
298
|
+
|
|
299
|
+
### SpanPrimitive.TimelineBar
|
|
300
|
+
|
|
301
|
+
A `<div>` that positions the current span within the nearest `SpanPrimitive.Timeline` range. It reads `startedAt`, `endedAt`, `status`, `type`, and `timeRange` from the current span scope.
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
<SpanPrimitive.Timeline>
|
|
305
|
+
<SpanPrimitive.Children>
|
|
306
|
+
{() => (
|
|
307
|
+
<div className="relative h-8">
|
|
308
|
+
<SpanPrimitive.TimelineBar className="top-1 h-6 rounded bg-blue-500" />
|
|
309
|
+
</div>
|
|
310
|
+
)}
|
|
311
|
+
</SpanPrimitive.Children>
|
|
312
|
+
</SpanPrimitive.Timeline>
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
Running spans use the timeline range max when `now` is omitted, keeping SSR and hydration deterministic. For live ticking, update a timestamp from an effect or animation loop and pass it as `now`.
|
|
316
|
+
|
|
317
|
+
| Prop | Type | Default | Description |
|
|
318
|
+
| --- | --- | --- | --- |
|
|
319
|
+
| `now` | `number` | `undefined` | Explicit timestamp used as the end of running spans. |
|
|
320
|
+
| `timeRange` | `{ min: number; max: number }` | nearest `Timeline` range | Override the range used for this bar. |
|
|
321
|
+
|
|
322
|
+
Exposes `data-span-status`, `data-span-type`, `data-span-running`, and these CSS variables:
|
|
323
|
+
|
|
324
|
+
| Variable | Description |
|
|
325
|
+
| --- | --- |
|
|
326
|
+
| `--span-timeline-left` | Bar start position as a percentage. |
|
|
327
|
+
| `--span-timeline-end` | Bar end position as a percentage. |
|
|
328
|
+
| `--span-timeline-width` | Bar width as a percentage. |
|
|
329
|
+
| `--span-timeline-duration-ms` | Bar duration in milliseconds. |
|
|
330
|
+
| `--span-timeline-min-width` | Optional consumer-set minimum width used by the default inline size. |
|
|
331
|
+
|
|
246
332
|
## Styling
|
|
247
333
|
|
|
248
334
|
All primitives forward refs and accept standard DOM props (`className`, `style`, etc.). Use the data attributes for state-based styling:
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAca,MAAA,EAAM,SAGjB;AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAca,MAAA,EAAM,SAGjB;AAAA,iBAuBoB,SAAA,IAAS,OAAA"}
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,24 @@ const server = new McpServer({
|
|
|
12
12
|
name: "assistant-ui-docs",
|
|
13
13
|
version: packageJson.version
|
|
14
14
|
});
|
|
15
|
-
server.
|
|
16
|
-
|
|
15
|
+
server.registerTool(docsTools.name, {
|
|
16
|
+
title: "assistant-ui Documentation",
|
|
17
|
+
description: docsTools.description,
|
|
18
|
+
inputSchema: docsTools.parameters,
|
|
19
|
+
annotations: {
|
|
20
|
+
readOnlyHint: true,
|
|
21
|
+
openWorldHint: false
|
|
22
|
+
}
|
|
23
|
+
}, docsTools.execute);
|
|
24
|
+
server.registerTool(examplesTools.name, {
|
|
25
|
+
title: "assistant-ui Examples",
|
|
26
|
+
description: examplesTools.description,
|
|
27
|
+
inputSchema: examplesTools.parameters,
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: true,
|
|
30
|
+
openWorldHint: false
|
|
31
|
+
}
|
|
32
|
+
}, examplesTools.execute);
|
|
17
33
|
async function runServer() {
|
|
18
34
|
try {
|
|
19
35
|
logger.info(`Starting assistant-ui MCP docs server v${packageJson.version}`);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { docsTools } from \"./tools/docs.js\";\nimport { examplesTools } from \"./tools/examples.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.
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { docsTools } from \"./tools/docs.js\";\nimport { examplesTools } from \"./tools/examples.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);\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":";;;;;;;;;AAUA,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;AAEA,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,OAAO,KAAK,QAAQ,UAAU,QAAQ,KAAK,MAC7C,UAAe,CAAC,CAAC,OAAO,UAAU;CAChC,QAAQ,MAAM,2BAA2B,KAAK;CAC9C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|
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.36",
|
|
4
4
|
"description": "MCP server for assistant-ui documentation and examples",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"zod": "^4.4.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "^
|
|
40
|
+
"@types/node": "^26.0.0",
|
|
41
41
|
"tsx": "^4.22.4",
|
|
42
|
-
"vitest": "^4.1.
|
|
43
|
-
"@assistant-ui/x-buildutils": "0.0.
|
|
42
|
+
"vitest": "^4.1.9",
|
|
43
|
+
"@assistant-ui/x-buildutils": "0.0.16"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public",
|
package/src/index.ts
CHANGED
|
@@ -17,16 +17,24 @@ export const server = new McpServer({
|
|
|
17
17
|
version: packageJson.version,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
server.
|
|
20
|
+
server.registerTool(
|
|
21
21
|
docsTools.name,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
{
|
|
23
|
+
title: "assistant-ui Documentation",
|
|
24
|
+
description: docsTools.description,
|
|
25
|
+
inputSchema: docsTools.parameters,
|
|
26
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
27
|
+
},
|
|
24
28
|
docsTools.execute,
|
|
25
29
|
);
|
|
26
|
-
server.
|
|
30
|
+
server.registerTool(
|
|
27
31
|
examplesTools.name,
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
{
|
|
33
|
+
title: "assistant-ui Examples",
|
|
34
|
+
description: examplesTools.description,
|
|
35
|
+
inputSchema: examplesTools.parameters,
|
|
36
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
37
|
+
},
|
|
30
38
|
examplesTools.execute,
|
|
31
39
|
);
|
|
32
40
|
|
|
@@ -73,6 +73,15 @@ describe("MCP Protocol Integration", () => {
|
|
|
73
73
|
expect(examplesTool.inputSchema).toBeDefined();
|
|
74
74
|
expect(examplesTool.inputSchema.type).toBe("object");
|
|
75
75
|
expect(examplesTool.inputSchema.properties).toBeDefined();
|
|
76
|
+
|
|
77
|
+
// registerTool metadata is surfaced on tools/list: `title` is a
|
|
78
|
+
// top-level field, `annotations` carries only the hint flags.
|
|
79
|
+
expect(docsTool.title).toBe("assistant-ui Documentation");
|
|
80
|
+
expect(docsTool.annotations?.readOnlyHint).toBe(true);
|
|
81
|
+
expect(docsTool.annotations?.openWorldHint).toBe(false);
|
|
82
|
+
expect(examplesTool.title).toBe("assistant-ui Examples");
|
|
83
|
+
expect(examplesTool.annotations?.readOnlyHint).toBe(true);
|
|
84
|
+
expect(examplesTool.annotations?.openWorldHint).toBe(false);
|
|
76
85
|
});
|
|
77
86
|
|
|
78
87
|
it("should handle CallTool request for assistantUIDocs", async () => {
|