@assistant-ui/mcp-docs-server 0.1.38 → 0.2.0
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 +11 -12
- package/.docs/organized/code-examples/with-a2a.md +18 -13
- package/.docs/organized/code-examples/with-ag-ui.md +19 -14
- package/.docs/organized/code-examples/{with-ai-sdk-v6.md → with-ai-sdk-v7.md} +34 -23
- package/.docs/organized/code-examples/with-artifacts.md +473 -141
- package/.docs/organized/code-examples/with-assistant-transport.md +17 -10
- package/.docs/organized/code-examples/with-browser-extension.md +17 -10
- package/.docs/organized/code-examples/with-chain-of-thought.md +21 -14
- package/.docs/organized/code-examples/with-cloud-standalone.md +12 -11
- package/.docs/organized/code-examples/with-cloud.md +20 -15
- package/.docs/organized/code-examples/with-custom-thread-list.md +19 -12
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +22 -15
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +22 -15
- package/.docs/organized/code-examples/with-eve.md +18 -11
- package/.docs/organized/code-examples/with-expo.md +35 -52
- package/.docs/organized/code-examples/with-external-store.md +18 -13
- package/.docs/organized/code-examples/with-ffmpeg.md +20 -15
- package/.docs/organized/code-examples/with-generative-ui.md +22 -17
- package/.docs/organized/code-examples/with-google-adk.md +18 -11
- package/.docs/organized/code-examples/with-heat-graph.md +10 -11
- package/.docs/organized/code-examples/with-image-generation.md +19 -12
- package/.docs/organized/code-examples/with-interactables.md +21 -17
- package/.docs/organized/code-examples/with-langchain.md +19 -12
- package/.docs/organized/code-examples/with-langgraph.md +19 -12
- package/.docs/organized/code-examples/with-livekit.md +23 -16
- package/.docs/organized/code-examples/with-mcp.md +46 -28
- package/.docs/organized/code-examples/with-opencode.md +25 -23
- package/.docs/organized/code-examples/with-pi.md +54 -19
- package/.docs/organized/code-examples/with-react-hook-form.md +21 -16
- package/.docs/organized/code-examples/with-react-ink-web.md +9 -9
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +22 -17
- package/.docs/organized/code-examples/with-resumable-stream.md +21 -14
- package/.docs/organized/code-examples/with-store.md +10 -11
- package/.docs/organized/code-examples/with-tanstack.md +19 -13
- package/.docs/organized/code-examples/with-tap-runtime.md +18 -13
- package/.docs/organized/code-examples/with-virtualized-thread.md +19 -14
- package/.docs/raw/docs/(docs)/base-ui.mdx +39 -0
- package/.docs/raw/docs/(docs)/cli.mdx +19 -1
- package/.docs/raw/docs/(docs)/devtools.mdx +7 -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/a2ui.mdx +40 -0
- 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 +22 -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/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/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +25 -2
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +37 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +1 -9
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +14 -31
- 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/copilots/model-context.mdx +1 -1
- package/.docs/raw/docs/copilots/motivation.mdx +1 -1
- package/.docs/raw/docs/guides/attachments.mdx +3 -3
- package/.docs/raw/docs/guides/branching.mdx +2 -2
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +108 -0
- package/.docs/raw/docs/guides/context-api.mdx +89 -111
- package/.docs/raw/docs/guides/dictation.mdx +185 -257
- 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 +20 -0
- package/.docs/raw/docs/guides/mentions.mdx +31 -3
- 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 +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/hooks.mdx +3 -3
- package/.docs/raw/docs/ink/primitives.mdx +49 -8
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +2 -2
- package/.docs/raw/docs/integrations/auth/clerk.mdx +2 -2
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +10 -4
- 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/observability/helicone.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +2 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +36 -9
- package/.docs/raw/docs/migrations/index.mdx +50 -0
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +4 -2
- package/.docs/raw/docs/migrations/v0-15.mdx +156 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +6 -1
- package/.docs/raw/docs/primitives/composer.mdx +17 -1
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +25 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +2 -2
- package/.docs/raw/docs/react-native/hooks.mdx +3 -3
- package/.docs/raw/docs/react-native/index.mdx +2 -2
- package/.docs/raw/docs/react-native/primitives.mdx +62 -5
- package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +124 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +10 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +14 -5
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +15 -15
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +8 -8
- package/.docs/raw/docs/runtimes/ai-sdk/{v6.mdx → v6-legacy.mdx} +11 -9
- 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/concepts/threads.mdx +10 -10
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +2 -2
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +10 -19
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -2
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +5 -3
- package/.docs/raw/docs/runtimes/eve/overview.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/langgraph/overview.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +3 -1
- package/.docs/raw/docs/tools/a2ui.mdx +107 -0
- package/.docs/raw/docs/tools/backend.mdx +6 -3
- package/.docs/raw/docs/tools/defining-tools.mdx +7 -1
- package/.docs/raw/docs/tools/generative-ui.mdx +60 -2
- package/.docs/raw/docs/tools/interactables-legacy.mdx +4 -4
- package/.docs/raw/docs/tools/interactables.mdx +3 -3
- package/.docs/raw/docs/tools/mcp-apps.mdx +90 -13
- package/.docs/raw/docs/tools/mcp.mdx +100 -3
- package/.docs/raw/docs/tools/tool-ui.mdx +6 -4
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +77 -9
- 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 +4 -2
- package/.docs/raw/docs/ui/model-selector.mdx +33 -3
- package/.docs/raw/docs/ui/part-grouping.mdx +0 -4
- package/.docs/raw/docs/ui/reasoning.mdx +1 -1
- 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/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -2
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +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/stdio.d.ts +1 -1
- package/dist/tools/docs.d.ts +8 -14
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +26 -10
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +6 -12
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +11 -8
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/resources.d.ts +1 -2
- package/dist/tools/resources.d.ts.map +1 -1
- package/dist/tools/resources.js +1 -1
- package/dist/tools/resources.js.map +1 -1
- package/dist/tools/search.d.ts +6 -15
- 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 +5 -1
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/tools/xulux-templates.d.ts +58 -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.map +1 -1
- package/dist/utils/paths.d.ts +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +3 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/search.d.ts.map +1 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js.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 +7 -6
- package/src/index.ts +55 -2
- package/src/prompts/xulux-playground.ts +36 -0
- package/src/tools/docs.ts +27 -5
- package/src/tools/examples.ts +17 -12
- 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 +20 -0
- package/src/tools/tests/examples.test.ts +5 -5
- package/src/tools/tests/integration.test.ts +3 -4
- package/src/tools/tests/listings-cache.test.ts +19 -0
- package/src/tools/tests/mcp-protocol.test.ts +173 -108
- package/src/tools/tests/mcp-test-client.ts +111 -0
- package/src/tools/tests/resources.test.ts +97 -66
- package/src/tools/tests/test-setup.ts +8 -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/paths.ts +4 -1
- 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/docs/(reference)/api-reference/hooks/utilities.mdx +0 -464
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@assistant-ui/react-data-stream"
|
|
3
|
+
description: Data stream runtime hook and message conversion utilities for custom assistant-ui streaming backends.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { reactDataStream_toLanguageModelMessages, reactDataStream_useCloudRuntime, reactDataStream_useDataStreamRuntime } from "@/generated/integrationTypeDocs";
|
|
7
|
+
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
10
|
+
|
|
11
|
+
{/* api-reference:start */}
|
|
12
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
13
|
+
{/* Do not edit this block manually. */}
|
|
14
|
+
|
|
15
|
+
## API Reference
|
|
16
|
+
|
|
17
|
+
### useDataStreamRuntime
|
|
18
|
+
|
|
19
|
+
<ParametersTable {...reactDataStream_useDataStreamRuntime} />
|
|
20
|
+
|
|
21
|
+
### toLanguageModelMessages
|
|
22
|
+
|
|
23
|
+
<Callout type="warn">
|
|
24
|
+
<strong>Deprecated.</strong> Use `toGenericMessages` from `assistant-stream` for framework-agnostic conversion.
|
|
25
|
+
This function is kept for AI SDK compatibility.
|
|
26
|
+
</Callout>
|
|
27
|
+
|
|
28
|
+
<ParametersTable {...reactDataStream_toLanguageModelMessages} />
|
|
29
|
+
|
|
30
|
+
### useCloudRuntime
|
|
31
|
+
|
|
32
|
+
<Callout type="warn">
|
|
33
|
+
<strong>Deprecated.</strong> This is under active development and not yet ready for prod use.
|
|
34
|
+
</Callout>
|
|
35
|
+
|
|
36
|
+
<ParametersTable {...reactDataStream_useCloudRuntime} />
|
|
37
|
+
{/* api-reference:end */}
|
|
@@ -3,7 +3,7 @@ title: Model Context
|
|
|
3
3
|
description: Provide model instructions, contextual state, and inline renderers to assistant-ui runtimes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { ModelContextProvider, useAssistantContext, useAssistantInstructions, useInlineRender
|
|
6
|
+
import { ModelContextProvider, useAssistantContext, useAssistantInstructions, useInlineRender } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
8
|
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
9
|
{/* Do not edit manually. */}
|
|
@@ -47,12 +47,4 @@ const ModelContextClient: Resource<ClientOutput<"modelContext">, []>;
|
|
|
47
47
|
### useInlineRender
|
|
48
48
|
|
|
49
49
|
<ParametersTable {...useInlineRender} />
|
|
50
|
-
|
|
51
|
-
### useThreadModelContext
|
|
52
|
-
|
|
53
|
-
<Callout type="warn">
|
|
54
|
-
<strong>Deprecated.</strong> Use [useAuiState](/docs/api-reference/hooks/state#useauistate): `useAuiState((s) => s.thread.modelContext)`. See the [migration guide](https://assistant-ui.com/docs/migrations/v0-12).
|
|
55
|
-
</Callout>
|
|
56
|
-
|
|
57
|
-
<ParametersTable {...useThreadModelContext} />
|
|
58
50
|
{/* api-reference:end */}
|
|
@@ -3,6 +3,7 @@ title: API Reference
|
|
|
3
3
|
description: Complete assistant-ui React API reference for building AI chat UIs with primitives, hooks, runtimes, adapters, tools, transport, voice, and integrations.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
{/* api-reference:skip-auto-generation */}
|
|
6
7
|
|
|
7
8
|
import { Component, ContextLevel } from "./context";
|
|
8
9
|
|
|
@@ -3,10 +3,12 @@ title: AuiIf
|
|
|
3
3
|
description: Conditional rendering primitive for showing React UI from assistant-ui thread, message, composer, and runtime state.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
{
|
|
6
|
+
import { AuiIf } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
|
-
{/* api-
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
9
10
|
|
|
11
|
+
{/* api-manual:start */}
|
|
10
12
|
## Anatomy
|
|
11
13
|
|
|
12
14
|
```tsx
|
|
@@ -21,26 +23,6 @@ import { AuiIf } from "@assistant-ui/react";
|
|
|
21
23
|
|
|
22
24
|
`AuiIf` is a generic conditional rendering component that provides access to the full assistant state. It replaces the deprecated `ThreadPrimitive.If`, `MessagePrimitive.If`, and `ComposerPrimitive.If` components with a single, flexible API.
|
|
23
25
|
|
|
24
|
-
## API Reference
|
|
25
|
-
|
|
26
|
-
<ParametersTable
|
|
27
|
-
type="AuiIfProps"
|
|
28
|
-
parameters={[
|
|
29
|
-
{
|
|
30
|
-
name: "condition",
|
|
31
|
-
type: "(state: AssistantState) => boolean",
|
|
32
|
-
required: true,
|
|
33
|
-
description:
|
|
34
|
-
"A function that receives the assistant state and returns whether to render children.",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "children",
|
|
38
|
-
type: "ReactNode",
|
|
39
|
-
description: "Content to render when the condition returns true.",
|
|
40
|
-
},
|
|
41
|
-
]}
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
26
|
## AssistantState
|
|
45
27
|
|
|
46
28
|
The condition function receives an `AssistantState` object with the following properties:
|
|
@@ -210,16 +192,17 @@ const isThreadEmpty: AuiIf.Condition = (s) => s.thread.isEmpty;
|
|
|
210
192
|
| `<MessagePrimitive.If speaking>` | `<AuiIf condition={(s) => s.message.speech != null}>` |
|
|
211
193
|
| `<MessagePrimitive.If last>` | `<AuiIf condition={(s) => s.message.isLast}>` |
|
|
212
194
|
| `<ComposerPrimitive.If editing>` | `<AuiIf condition={(s) => s.composer.isEditing}>` |
|
|
195
|
+
{/* api-manual:end */}
|
|
213
196
|
|
|
214
|
-
|
|
197
|
+
{/* api-reference:start */}
|
|
198
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
199
|
+
{/* Do not edit this block manually. */}
|
|
215
200
|
|
|
216
|
-
|
|
217
|
-
<strong>Deprecated:</strong> Use `AuiIf` instead. This alias was removed in
|
|
218
|
-
v0.13.
|
|
219
|
-
</Callout>
|
|
201
|
+
## API Reference
|
|
220
202
|
|
|
221
|
-
|
|
222
|
-
import { AssistantIf } from "@assistant-ui/react";
|
|
223
|
-
```
|
|
203
|
+
### AuiIf
|
|
224
204
|
|
|
225
|
-
|
|
205
|
+
Renders `children` while `condition` selects `true` from the assistant state.
|
|
206
|
+
|
|
207
|
+
<ParametersTable {...AuiIf} />
|
|
208
|
+
{/* api-reference:end */}
|
|
@@ -3,6 +3,7 @@ title: Composition
|
|
|
3
3
|
description: How to compose primitives with custom components using asChild.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
{/* api-reference:skip-auto-generation */}
|
|
6
7
|
|
|
7
8
|
`assistant-ui` primitives are composable. This means that all props are forwarded, classes are merged, and event handlers are chained.
|
|
8
9
|
|
|
@@ -37,6 +37,9 @@ Primitives are the low-level React components behind assistant-ui interfaces. Th
|
|
|
37
37
|
<Card title={"ComposerPrimitive"} href={"/docs/api-reference/primitives/composer"}>
|
|
38
38
|
{"Composable input primitives for assistant-ui prompts, send controls, cancellation, attachments, and composer state."}
|
|
39
39
|
</Card>
|
|
40
|
+
<Card title={"Composition"} href={"/docs/api-reference/primitives/composition"}>
|
|
41
|
+
{"How to compose primitives with custom components using asChild."}
|
|
42
|
+
</Card>
|
|
40
43
|
<Card title={"ErrorPrimitive"} href={"/docs/api-reference/primitives/error"}>
|
|
41
44
|
{"Error primitives for rendering assistant-ui runtime, thread, and message failures inside custom chat interfaces."}
|
|
42
45
|
</Card>
|
|
@@ -32,6 +32,8 @@ Place this component inside `ThreadPrimitive.Root`:
|
|
|
32
32
|
<FloatingSelectionToolbar />
|
|
33
33
|
</ThreadPrimitive.Root>
|
|
34
34
|
```
|
|
35
|
+
|
|
36
|
+
To prevent tool cards or other message UI from being quoted, wrap the message text in `data-aui-quote-selectable`. If a message contains that marker, the toolbar only appears for selections inside the same marked region. Set the attribute to `"false"` to exclude an element instead; on the message root it disables quoting for the whole message.
|
|
35
37
|
{/* api-manual:end */}
|
|
36
38
|
|
|
37
39
|
{/* api-reference:start */}
|
|
@@ -27,18 +27,18 @@ optional model-output conversion.
|
|
|
27
27
|
|
|
28
28
|
This helper keeps reusable tool definitions type-checked and convenient to
|
|
29
29
|
export for a [Toolkit](/docs/api-reference/tools/toolkits#toolkit) registered with [Tools](/docs/api-reference/tools/toolkits#tools).
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
When `parameters` is a Standard Schema (for example Zod v4), its input type
|
|
31
|
+
is inferred for `execute`, `streamCall`, and model-output callbacks. Plain
|
|
32
|
+
JSON Schema objects do not carry TypeScript input types, so provide generic
|
|
33
|
+
arguments or annotate callbacks when you need precise args for JSON Schema.
|
|
32
34
|
|
|
33
35
|
```ts
|
|
34
|
-
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
|
|
38
|
+
const getWeather = tool({
|
|
35
39
|
type: "frontend",
|
|
36
40
|
description: "Get the weather for a city.",
|
|
37
|
-
parameters: {
|
|
38
|
-
type: "object",
|
|
39
|
-
properties: { city: { type: "string" } },
|
|
40
|
-
required: ["city"],
|
|
41
|
-
},
|
|
41
|
+
parameters: z.object({ city: z.string() }),
|
|
42
42
|
execute: async ({ city }) => `Sunny in ${city}`,
|
|
43
43
|
});
|
|
44
44
|
```
|
|
@@ -84,7 +84,10 @@ type Toolkit = Record<string, ToolDefinition<any, any>>;
|
|
|
84
84
|
|
|
85
85
|
### defineMcpToolkit
|
|
86
86
|
|
|
87
|
-
Defines MCP server tools as a spreadable toolkit fragment.
|
|
87
|
+
Defines MCP server tools as a spreadable toolkit fragment. Pass a raw
|
|
88
|
+
`McpServerConfig` for always-on servers, or `{ server, disabled, tools }`
|
|
89
|
+
when a server should stay configured but not expose all tools for the current
|
|
90
|
+
request.
|
|
88
91
|
|
|
89
92
|
<ParametersTable {...defineMcpToolkit} />
|
|
90
93
|
|
|
@@ -63,6 +63,10 @@ Takes the current part state and a `smooth` argument: `false` disables,
|
|
|
63
63
|
the reveal. Returns the part state with `text` replaced by the revealed
|
|
64
64
|
prefix and `status` reporting `running` until the reveal catches up.
|
|
65
65
|
|
|
66
|
+
The reveal auto-disables under `prefers-reduced-motion: reduce`,
|
|
67
|
+
committing the full text immediately; this takes precedence over an
|
|
68
|
+
explicit `smooth={true}`.
|
|
69
|
+
|
|
66
70
|
```tsx
|
|
67
71
|
const { text, status } = useSmooth(useMessagePartText(), {
|
|
68
72
|
drainMs: 500,
|
|
@@ -340,7 +340,7 @@ export function Chat() {
|
|
|
340
340
|
name: "history",
|
|
341
341
|
type: "ThreadHistoryAdapter",
|
|
342
342
|
description:
|
|
343
|
-
"Adapter for loading and saving thread history. Used to restore previous messages when switching threads. The adapter must implement `withFormat` when used with AI SDK — see [Persisting Chat History](/docs/runtimes/ai-sdk/
|
|
343
|
+
"Adapter for loading and saving thread history. Used to restore previous messages when switching threads. The adapter must implement `withFormat` when used with AI SDK — see [Persisting Chat History](/docs/runtimes/ai-sdk/v7#persisting-chat-history).",
|
|
344
344
|
},
|
|
345
345
|
],
|
|
346
346
|
},
|
|
@@ -358,6 +358,12 @@ export function Chat() {
|
|
|
358
358
|
description:
|
|
359
359
|
"Custom transport implementation. Defaults to AssistantChatTransport which sends requests to '/api/chat'.",
|
|
360
360
|
},
|
|
361
|
+
{
|
|
362
|
+
name: "onResumeError",
|
|
363
|
+
type: "(error: unknown) => void",
|
|
364
|
+
description:
|
|
365
|
+
"Optional callback when useChatRuntime finds a pending resumable stream id but the automatic reconnect fails. Use it for a toast, telemetry, or retry UI; the stale stream id is still cleared.",
|
|
366
|
+
},
|
|
361
367
|
]}
|
|
362
368
|
/>
|
|
363
369
|
|
|
@@ -6,7 +6,7 @@ description: Integrate cloud persistence and thread management with LangGraph Cl
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
This guide shows how to integrate Assistant Cloud with [LangGraph Cloud](https://langchain
|
|
9
|
+
This guide shows how to integrate Assistant Cloud with [LangGraph Cloud](https://docs.langchain.com/langsmith/deploy-to-cloud-overview) using assistant-ui's runtime system and pre-built UI components.
|
|
10
10
|
|
|
11
11
|
## Prerequisites
|
|
12
12
|
|
|
@@ -410,9 +410,11 @@ npx assistant-ui@latest add thread-list
|
|
|
410
410
|
<Tab>
|
|
411
411
|
|
|
412
412
|
```sh
|
|
413
|
-
npx shadcn@latest add
|
|
413
|
+
npx shadcn@latest add @assistant-ui/thread-list
|
|
414
414
|
```
|
|
415
415
|
|
|
416
|
+
The `@assistant-ui` namespace resolves through the registry entry configured in [Manual Setup](/docs/installation#manual-setup).
|
|
417
|
+
|
|
416
418
|
</Tab>
|
|
417
419
|
<Tab>
|
|
418
420
|
|
|
@@ -112,7 +112,7 @@ function MyComponent() {
|
|
|
112
112
|
|
|
113
113
|
useEffect(() => {
|
|
114
114
|
// Register context provider
|
|
115
|
-
return aui.modelContext
|
|
115
|
+
return aui.modelContext.register({
|
|
116
116
|
getModelContext: () => ({
|
|
117
117
|
system: "You are a helpful search assistant...",
|
|
118
118
|
tools: { myTool },
|
|
@@ -158,7 +158,7 @@ function SmartTransactionHistory({ userProfile }) {
|
|
|
158
158
|
const aui = useAui();
|
|
159
159
|
|
|
160
160
|
useEffect(() => {
|
|
161
|
-
return aui.modelContext
|
|
161
|
+
return aui.modelContext.register({
|
|
162
162
|
getModelContext: () => ({
|
|
163
163
|
system: `
|
|
164
164
|
User spending patterns:
|
|
@@ -503,14 +503,14 @@ Add attachments from external sources (URLs, API data, CMS references) without n
|
|
|
503
503
|
const aui = useAui();
|
|
504
504
|
|
|
505
505
|
// Add an attachment from an external source
|
|
506
|
-
await aui.composer
|
|
506
|
+
await aui.composer.addAttachment({
|
|
507
507
|
name: "report.pdf",
|
|
508
508
|
contentType: "application/pdf",
|
|
509
509
|
content: [{ type: "text", text: "Extracted document content..." }],
|
|
510
510
|
});
|
|
511
511
|
|
|
512
512
|
// Optionally provide id and type
|
|
513
|
-
await aui.composer
|
|
513
|
+
await aui.composer.addAttachment({
|
|
514
514
|
id: "cms-doc-123",
|
|
515
515
|
type: "document",
|
|
516
516
|
name: "Product Spec",
|
|
@@ -532,7 +532,7 @@ const handleMultipleFiles = async (files: FileList) => {
|
|
|
532
532
|
const filesToAdd = Array.from(files).slice(0, maxFiles);
|
|
533
533
|
|
|
534
534
|
for (const file of filesToAdd) {
|
|
535
|
-
await aui.composer
|
|
535
|
+
await aui.composer.addAttachment(file);
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
538
|
```
|
|
@@ -54,7 +54,7 @@ const AssistantMessage = () => (
|
|
|
54
54
|
|
|
55
55
|
## Programmatic Branch Navigation
|
|
56
56
|
|
|
57
|
-
For headless or keyboard-shortcut flows, navigate directly to a branch by id via `aui.message
|
|
57
|
+
For headless or keyboard-shortcut flows, navigate directly to a branch by id via `aui.message.switchToBranch`:
|
|
58
58
|
|
|
59
59
|
```tsx
|
|
60
60
|
import { useAui } from "@assistant-ui/react";
|
|
@@ -62,7 +62,7 @@ import { useAui } from "@assistant-ui/react";
|
|
|
62
62
|
const SwitchToBranch = ({ branchId }: { branchId: string }) => {
|
|
63
63
|
const aui = useAui();
|
|
64
64
|
return (
|
|
65
|
-
<button onClick={() => aui.message
|
|
65
|
+
<button onClick={() => aui.message.switchToBranch({ branchId })}>
|
|
66
66
|
Go to branch
|
|
67
67
|
</button>
|
|
68
68
|
);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: ChatGPT Subscription
|
|
3
|
+
description: Run your assistant-ui app on your ChatGPT Plus or Pro subscription via Codex OAuth. Local development without an OpenAI API key.
|
|
4
|
+
platforms: ["react"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
If you have a ChatGPT Plus or Pro subscription, you can run your assistant-ui app against it locally instead of paying per token with an API key. OpenAI's Codex CLI authenticates via OAuth and caches tokens on your machine; requests made with those tokens hit the Responses API endpoint at `chatgpt.com` and bill to your plan. The same mechanism powers Codex itself and a growing set of local agents.
|
|
8
|
+
|
|
9
|
+
This is a personal-use setup for apps running on your own machine. For anything deployed or shared, use an API key.
|
|
10
|
+
|
|
11
|
+
## Log in with Codex
|
|
12
|
+
|
|
13
|
+
Authenticate once with the Codex CLI. The login flow runs OAuth in your browser and writes access and refresh tokens to `~/.codex/auth.json`:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npx @openai/codex login
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Everything below reads that file; no environment variables or API keys are involved.
|
|
20
|
+
|
|
21
|
+
## AI SDK route
|
|
22
|
+
|
|
23
|
+
The community AI SDK provider [`openai-oauth-provider`](https://github.com/EvanZhouDev/openai-oauth) picks up `~/.codex/auth.json` automatically, refreshes tokens as needed, and supports streaming, tool calls, and reasoning traces.
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
npm install openai-oauth-provider
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
In your chat route, swap `@ai-sdk/openai` for the OAuth provider. Starting from the default assistant-ui template route, only the model changes; `frontendTools` and the UI message stream response work as before:
|
|
30
|
+
|
|
31
|
+
```ts title="/app/api/chat/route.ts" {10}
|
|
32
|
+
import { createOpenAIOAuth } from "openai-oauth-provider";
|
|
33
|
+
import { frontendTools } from "@assistant-ui/react-ai-sdk";
|
|
34
|
+
import {
|
|
35
|
+
type JSONSchema7,
|
|
36
|
+
streamText,
|
|
37
|
+
convertToModelMessages,
|
|
38
|
+
type UIMessage,
|
|
39
|
+
} from "ai";
|
|
40
|
+
|
|
41
|
+
const openai = createOpenAIOAuth();
|
|
42
|
+
|
|
43
|
+
export async function POST(req: Request) {
|
|
44
|
+
const {
|
|
45
|
+
messages,
|
|
46
|
+
system,
|
|
47
|
+
tools,
|
|
48
|
+
}: {
|
|
49
|
+
messages: UIMessage[];
|
|
50
|
+
system?: string;
|
|
51
|
+
tools?: Record<string, { description?: string; parameters: JSONSchema7 }>;
|
|
52
|
+
} = await req.json();
|
|
53
|
+
|
|
54
|
+
const result = streamText({
|
|
55
|
+
model: openai("gpt-5.3-codex"),
|
|
56
|
+
messages: await convertToModelMessages(messages),
|
|
57
|
+
system,
|
|
58
|
+
tools: {
|
|
59
|
+
...frontendTools(tools ?? {}),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return result.toUIMessageStreamResponse({
|
|
64
|
+
sendReasoning: true,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The provider discovers which models your plan includes (for example `gpt-5.4` and `gpt-5.3-codex`) from your ChatGPT account.
|
|
70
|
+
|
|
71
|
+
## Eve agents
|
|
72
|
+
|
|
73
|
+
Eve's `defineAgent` accepts a provider-authored AI SDK `LanguageModel`, so the same provider drops into an eve agent config:
|
|
74
|
+
|
|
75
|
+
```ts title="agent/agent.ts"
|
|
76
|
+
import { defineAgent } from "eve";
|
|
77
|
+
import { createOpenAIOAuth } from "openai-oauth-provider";
|
|
78
|
+
|
|
79
|
+
export default defineAgent({
|
|
80
|
+
model: createOpenAIOAuth()("gpt-5.3-codex"),
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## OpenAI-compatible proxy
|
|
85
|
+
|
|
86
|
+
For stacks that take an OpenAI base URL rather than an AI SDK model, the same project publishes a sibling package, `openai-oauth`, whose CLI runs a local proxy:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
npx openai-oauth
|
|
90
|
+
# OpenAI-compatible endpoint ready at http://127.0.0.1:10531/v1
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Point any OpenAI-compatible client at that URL. No real API key is involved, but most clients require one at construction, so pass a placeholder:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
import { OpenAI } from "openai";
|
|
97
|
+
|
|
98
|
+
const openai = new OpenAI({
|
|
99
|
+
baseURL: "http://127.0.0.1:10531/v1",
|
|
100
|
+
apiKey: "unused",
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The proxy binds to `127.0.0.1` by default; keep it that way, since any caller that can reach the endpoint bills your subscription.
|
|
105
|
+
|
|
106
|
+
<Callout type="warn">
|
|
107
|
+
Your OAuth tokens live in `~/.codex/auth.json`, so this only works where that file exists. A deployed instance would bill every visitor to your subscription. `openai-oauth-provider` is an unofficial community package, available models depend on your ChatGPT plan, and OpenAI sanctions this auth flow for Codex tooling, so treat it as personal use.
|
|
108
|
+
</Callout>
|