@assistant-ui/mcp-docs-server 0.1.36 → 0.1.39
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 +8 -9
- package/.docs/organized/code-examples/with-a2a.md +16 -11
- package/.docs/organized/code-examples/with-ag-ui.md +16 -11
- package/.docs/organized/code-examples/{with-ai-sdk-v6.md → with-ai-sdk-v7.md} +32 -21
- package/.docs/organized/code-examples/with-artifacts.md +17 -10
- package/.docs/organized/code-examples/with-assistant-transport.md +15 -8
- package/.docs/organized/code-examples/with-browser-extension.md +15 -8
- package/.docs/organized/code-examples/with-chain-of-thought.md +17 -10
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -9
- package/.docs/organized/code-examples/with-cloud.md +18 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +17 -10
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +20 -13
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -13
- package/.docs/organized/code-examples/with-eve.md +16 -9
- package/.docs/organized/code-examples/with-expo.md +26 -23
- package/.docs/organized/code-examples/with-external-store.md +16 -11
- package/.docs/organized/code-examples/with-ffmpeg.md +18 -13
- package/.docs/organized/code-examples/with-generative-ui.md +20 -15
- package/.docs/organized/code-examples/with-google-adk.md +16 -9
- package/.docs/organized/code-examples/with-heat-graph.md +8 -9
- package/.docs/organized/code-examples/with-image-generation.md +17 -10
- package/.docs/organized/code-examples/with-interactables.md +19 -15
- package/.docs/organized/code-examples/with-langchain.md +17 -10
- package/.docs/organized/code-examples/with-langgraph.md +17 -10
- package/.docs/organized/code-examples/with-livekit.md +21 -14
- package/.docs/organized/code-examples/with-mcp.md +40 -18
- package/.docs/organized/code-examples/with-opencode.md +22 -17
- package/.docs/organized/code-examples/with-pi.md +47 -12
- package/.docs/organized/code-examples/with-react-hook-form.md +19 -14
- package/.docs/organized/code-examples/with-react-ink-web.md +6 -6
- package/.docs/organized/code-examples/with-react-ink.md +2 -2
- package/.docs/organized/code-examples/with-react-router.md +20 -15
- package/.docs/organized/code-examples/with-resumable-stream.md +19 -12
- package/.docs/organized/code-examples/with-store.md +8 -9
- package/.docs/organized/code-examples/with-tanstack.md +17 -11
- package/.docs/organized/code-examples/with-tap-runtime.md +16 -11
- package/.docs/organized/code-examples/with-virtualized-thread.md +17 -12
- package/.docs/raw/docs/(docs)/base-ui.mdx +39 -0
- package/.docs/raw/docs/(docs)/cli.mdx +18 -2
- package/.docs/raw/docs/(docs)/installation.mdx +15 -1
- package/.docs/raw/docs/(docs)/rtl.mdx +2 -4
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/actions.mdx +56 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/components.mdx +86 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +19 -1
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/json-generative-ui.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +53 -2
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +81 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +86 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/tokens.mdx +62 -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 +4 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +37 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +29 -29
- package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +3 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +2 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +0 -2
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +12 -9
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +4 -0
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +7 -1
- package/.docs/raw/docs/cloud/langgraph.mdx +4 -2
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +108 -0
- package/.docs/raw/docs/guides/dictation.mdx +185 -257
- package/.docs/raw/docs/guides/index.mdx +10 -0
- package/.docs/raw/docs/guides/mentions.mdx +31 -3
- package/.docs/raw/docs/guides/resumable-streams.mdx +12 -1
- package/.docs/raw/docs/guides/speech.mdx +47 -29
- package/.docs/raw/docs/guides/suggestions.mdx +70 -1
- package/.docs/raw/docs/guides/voice.mdx +197 -267
- package/.docs/raw/docs/ink/primitives.mdx +35 -1
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +13 -7
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +3 -3
- 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/index.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/helicone.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +3 -3
- package/.docs/raw/docs/migrations/index.mdx +50 -0
- package/.docs/raw/docs/migrations/react-langgraph-v0-7.mdx +2 -2
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +4 -2
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +6 -1
- package/.docs/raw/docs/primitives/composer.mdx +16 -0
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +25 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +30 -6
- package/.docs/raw/docs/react-native/primitives.mdx +23 -0
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +124 -0
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +13 -2
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +13 -4
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +11 -11
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +5 -5
- package/.docs/raw/docs/runtimes/ai-sdk/{v6.mdx → v6-legacy.mdx} +8 -6
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +717 -0
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +1 -1
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +10 -19
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +2 -0
- package/.docs/raw/docs/runtimes/eve/overview.mdx +1 -1
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +181 -0
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +1 -1
- package/.docs/raw/docs/tools/backend.mdx +6 -3
- package/.docs/raw/docs/tools/defining-tools.mdx +12 -1
- package/.docs/raw/docs/tools/generative-ui.mdx +95 -0
- package/.docs/raw/docs/tools/mcp-apps.mdx +37 -10
- package/.docs/raw/docs/tools/mcp.mdx +105 -3
- package/.docs/raw/docs/tools/tool-ui.mdx +6 -4
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +41 -4
- package/.docs/raw/docs/ui/accordion.mdx +16 -10
- package/.docs/raw/docs/ui/assistant-modal.mdx +8 -4
- package/.docs/raw/docs/ui/attachment.mdx +5 -1
- package/.docs/raw/docs/ui/badge.mdx +23 -12
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +80 -0
- package/.docs/raw/docs/ui/model-selector.mdx +69 -6
- package/.docs/raw/docs/ui/select.mdx +22 -14
- package/.docs/raw/docs/ui/sources.mdx +1 -1
- package/.docs/raw/docs/ui/tabs.mdx +25 -14
- package/.docs/raw/docs/utilities/heat-graph.mdx +2 -2
- package/README.md +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +2 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js +0 -4
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/prompts/xulux-playground.d.ts +12 -0
- package/dist/prompts/xulux-playground.d.ts.map +1 -0
- package/dist/prompts/xulux-playground.js +33 -0
- package/dist/prompts/xulux-playground.js.map +1 -0
- package/dist/tools/docs.d.ts +2 -4
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +38 -10
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +5 -5
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +10 -7
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +6 -0
- package/dist/tools/resources.d.ts.map +1 -0
- package/dist/tools/resources.js +74 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +39 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +7 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/tools/xulux-templates.d.ts +72 -0
- package/dist/tools/xulux-templates.d.ts.map +1 -0
- package/dist/tools/xulux-templates.js +82 -0
- package/dist/tools/xulux-templates.js.map +1 -0
- package/dist/utils/cache.d.ts +5 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +18 -0
- package/dist/utils/cache.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/mcp-format.d.ts +1 -0
- package/dist/utils/mcp-format.d.ts.map +1 -1
- package/dist/utils/mcp-format.js +7 -4
- package/dist/utils/mcp-format.js.map +1 -1
- package/dist/utils/mdx.d.ts +2 -1
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/mdx.js +19 -2
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts +2 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +20 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/search.d.ts +10 -0
- package/dist/utils/search.d.ts.map +1 -0
- package/dist/utils/search.js +97 -0
- package/dist/utils/search.js.map +1 -0
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/xulux/catalog-client.d.ts +14 -0
- package/dist/xulux/catalog-client.d.ts.map +1 -0
- package/dist/xulux/catalog-client.js +67 -0
- package/dist/xulux/catalog-client.js.map +1 -0
- package/dist/xulux/fallback-catalog.d.ts +7 -0
- package/dist/xulux/fallback-catalog.d.ts.map +1 -0
- package/dist/xulux/fallback-catalog.js +47 -0
- package/dist/xulux/fallback-catalog.js.map +1 -0
- package/dist/xulux/fetch-sandbox.d.ts +5 -0
- package/dist/xulux/fetch-sandbox.d.ts.map +1 -0
- package/dist/xulux/fetch-sandbox.js +40 -0
- package/dist/xulux/fetch-sandbox.js.map +1 -0
- package/dist/xulux/template-service.d.ts +84 -0
- package/dist/xulux/template-service.d.ts.map +1 -0
- package/dist/xulux/template-service.js +223 -0
- package/dist/xulux/template-service.js.map +1 -0
- package/dist/xulux/types.d.ts +55 -0
- package/dist/xulux/types.d.ts.map +1 -0
- package/dist/xulux/types.js +6 -0
- package/dist/xulux/types.js.map +1 -0
- package/package.json +5 -5
- package/src/constants.ts +2 -0
- package/src/index.ts +67 -0
- package/src/prepare-docs/copy-raw.ts +0 -5
- package/src/prompts/xulux-playground.ts +36 -0
- package/src/tools/docs.ts +52 -4
- package/src/tools/examples.ts +18 -11
- package/src/tools/resources.ts +114 -0
- package/src/tools/search.ts +46 -0
- package/src/tools/tests/completions.test.ts +46 -0
- package/src/tools/tests/directory-size-cap.test.ts +50 -0
- package/src/tools/tests/docs.test.ts +20 -0
- package/src/tools/tests/examples.test.ts +5 -5
- package/src/tools/tests/listings-cache.test.ts +19 -0
- package/src/tools/tests/mcp-protocol.test.ts +92 -1
- package/src/tools/tests/resources.test.ts +102 -0
- package/src/tools/tests/search.test.ts +37 -0
- package/src/tools/tests/test-setup.ts +10 -0
- package/src/tools/tests/xulux-templates.test.ts +262 -0
- package/src/tools/xulux-templates.ts +141 -0
- package/src/utils/cache.ts +20 -0
- package/src/utils/mcp-format.ts +8 -6
- package/src/utils/mdx.ts +21 -1
- package/src/utils/paths.ts +25 -0
- package/src/utils/search.ts +131 -0
- package/src/utils/tests/cache.test.ts +51 -0
- package/src/utils/tests/mcp-format.test.ts +22 -0
- package/src/utils/tests/security.test.ts +1 -1
- package/src/xulux/catalog-client.ts +105 -0
- package/src/xulux/fallback-catalog.ts +63 -0
- package/src/xulux/fetch-sandbox.ts +56 -0
- package/src/xulux/template-service.ts +406 -0
- package/src/xulux/types.ts +60 -0
- package/.docs/raw/blog/2024-07-29-hello/index.mdx +0 -64
- package/.docs/raw/blog/2024-09-11/index.mdx +0 -10
- package/.docs/raw/blog/2024-12-15/index.mdx +0 -10
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +0 -127
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +0 -258
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +0 -464
|
@@ -5,10 +5,14 @@ platforms: ["react"]
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
import { ModelSelectorSample } from "@/components/docs/samples/model-selector";
|
|
8
|
+
import * as ModelSelectorRadixSamples from "@/components/docs/samples/model-selector.radix";
|
|
9
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
8
10
|
|
|
9
11
|
A picker that lets users switch between AI models and choose a reasoning effort (thinking) level. It is built on Popover + Command, so search, provider grouping, and filtering compose in without being built in. The default export integrates with assistant-ui's `ModelContext` system, so the selection reaches your backend on every request with no extra wiring.
|
|
10
12
|
|
|
11
|
-
<
|
|
13
|
+
<FlavorSwitcher />
|
|
14
|
+
|
|
15
|
+
<Flavored radix={<ModelSelectorRadixSamples.ModelSelectorSample />} base={<ModelSelectorSample />} />
|
|
12
16
|
|
|
13
17
|
## Getting Started
|
|
14
18
|
|
|
@@ -141,6 +145,26 @@ function EffortDropdown() {
|
|
|
141
145
|
|
|
142
146
|
Render it inside `ModelSelector.Content` in place of `ModelSelector.Effort`. The same hook supports any shape that reads the levels and writes the selection.
|
|
143
147
|
|
|
148
|
+
## Provider Logos
|
|
149
|
+
|
|
150
|
+
Each model's `icon` accepts any `ReactNode` and renders in the trigger and the dropdown items. The optional `logos` registry item ships `OpenAILogo`, `ClaudeLogo`, and `GeminiLogo` marks to plug in:
|
|
151
|
+
|
|
152
|
+
<InstallCommand shadcn={["logos"]} />
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
import { ClaudeLogo, GeminiLogo, OpenAILogo } from "@/components/assistant-ui/logos";
|
|
156
|
+
|
|
157
|
+
<ModelSelector
|
|
158
|
+
models={[
|
|
159
|
+
{ id: "gpt-5.5", name: "GPT-5.5", icon: <OpenAILogo /> },
|
|
160
|
+
{ id: "claude-opus-4.5", name: "Claude Opus 4.5", icon: <ClaudeLogo /> },
|
|
161
|
+
{ id: "gemini-3-pro", name: "Gemini 3 Pro", icon: <GeminiLogo /> },
|
|
162
|
+
]}
|
|
163
|
+
/>;
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Icons are opt-in per model — omit `icon` and the entry renders text-only.
|
|
167
|
+
|
|
144
168
|
## Search
|
|
145
169
|
|
|
146
170
|
Search is opt-in. Pass `searchable` to the default component:
|
|
@@ -149,7 +173,7 @@ Search is opt-in. Pass `searchable` to the default component:
|
|
|
149
173
|
<ModelSelector models={models} searchable />
|
|
150
174
|
```
|
|
151
175
|
|
|
152
|
-
Or compose `ModelSelector.Search` into a custom layout. Matching runs against each model's `id`, `name`, and `keywords`; add the provider name to `keywords` so typing "openai" finds its models.
|
|
176
|
+
The same prop works on `ModelSelector.Content` when it renders its default children. Or compose `ModelSelector.Search` into a custom layout. Matching runs against each model's `id`, `name`, and `keywords`; add the provider name to `keywords` so typing "openai" finds its models.
|
|
153
177
|
|
|
154
178
|
## Composition
|
|
155
179
|
|
|
@@ -204,6 +228,7 @@ import {
|
|
|
204
228
|
| `ModelSelector.Value` | Selected model name, icon, and active effort |
|
|
205
229
|
| `ModelSelector.Content` | Popover content wrapping a Command |
|
|
206
230
|
| `ModelSelector.Search` | Search input that filters the list |
|
|
231
|
+
| `ModelSelector.FocusAnchor` | Visually hidden input that anchors keyboard navigation when there is no search box |
|
|
207
232
|
| `ModelSelector.List` | List of model items (renders all models by default) |
|
|
208
233
|
| `ModelSelector.Empty` | Empty state shown when search has no matches |
|
|
209
234
|
| `ModelSelector.Group` | Labeled group of items (e.g. by provider) |
|
|
@@ -213,12 +238,20 @@ import {
|
|
|
213
238
|
|
|
214
239
|
`ModelSelector.List` is a Command list, so filtering and keyboard navigation work across groups automatically. Custom sorting is plain code: order the models before rendering items.
|
|
215
240
|
|
|
241
|
+
Keyboard navigation needs a focused input to drive it. When content is unfiltered (`searchable={false}` on `ModelSelector.Content`, or the default children), `ModelSelector.Content` renders a visually hidden `ModelSelector.FocusAnchor` automatically, so custom layouts without a search box stay keyboard-operable. In a custom layout that renders neither `ModelSelector.Search` nor `searchable={false}`, place `ModelSelector.FocusAnchor` yourself to keep the list reachable from the keyboard.
|
|
242
|
+
|
|
216
243
|
<Callout type="warn">
|
|
217
244
|
`ModelSelector.Content` wraps a Command whose root keydown handler claims
|
|
218
|
-
<
|
|
219
|
-
composed inside it (filter chips,
|
|
220
|
-
|
|
221
|
-
|
|
245
|
+
<Kbd>Enter</Kbd> to select the highlighted model and the arrow keys to move
|
|
246
|
+
through the list. Interactive elements composed inside it (filter chips,
|
|
247
|
+
custom effort controls) should stop propagation for the keys they handle in
|
|
248
|
+
their own `onKeyDown` so the focused control responds instead.
|
|
249
|
+
`ModelSelector.Effort` does this for <Kbd>Home</Kbd> / <Kbd>End</Kbd> (which
|
|
250
|
+
cmdk would otherwise use to jump to the first / last model), lets its
|
|
251
|
+
radiogroup own <Kbd>ArrowLeft</Kbd> / <Kbd>ArrowRight</Kbd>, and hands
|
|
252
|
+
<Kbd>ArrowUp</Kbd> / <Kbd>ArrowDown</Kbd> back to the model list by
|
|
253
|
+
refocusing cmdk's input, so the highlight only moves while a following
|
|
254
|
+
<Kbd>Enter</Kbd> can act on it.
|
|
222
255
|
</Callout>
|
|
223
256
|
|
|
224
257
|
## Variants
|
|
@@ -247,6 +280,30 @@ Use the `size` prop to control the trigger dimensions.
|
|
|
247
280
|
<ModelSelector size="lg" /> // Large (h-10)
|
|
248
281
|
```
|
|
249
282
|
|
|
283
|
+
## Keyboard Navigation
|
|
284
|
+
|
|
285
|
+
The picker is fully operable from the keyboard, including when search is disabled.
|
|
286
|
+
|
|
287
|
+
| Key | Action |
|
|
288
|
+
| --- | --- |
|
|
289
|
+
| <Kbd>ArrowDown</Kbd> / <Kbd>ArrowUp</Kbd> | Open the popover from the focused trigger; move between models once open, returning focus to the list from the Thinking row |
|
|
290
|
+
| <Kbd>Enter</Kbd> | Select the highlighted model and close |
|
|
291
|
+
| <Kbd>Escape</Kbd> | Close the popover and return focus to the trigger |
|
|
292
|
+
| <Kbd>Tab</Kbd> | Move from the model list to the Thinking row |
|
|
293
|
+
| <Kbd>ArrowLeft</Kbd> / <Kbd>ArrowRight</Kbd> | Move between reasoning effort levels (Thinking row) |
|
|
294
|
+
| <Kbd>Home</Kbd> / <Kbd>End</Kbd> | Jump to the first / last model (list) or effort level (Thinking row) |
|
|
295
|
+
|
|
296
|
+
When `searchable` is set, typing filters the list; otherwise the keys above drive selection directly.
|
|
297
|
+
|
|
298
|
+
## Accessibility
|
|
299
|
+
|
|
300
|
+
The picker implements the WAI-ARIA combobox pattern over Popover + Command.
|
|
301
|
+
|
|
302
|
+
- The trigger is `role="combobox"` with `aria-haspopup="listbox"`; the popover primitive manages `aria-expanded` and `aria-controls`.
|
|
303
|
+
- The model list is a Command (cmdk) listbox: each item is `role="option"` with `aria-selected`, and the active item is tracked with `aria-activedescendant`.
|
|
304
|
+
- Keyboard navigation works without a visible search box: `ModelSelector.Content` renders a visually hidden input (`ModelSelector.FocusAnchor`) that anchors cmdk's focus so the list stays reachable. Pass `searchable` to surface a real search input instead.
|
|
305
|
+
- The Thinking row (`ModelSelector.Effort`) is a `role="radiogroup"` of `role="radio"` toggles with roving tabindex, so it is a single tab stop and <Kbd>ArrowLeft</Kbd> / <Kbd>ArrowRight</Kbd> move focus and select in one step. <Kbd>ArrowUp</Kbd> / <Kbd>ArrowDown</Kbd> return focus to the model list.
|
|
306
|
+
|
|
250
307
|
## How It Works
|
|
251
308
|
|
|
252
309
|
The default `ModelSelector` export registers the selection with assistant-ui's `ModelContext` system:
|
|
@@ -318,6 +375,12 @@ This works out of the box with `@assistant-ui/react-ai-sdk`. `ModelSelector.Root
|
|
|
318
375
|
default: '"default"',
|
|
319
376
|
description: "Size of the trigger button.",
|
|
320
377
|
},
|
|
378
|
+
{
|
|
379
|
+
name: "align",
|
|
380
|
+
type: '"start" | "center" | "end"',
|
|
381
|
+
default: '"start"',
|
|
382
|
+
description: "Alignment of the dropdown relative to the trigger.",
|
|
383
|
+
},
|
|
321
384
|
{
|
|
322
385
|
name: "contentClassName",
|
|
323
386
|
type: "string",
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Select
|
|
3
3
|
description: A dropdown select component with composable sub-components.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Select
|
|
5
|
+
- label: Radix UI Select (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/components/select
|
|
7
|
+
- label: Base UI Select (base styles)
|
|
8
|
+
url: https://base-ui.com/react/components/select
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -18,12 +20,16 @@ import {
|
|
|
18
20
|
SelectSizesSample,
|
|
19
21
|
SelectScrollableSample,
|
|
20
22
|
} from "@/components/docs/samples/select";
|
|
23
|
+
import * as SelectRadixSamples from "@/components/docs/samples/select.radix";
|
|
24
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
21
25
|
|
|
22
26
|
<Callout>
|
|
23
27
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
24
28
|
</Callout>
|
|
25
29
|
|
|
26
|
-
<
|
|
30
|
+
<FlavorSwitcher />
|
|
31
|
+
|
|
32
|
+
<Flavored radix={<SelectRadixSamples.SelectSample />} base={<SelectSample />} />
|
|
27
33
|
|
|
28
34
|
## Installation
|
|
29
35
|
|
|
@@ -60,7 +66,7 @@ export function FruitPicker() {
|
|
|
60
66
|
|
|
61
67
|
Use the `variant` prop on `SelectTrigger` to change the visual style.
|
|
62
68
|
|
|
63
|
-
<SelectVariantsSample />
|
|
69
|
+
<Flavored radix={<SelectRadixSamples.SelectVariantsSample />} base={<SelectVariantsSample />} />
|
|
64
70
|
|
|
65
71
|
```tsx
|
|
66
72
|
<SelectTrigger variant="outline" /> // Border (default)
|
|
@@ -72,7 +78,7 @@ Use the `variant` prop on `SelectTrigger` to change the visual style.
|
|
|
72
78
|
|
|
73
79
|
Use the `size` prop on `SelectTrigger` to change the height.
|
|
74
80
|
|
|
75
|
-
<SelectSizesSample />
|
|
81
|
+
<Flavored radix={<SelectRadixSamples.SelectSizesSample />} base={<SelectSizesSample />} />
|
|
76
82
|
|
|
77
83
|
```tsx
|
|
78
84
|
<SelectTrigger size="default" /> // 36px (default)
|
|
@@ -83,34 +89,34 @@ Use the `size` prop on `SelectTrigger` to change the height.
|
|
|
83
89
|
|
|
84
90
|
Long lists automatically become scrollable.
|
|
85
91
|
|
|
86
|
-
<PreviewCode file="components/docs/samples/select" name="SelectScrollableSample">
|
|
87
|
-
<SelectScrollableSample />
|
|
92
|
+
<PreviewCode file="components/docs/samples/select" name="SelectScrollableSample" base={<SelectScrollableSample />}>
|
|
93
|
+
<SelectRadixSamples.SelectScrollableSample />
|
|
88
94
|
</PreviewCode>
|
|
89
95
|
|
|
90
96
|
### Groups
|
|
91
97
|
|
|
92
98
|
Use the composable API for grouped options:
|
|
93
99
|
|
|
94
|
-
<PreviewCode file="components/docs/samples/select" name="SelectGroupsSample">
|
|
95
|
-
<SelectGroupsSample />
|
|
100
|
+
<PreviewCode file="components/docs/samples/select" name="SelectGroupsSample" base={<SelectGroupsSample />}>
|
|
101
|
+
<SelectRadixSamples.SelectGroupsSample />
|
|
96
102
|
</PreviewCode>
|
|
97
103
|
|
|
98
104
|
### Disabled Items
|
|
99
105
|
|
|
100
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledItemsSample">
|
|
101
|
-
<SelectDisabledItemsSample />
|
|
106
|
+
<PreviewCode file="components/docs/samples/select" name="SelectDisabledItemsSample" base={<SelectDisabledItemsSample />}>
|
|
107
|
+
<SelectRadixSamples.SelectDisabledItemsSample />
|
|
102
108
|
</PreviewCode>
|
|
103
109
|
|
|
104
110
|
### With Placeholder
|
|
105
111
|
|
|
106
|
-
<PreviewCode file="components/docs/samples/select" name="SelectPlaceholderSample">
|
|
107
|
-
<SelectPlaceholderSample />
|
|
112
|
+
<PreviewCode file="components/docs/samples/select" name="SelectPlaceholderSample" base={<SelectPlaceholderSample />}>
|
|
113
|
+
<SelectRadixSamples.SelectPlaceholderSample />
|
|
108
114
|
</PreviewCode>
|
|
109
115
|
|
|
110
116
|
### Disabled Select
|
|
111
117
|
|
|
112
|
-
<PreviewCode file="components/docs/samples/select" name="SelectDisabledSample">
|
|
113
|
-
<SelectDisabledSample />
|
|
118
|
+
<PreviewCode file="components/docs/samples/select" name="SelectDisabledSample" base={<SelectDisabledSample />}>
|
|
119
|
+
<SelectRadixSamples.SelectDisabledSample />
|
|
114
120
|
</PreviewCode>
|
|
115
121
|
|
|
116
122
|
## API Reference
|
|
@@ -131,6 +137,8 @@ Use the composable API for grouped options:
|
|
|
131
137
|
| `SelectScrollUpButton` | Scroll indicator for long lists. |
|
|
132
138
|
| `SelectScrollDownButton` | Scroll indicator for long lists. |
|
|
133
139
|
|
|
140
|
+
With the Base UI flavor, `SelectValue` resolves the trigger label from the `items` prop on `SelectRoot`; pass the same array you map into `SelectItem` children. The Radix flavor reads the label from the selected item's text automatically.
|
|
141
|
+
|
|
134
142
|
### Select
|
|
135
143
|
|
|
136
144
|
A convenience component that renders a complete select with options.
|
|
@@ -109,7 +109,7 @@ Root container rendered as an `<a>` tag. Accepts all `<a>` props plus `variant`
|
|
|
109
109
|
| `size` | `"sm" \| "default" \| "lg"` | `"default"` | Size of the badge |
|
|
110
110
|
| `target` | `string` | `"_blank"` | Link target |
|
|
111
111
|
| `rel` | `string` | `"noopener noreferrer"` | Link rel attribute |
|
|
112
|
-
| `asChild` | `boolean` | `false` |
|
|
112
|
+
| `asChild` | `boolean` | `false` | Merge props with a child element instead of rendering an anchor. Effective with the Radix badge; the Base UI badge ignores it |
|
|
113
113
|
| `className` | `string` | — | Additional CSS classes |
|
|
114
114
|
|
|
115
115
|
### `SourceIcon`
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
title: Tabs
|
|
3
3
|
description: A multi-variant tabs component for organizing content into switchable panels.
|
|
4
4
|
links:
|
|
5
|
-
- label: Radix UI Tabs
|
|
5
|
+
- label: Radix UI Tabs (Radix styles)
|
|
6
6
|
url: https://www.radix-ui.com/primitives/docs/components/tabs
|
|
7
|
+
- label: Base UI Tabs (base styles)
|
|
8
|
+
url: https://base-ui.com/react/components/tabs
|
|
7
9
|
platforms: ["react"]
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -17,12 +19,16 @@ import {
|
|
|
17
19
|
TabsAsLinkSample,
|
|
18
20
|
TabsAnimatedIndicatorSample,
|
|
19
21
|
} from "@/components/docs/samples/tabs";
|
|
22
|
+
import * as TabsRadixSamples from "@/components/docs/samples/tabs.radix";
|
|
23
|
+
import { Flavored, FlavorSwitcher } from "@/components/docs/contexts/flavor.server";
|
|
20
24
|
|
|
21
25
|
<Callout>
|
|
22
26
|
This is a **standalone component** that does not depend on the assistant-ui runtime. Use it anywhere in your application.
|
|
23
27
|
</Callout>
|
|
24
28
|
|
|
25
|
-
<
|
|
29
|
+
<FlavorSwitcher />
|
|
30
|
+
|
|
31
|
+
<Flavored radix={<TabsRadixSamples.TabsSample />} base={<TabsSample />} />
|
|
26
32
|
|
|
27
33
|
## Installation
|
|
28
34
|
|
|
@@ -58,7 +64,7 @@ export function Example() {
|
|
|
58
64
|
|
|
59
65
|
Use the `variant` prop on `TabsList` to change the visual style. Child components inherit the variant automatically.
|
|
60
66
|
|
|
61
|
-
<TabsVariantsSample />
|
|
67
|
+
<Flavored radix={<TabsRadixSamples.TabsVariantsSample />} base={<TabsVariantsSample />} />
|
|
62
68
|
|
|
63
69
|
```tsx
|
|
64
70
|
<TabsList variant="default" /> // Muted background with shadow (default)
|
|
@@ -72,7 +78,7 @@ Use the `variant` prop on `TabsList` to change the visual style. Child component
|
|
|
72
78
|
|
|
73
79
|
Use the `size` prop on `TabsList` to change the tab height. Child components inherit the size automatically.
|
|
74
80
|
|
|
75
|
-
<TabsSizesSample />
|
|
81
|
+
<Flavored radix={<TabsRadixSamples.TabsSizesSample />} base={<TabsSizesSample />} />
|
|
76
82
|
|
|
77
83
|
```tsx
|
|
78
84
|
<TabsList size="sm" /> // 32px height
|
|
@@ -84,24 +90,24 @@ Use the `size` prop on `TabsList` to change the tab height. Child components inh
|
|
|
84
90
|
|
|
85
91
|
Tabs automatically style SVG icons placed inside triggers.
|
|
86
92
|
|
|
87
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsWithIconsSample">
|
|
88
|
-
<TabsWithIconsSample />
|
|
93
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsWithIconsSample" base={<TabsWithIconsSample />}>
|
|
94
|
+
<TabsRadixSamples.TabsWithIconsSample />
|
|
89
95
|
</PreviewCode>
|
|
90
96
|
|
|
91
97
|
### Controlled
|
|
92
98
|
|
|
93
99
|
Use `value` and `onValueChange` for controlled tab state.
|
|
94
100
|
|
|
95
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsControlledSample">
|
|
96
|
-
<TabsControlledSample />
|
|
101
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsControlledSample" base={<TabsControlledSample />}>
|
|
102
|
+
<TabsRadixSamples.TabsControlledSample />
|
|
97
103
|
</PreviewCode>
|
|
98
104
|
|
|
99
105
|
### As Link
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
Compose with `render` (Base UI) or `asChild` (Radix) on `TabsTrigger` to render as a different element, like a navigation link.
|
|
102
108
|
|
|
103
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAsLinkSample">
|
|
104
|
-
<TabsAsLinkSample />
|
|
109
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsAsLinkSample" base={<TabsAsLinkSample />}>
|
|
110
|
+
<TabsRadixSamples.TabsAsLinkSample />
|
|
105
111
|
</PreviewCode>
|
|
106
112
|
|
|
107
113
|
### Animated Indicator
|
|
@@ -116,8 +122,8 @@ All variants feature smooth animated indicators that slide between tabs:
|
|
|
116
122
|
| `pills` | Sliding pill background |
|
|
117
123
|
| `outline` | Sliding border |
|
|
118
124
|
|
|
119
|
-
<PreviewCode file="components/docs/samples/tabs" name="TabsAnimatedIndicatorSample">
|
|
120
|
-
<TabsAnimatedIndicatorSample />
|
|
125
|
+
<PreviewCode file="components/docs/samples/tabs" name="TabsAnimatedIndicatorSample" base={<TabsAnimatedIndicatorSample />}>
|
|
126
|
+
<TabsRadixSamples.TabsAnimatedIndicatorSample />
|
|
121
127
|
</PreviewCode>
|
|
122
128
|
|
|
123
129
|
## API Reference
|
|
@@ -201,11 +207,16 @@ An individual tab button.
|
|
|
201
207
|
required: true,
|
|
202
208
|
description: "The unique value for this tab.",
|
|
203
209
|
},
|
|
210
|
+
{
|
|
211
|
+
name: "render",
|
|
212
|
+
type: "ReactElement | function",
|
|
213
|
+
description: "Base UI: compose as a different element instead of rendering a button.",
|
|
214
|
+
},
|
|
204
215
|
{
|
|
205
216
|
name: "asChild",
|
|
206
217
|
type: "boolean",
|
|
207
218
|
default: "false",
|
|
208
|
-
description: "
|
|
219
|
+
description: "Radix: merge props with a child element instead of rendering a button.",
|
|
209
220
|
},
|
|
210
221
|
{
|
|
211
222
|
name: "disabled",
|
|
@@ -20,9 +20,9 @@ import { HeatGraphDemo } from "@/app/(demos)/heat-graph/heat-graph-demo";
|
|
|
20
20
|
<Tabs items={["shadcn", "npm", "pnpm", "yarn"]}>
|
|
21
21
|
<Tab value="shadcn">
|
|
22
22
|
```sh
|
|
23
|
-
npx shadcn@latest add
|
|
23
|
+
npx shadcn@latest add @assistant-ui/heat-graph
|
|
24
24
|
```
|
|
25
|
-
This installs a pre-styled `HeatGraph` component to `components/assistant-ui/heat-graph.tsx` along with the `heat-graph` package.
|
|
25
|
+
This installs a pre-styled `HeatGraph` component to `components/assistant-ui/heat-graph.tsx` along with the `heat-graph` package. The `@assistant-ui` namespace resolves through the registry entry configured in [Manual Setup](/docs/installation#manual-setup).
|
|
26
26
|
</Tab>
|
|
27
27
|
<Tab value="npm">
|
|
28
28
|
```sh
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@assistant-ui/mcp-docs-server`
|
|
2
2
|
|
|
3
|
-
Model Context Protocol (MCP) server that gives AI assistants direct access to assistant-ui's documentation and example projects. Exposes `assistantUIDocs` (retrieve documentation by path)
|
|
3
|
+
Model Context Protocol (MCP) server that gives AI assistants direct access to assistant-ui's documentation and example projects. Exposes `assistantUIDocs` (retrieve documentation by path), `assistantUIExamples` (access complete example projects), and `assistantUISearch` (keyword search across the bundled docs), and serves the same docs and examples as readable MCP **resources** (`aui-docs:///{path}`, `aui-example:///{name}`).
|
|
4
4
|
|
|
5
5
|
> [!NOTE]
|
|
6
6
|
> Detailed installation, troubleshooting, and advanced usage at [assistant-ui.com/docs/llm#mcp](https://www.assistant-ui.com/docs/llm#mcp).
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,7 +7,8 @@ declare const CODE_EXAMPLES_PATH: string;
|
|
|
7
7
|
declare const MDX_EXTENSION = ".mdx";
|
|
8
8
|
declare const MD_EXTENSION = ".md";
|
|
9
9
|
declare const MAX_FILE_SIZE: number;
|
|
10
|
+
declare const MAX_DIRECTORY_CONTENT_SIZE: number;
|
|
10
11
|
declare const IS_PREPARE_MODE: boolean | undefined;
|
|
11
12
|
//#endregion
|
|
12
|
-
export { CODE_EXAMPLES_PATH, DOCS_PATH, EXAMPLES_PATH, IS_PREPARE_MODE, MAX_FILE_SIZE, MDX_EXTENSION, MD_EXTENSION, PACKAGE_DIR, ROOT_DIR };
|
|
13
|
+
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 };
|
|
13
14
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";cAKa
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";cAKa;cACA;cAEA;cAGA;cACA;cAEA;cACA;cAEA;cAEA;cAEA"}
|
package/dist/constants.js
CHANGED
|
@@ -11,8 +11,9 @@ const CODE_EXAMPLES_PATH = join(DOCS_BASE, "organized/code-examples");
|
|
|
11
11
|
const MDX_EXTENSION = ".mdx";
|
|
12
12
|
const MD_EXTENSION = ".md";
|
|
13
13
|
const MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
14
|
+
const MAX_DIRECTORY_CONTENT_SIZE = 1024 * 1024;
|
|
14
15
|
const IS_PREPARE_MODE = process.argv[1]?.includes("prepare-docs/prepare");
|
|
15
16
|
//#endregion
|
|
16
|
-
export { CODE_EXAMPLES_PATH, DOCS_PATH, EXAMPLES_PATH, IS_PREPARE_MODE, MAX_FILE_SIZE, MDX_EXTENSION, MD_EXTENSION, PACKAGE_DIR, ROOT_DIR };
|
|
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 };
|
|
17
18
|
|
|
18
19
|
//# sourceMappingURL=constants.js.map
|
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 IS_PREPARE_MODE = process.argv[1]?.includes(\n \"prepare-docs/prepare\",\n);\n"],"mappings":";;;AAGA,MAAM,YAAY,QAAQ,cAAc,OAAO,KAAK,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,KAAK,OAAO;AAEzC,MAAa,kBAAkB,QAAQ,KAAK,EAAE,EAAE,SAC9C,sBACF"}
|
|
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,OAAO,KAAK,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,KAAK,OAAO;AAEzC,MAAa,6BAA6B,OAAO;AAEjD,MAAa,kBAAkB,QAAQ,KAAK,EAAE,EAAE,SAC9C,sBACF"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;cAsBa,QAAM;iBAqFG,aAAS"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,10 @@ import { PACKAGE_DIR } from "./constants.js";
|
|
|
2
2
|
import { logger } from "./utils/logger.js";
|
|
3
3
|
import { docsTools } from "./tools/docs.js";
|
|
4
4
|
import { examplesTools } from "./tools/examples.js";
|
|
5
|
+
import { searchTools } from "./tools/search.js";
|
|
6
|
+
import { xuluxTemplateDetailsTool, xuluxTemplatePreviewTool, xuluxTemplatesListTool } from "./tools/xulux-templates.js";
|
|
7
|
+
import { xuluxPlaygroundPrompt } from "./prompts/xulux-playground.js";
|
|
8
|
+
import { registerResources } from "./tools/resources.js";
|
|
5
9
|
import { join } from "node:path";
|
|
6
10
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
7
11
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -30,6 +34,53 @@ server.registerTool(examplesTools.name, {
|
|
|
30
34
|
openWorldHint: false
|
|
31
35
|
}
|
|
32
36
|
}, examplesTools.execute);
|
|
37
|
+
server.registerTool(searchTools.name, {
|
|
38
|
+
title: "Search assistant-ui Documentation",
|
|
39
|
+
description: searchTools.description,
|
|
40
|
+
inputSchema: searchTools.parameters,
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: true,
|
|
43
|
+
openWorldHint: false
|
|
44
|
+
}
|
|
45
|
+
}, searchTools.execute);
|
|
46
|
+
server.registerTool(xuluxTemplatesListTool.name, {
|
|
47
|
+
title: "assistant-ui Templates",
|
|
48
|
+
description: xuluxTemplatesListTool.description,
|
|
49
|
+
inputSchema: xuluxTemplatesListTool.parameters,
|
|
50
|
+
annotations: {
|
|
51
|
+
readOnlyHint: true,
|
|
52
|
+
openWorldHint: true
|
|
53
|
+
}
|
|
54
|
+
}, xuluxTemplatesListTool.execute);
|
|
55
|
+
server.registerTool(xuluxTemplateDetailsTool.name, {
|
|
56
|
+
title: "assistant-ui Template Details",
|
|
57
|
+
description: xuluxTemplateDetailsTool.description,
|
|
58
|
+
inputSchema: xuluxTemplateDetailsTool.parameters,
|
|
59
|
+
annotations: {
|
|
60
|
+
readOnlyHint: true,
|
|
61
|
+
openWorldHint: true
|
|
62
|
+
}
|
|
63
|
+
}, xuluxTemplateDetailsTool.execute);
|
|
64
|
+
server.registerTool(xuluxTemplatePreviewTool.name, {
|
|
65
|
+
title: "assistant-ui Template Preview URLs",
|
|
66
|
+
description: xuluxTemplatePreviewTool.description,
|
|
67
|
+
inputSchema: xuluxTemplatePreviewTool.parameters,
|
|
68
|
+
annotations: {
|
|
69
|
+
readOnlyHint: false,
|
|
70
|
+
openWorldHint: true
|
|
71
|
+
}
|
|
72
|
+
}, xuluxTemplatePreviewTool.execute);
|
|
73
|
+
server.registerPrompt(xuluxPlaygroundPrompt.name, {
|
|
74
|
+
title: "assistant-ui Template Workflow",
|
|
75
|
+
description: xuluxPlaygroundPrompt.description
|
|
76
|
+
}, () => ({ messages: [{
|
|
77
|
+
role: "user",
|
|
78
|
+
content: {
|
|
79
|
+
type: "text",
|
|
80
|
+
text: xuluxPlaygroundPrompt.text
|
|
81
|
+
}
|
|
82
|
+
}] }));
|
|
83
|
+
registerResources(server);
|
|
33
84
|
async function runServer() {
|
|
34
85
|
try {
|
|
35
86
|
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.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":"
|
|
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 { 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,OAAO,KAAK,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":"code-examples.d.ts","names":[],"sources":["../../src/prepare-docs/code-examples.ts"],"mappings":";iBA2FsB,
|
|
1
|
+
{"version":3,"file":"code-examples.d.ts","names":[],"sources":["../../src/prepare-docs/code-examples.ts"],"mappings":";iBA2FsB,uBAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-raw.d.ts","names":[],"sources":["../../src/prepare-docs/copy-raw.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"copy-raw.d.ts","names":[],"sources":["../../src/prepare-docs/copy-raw.ts"],"mappings":";iBAiCsB,WAAW"}
|
|
@@ -4,7 +4,6 @@ import { extname, join } from "node:path";
|
|
|
4
4
|
import { copyFile, mkdir, readdir, rm } from "node:fs/promises";
|
|
5
5
|
//#region src/prepare-docs/copy-raw.ts
|
|
6
6
|
const DOCS_SOURCE = join(ROOT_DIR, "apps/docs/content/docs");
|
|
7
|
-
const BLOG_SOURCE = join(ROOT_DIR, "apps/docs/content/blog");
|
|
8
7
|
const DOCS_DEST = join(ROOT_DIR, "packages/mcp-docs-server/.docs/raw");
|
|
9
8
|
async function copyDir(src, dest) {
|
|
10
9
|
try {
|
|
@@ -38,9 +37,6 @@ async function copyRaw() {
|
|
|
38
37
|
const docsPath = join(DOCS_DEST, "docs");
|
|
39
38
|
await copyDir(DOCS_SOURCE, docsPath);
|
|
40
39
|
logger.info(`Copied documentation to ${docsPath}`);
|
|
41
|
-
const blogPath = join(DOCS_DEST, "blog");
|
|
42
|
-
await copyDir(BLOG_SOURCE, blogPath);
|
|
43
|
-
logger.info(`Copied blog posts to ${blogPath}`);
|
|
44
40
|
logger.info("Raw documentation copy complete");
|
|
45
41
|
} catch (error) {
|
|
46
42
|
logger.error("Failed to copy raw documentation", error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-raw.js","names":[],"sources":["../../src/prepare-docs/copy-raw.ts"],"sourcesContent":["import { rm, mkdir, readdir, copyFile } from \"node:fs/promises\";\nimport { join, extname } from \"node:path\";\nimport { logger } from \"../utils/logger.js\";\nimport { ROOT_DIR } from \"../constants.js\";\n\nconst DOCS_SOURCE = join(ROOT_DIR, \"apps/docs/content/docs\");\nconst
|
|
1
|
+
{"version":3,"file":"copy-raw.js","names":[],"sources":["../../src/prepare-docs/copy-raw.ts"],"sourcesContent":["import { rm, mkdir, readdir, copyFile } from \"node:fs/promises\";\nimport { join, extname } from \"node:path\";\nimport { logger } from \"../utils/logger.js\";\nimport { ROOT_DIR } from \"../constants.js\";\n\nconst DOCS_SOURCE = join(ROOT_DIR, \"apps/docs/content/docs\");\nconst DOCS_DEST = join(ROOT_DIR, \"packages/mcp-docs-server/.docs/raw\");\n\nasync function copyDir(src: string, dest: string): Promise<void> {\n try {\n await mkdir(dest, { recursive: true });\n const entries = await readdir(src, { withFileTypes: true });\n\n for (const entry of entries) {\n const srcPath = join(src, entry.name);\n const destPath = join(dest, entry.name);\n\n if (entry.isDirectory()) {\n await copyDir(srcPath, destPath);\n } else if (entry.isFile()) {\n const ext = extname(entry.name).toLowerCase();\n if (ext === \".mdx\" || ext === \".md\") {\n await copyFile(srcPath, destPath);\n logger.debug(`Copied: ${srcPath} -> ${destPath}`);\n }\n }\n }\n } catch (error) {\n logger.error(`Failed to copy directory: ${src}`, error);\n throw error;\n }\n}\n\nexport async function copyRaw(): Promise<void> {\n logger.info(\"Copying raw documentation files...\");\n\n try {\n await rm(DOCS_DEST, { recursive: true, force: true });\n await mkdir(DOCS_DEST, { recursive: true });\n\n const docsPath = join(DOCS_DEST, \"docs\");\n await copyDir(DOCS_SOURCE, docsPath);\n logger.info(`Copied documentation to ${docsPath}`);\n\n logger.info(\"Raw documentation copy complete\");\n } catch (error) {\n logger.error(\"Failed to copy raw documentation\", error);\n throw error;\n }\n}\n"],"mappings":";;;;;AAKA,MAAM,cAAc,KAAK,UAAU,wBAAwB;AAC3D,MAAM,YAAY,KAAK,UAAU,oCAAoC;AAErE,eAAe,QAAQ,KAAa,MAA6B;CAC/D,IAAI;EACF,MAAM,MAAM,MAAM,EAAE,WAAW,KAAK,CAAC;EACrC,MAAM,UAAU,MAAM,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;EAE1D,KAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,UAAU,KAAK,KAAK,MAAM,IAAI;GACpC,MAAM,WAAW,KAAK,MAAM,MAAM,IAAI;GAEtC,IAAI,MAAM,YAAY,GACpB,MAAM,QAAQ,SAAS,QAAQ;QAC1B,IAAI,MAAM,OAAO,GAAG;IACzB,MAAM,MAAM,QAAQ,MAAM,IAAI,CAAC,CAAC,YAAY;IAC5C,IAAI,QAAQ,UAAU,QAAQ,OAAO;KACnC,MAAM,SAAS,SAAS,QAAQ;KAChC,OAAO,MAAM,WAAW,QAAQ,MAAM,UAAU;IAClD;GACF;EACF;CACF,SAAS,OAAO;EACd,OAAO,MAAM,6BAA6B,OAAO,KAAK;EACtD,MAAM;CACR;AACF;AAEA,eAAsB,UAAyB;CAC7C,OAAO,KAAK,oCAAoC;CAEhD,IAAI;EACF,MAAM,GAAG,WAAW;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EACpD,MAAM,MAAM,WAAW,EAAE,WAAW,KAAK,CAAC;EAE1C,MAAM,WAAW,KAAK,WAAW,MAAM;EACvC,MAAM,QAAQ,aAAa,QAAQ;EACnC,OAAO,KAAK,2BAA2B,UAAU;EAEjD,OAAO,KAAK,iCAAiC;CAC/C,SAAS,OAAO;EACd,OAAO,MAAM,oCAAoC,KAAK;EACtD,MAAM;CACR;AACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/prompts/xulux-playground.d.ts
|
|
2
|
+
declare const XULUX_PLAYGROUND_PROMPT_NAME = "assistant-ui-template-workflow";
|
|
3
|
+
declare const XULUX_PLAYGROUND_PROMPT_DESCRIPTION = "How to use the assistant-ui template tools to discover hosted templates, inspect their customization contracts, and retrieve preview/download URLs.";
|
|
4
|
+
declare const XULUX_PLAYGROUND_PROMPT = "You have access to assistant-ui template tools for hosted app templates.\n\n<workflow>\nFollow this template-first workflow for any assistant-ui app-building request:\n\n1. Call **assistantUITemplates** FIRST. Never decide on a template or claim one exists without listing.\n2. Call **assistantUITemplateDetails** on any candidate template before deciding whether it fits.\n - Review the whole template shape: features, assistantPlacement, configRoots schemas, rules, built-in tools, renderers, and exampleConfig.\n - If `customizable` is empty, the entry is a fixed demo. Use it as-is; never pass a config for it.\n3. Decide one of three paths:\n - The template fits as-is: call **assistantUITemplatePreview** with templateId and optional versionId.\n - The template fits with supported customization: author a config using the configRoots schemas and rules from assistantUITemplateDetails, then call **assistantUITemplatePreview** with that config.\n - No template fits: do NOT call assistantUITemplatePreview. Do not force the request into a template or fake domain content with mock config. Instead, ground yourself in the assistant-ui docs (assistantUIDocs, assistantUISearch, assistantUIExamples) and produce an honest, docs-grounded build guide or prompt for the user.\n</workflow>\n\n<important_constraints>\n- Only use URLs copied exactly from tool results. Never guess, fabricate, or use placeholder URLs.\n- If assistantUITemplatePreview returns validationWarnings or an error, call assistantUITemplateDetails again and correct the config against configRoots. Pass only the documented top-level config roots.\n- Customization is for supported adaptation within a template's shape, not for turning it into a completely different kind of product.\n- Responses may include `catalogDegraded: true` when the live template catalog is unreachable. In that mode, template details and preview URLs may be unavailable; tell the user rather than improvising.\n</important_constraints>";
|
|
5
|
+
declare const xuluxPlaygroundPrompt: {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { XULUX_PLAYGROUND_PROMPT, XULUX_PLAYGROUND_PROMPT_DESCRIPTION, XULUX_PLAYGROUND_PROMPT_NAME, xuluxPlaygroundPrompt };
|
|
12
|
+
//# sourceMappingURL=xulux-playground.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xulux-playground.d.ts","names":[],"sources":["../../src/prompts/xulux-playground.ts"],"mappings":";cAIa;cAEA;cAGA;cAsBA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/prompts/xulux-playground.ts
|
|
2
|
+
const XULUX_PLAYGROUND_PROMPT_NAME = "assistant-ui-template-workflow";
|
|
3
|
+
const XULUX_PLAYGROUND_PROMPT_DESCRIPTION = "How to use the assistant-ui template tools to discover hosted templates, inspect their customization contracts, and retrieve preview/download URLs.";
|
|
4
|
+
const XULUX_PLAYGROUND_PROMPT = `You have access to assistant-ui template tools for hosted app templates.
|
|
5
|
+
|
|
6
|
+
<workflow>
|
|
7
|
+
Follow this template-first workflow for any assistant-ui app-building request:
|
|
8
|
+
|
|
9
|
+
1. Call **assistantUITemplates** FIRST. Never decide on a template or claim one exists without listing.
|
|
10
|
+
2. Call **assistantUITemplateDetails** on any candidate template before deciding whether it fits.
|
|
11
|
+
- Review the whole template shape: features, assistantPlacement, configRoots schemas, rules, built-in tools, renderers, and exampleConfig.
|
|
12
|
+
- If \`customizable\` is empty, the entry is a fixed demo. Use it as-is; never pass a config for it.
|
|
13
|
+
3. Decide one of three paths:
|
|
14
|
+
- The template fits as-is: call **assistantUITemplatePreview** with templateId and optional versionId.
|
|
15
|
+
- The template fits with supported customization: author a config using the configRoots schemas and rules from assistantUITemplateDetails, then call **assistantUITemplatePreview** with that config.
|
|
16
|
+
- No template fits: do NOT call assistantUITemplatePreview. Do not force the request into a template or fake domain content with mock config. Instead, ground yourself in the assistant-ui docs (assistantUIDocs, assistantUISearch, assistantUIExamples) and produce an honest, docs-grounded build guide or prompt for the user.
|
|
17
|
+
</workflow>
|
|
18
|
+
|
|
19
|
+
<important_constraints>
|
|
20
|
+
- Only use URLs copied exactly from tool results. Never guess, fabricate, or use placeholder URLs.
|
|
21
|
+
- If assistantUITemplatePreview returns validationWarnings or an error, call assistantUITemplateDetails again and correct the config against configRoots. Pass only the documented top-level config roots.
|
|
22
|
+
- Customization is for supported adaptation within a template's shape, not for turning it into a completely different kind of product.
|
|
23
|
+
- Responses may include \`catalogDegraded: true\` when the live template catalog is unreachable. In that mode, template details and preview URLs may be unavailable; tell the user rather than improvising.
|
|
24
|
+
</important_constraints>`;
|
|
25
|
+
const xuluxPlaygroundPrompt = {
|
|
26
|
+
name: XULUX_PLAYGROUND_PROMPT_NAME,
|
|
27
|
+
description: XULUX_PLAYGROUND_PROMPT_DESCRIPTION,
|
|
28
|
+
text: XULUX_PLAYGROUND_PROMPT
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { XULUX_PLAYGROUND_PROMPT, XULUX_PLAYGROUND_PROMPT_DESCRIPTION, XULUX_PLAYGROUND_PROMPT_NAME, xuluxPlaygroundPrompt };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=xulux-playground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xulux-playground.js","names":[],"sources":["../../src/prompts/xulux-playground.ts"],"sourcesContent":["// Skill-style MCP prompt teaching agents the assistant-ui template workflow.\n// Adapted for MCP clients: tools return URLs and data only; there is no\n// browser canvas UI here.\n\nexport const XULUX_PLAYGROUND_PROMPT_NAME = \"assistant-ui-template-workflow\";\n\nexport const XULUX_PLAYGROUND_PROMPT_DESCRIPTION =\n \"How to use the assistant-ui template tools to discover hosted templates, inspect their customization contracts, and retrieve preview/download URLs.\";\n\nexport const XULUX_PLAYGROUND_PROMPT = `You have access to assistant-ui template tools for hosted app templates.\n\n<workflow>\nFollow this template-first workflow for any assistant-ui app-building request:\n\n1. Call **assistantUITemplates** FIRST. Never decide on a template or claim one exists without listing.\n2. Call **assistantUITemplateDetails** on any candidate template before deciding whether it fits.\n - Review the whole template shape: features, assistantPlacement, configRoots schemas, rules, built-in tools, renderers, and exampleConfig.\n - If \\`customizable\\` is empty, the entry is a fixed demo. Use it as-is; never pass a config for it.\n3. Decide one of three paths:\n - The template fits as-is: call **assistantUITemplatePreview** with templateId and optional versionId.\n - The template fits with supported customization: author a config using the configRoots schemas and rules from assistantUITemplateDetails, then call **assistantUITemplatePreview** with that config.\n - No template fits: do NOT call assistantUITemplatePreview. Do not force the request into a template or fake domain content with mock config. Instead, ground yourself in the assistant-ui docs (assistantUIDocs, assistantUISearch, assistantUIExamples) and produce an honest, docs-grounded build guide or prompt for the user.\n</workflow>\n\n<important_constraints>\n- Only use URLs copied exactly from tool results. Never guess, fabricate, or use placeholder URLs.\n- If assistantUITemplatePreview returns validationWarnings or an error, call assistantUITemplateDetails again and correct the config against configRoots. Pass only the documented top-level config roots.\n- Customization is for supported adaptation within a template's shape, not for turning it into a completely different kind of product.\n- Responses may include \\`catalogDegraded: true\\` when the live template catalog is unreachable. In that mode, template details and preview URLs may be unavailable; tell the user rather than improvising.\n</important_constraints>`;\n\nexport const xuluxPlaygroundPrompt = {\n name: XULUX_PLAYGROUND_PROMPT_NAME,\n description: XULUX_PLAYGROUND_PROMPT_DESCRIPTION,\n text: XULUX_PLAYGROUND_PROMPT,\n};\n"],"mappings":";AAIA,MAAa,+BAA+B;AAE5C,MAAa,sCACX;AAEF,MAAa,0BAA0B;;;;;;;;;;;;;;;;;;;;;AAsBvC,MAAa,wBAAwB;CACnC,MAAM;CACN,aAAa;CACb,MAAM;AACR"}
|