@assistant-ui/mcp-docs-server 0.1.30 → 0.1.32
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 -8
- package/.docs/organized/code-examples/with-a2a.md +10 -10
- package/.docs/organized/code-examples/with-ag-ui.md +12 -12
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +14 -14
- package/.docs/organized/code-examples/with-artifacts.md +14 -14
- package/.docs/organized/code-examples/with-assistant-transport.md +11 -11
- package/.docs/organized/code-examples/with-browser-extension.md +345 -0
- package/.docs/organized/code-examples/with-chain-of-thought.md +129 -63
- package/.docs/organized/code-examples/with-cloud-standalone.md +13 -13
- package/.docs/organized/code-examples/with-cloud.md +13 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +65 -20
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +18 -17
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +18 -17
- package/.docs/organized/code-examples/with-expo.md +25 -25
- package/.docs/organized/code-examples/with-external-store.md +10 -10
- package/.docs/organized/code-examples/with-ffmpeg.md +14 -14
- package/.docs/organized/code-examples/with-generative-ui.md +211 -14
- package/.docs/organized/code-examples/with-google-adk.md +12 -12
- package/.docs/organized/code-examples/with-heat-graph.md +8 -8
- package/.docs/organized/code-examples/with-image-generation.md +454 -0
- package/.docs/organized/code-examples/with-interactables.md +14 -14
- package/.docs/organized/code-examples/with-langchain.md +12 -12
- package/.docs/organized/code-examples/with-langgraph.md +15 -12
- package/.docs/organized/code-examples/with-livekit.md +19 -18
- package/.docs/organized/code-examples/with-mcp.md +748 -0
- package/.docs/organized/code-examples/with-opencode.md +107 -62
- package/.docs/organized/code-examples/with-parent-id-grouping.md +12 -12
- package/.docs/organized/code-examples/with-react-hook-form.md +14 -14
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +16 -16
- package/.docs/organized/code-examples/with-resumable-stream.md +660 -0
- package/.docs/organized/code-examples/with-store.md +8 -8
- package/.docs/organized/code-examples/with-tanstack.md +14 -14
- package/.docs/organized/code-examples/with-tap-runtime.md +11 -10
- package/.docs/raw/docs/(docs)/cli.mdx +3 -1
- package/.docs/raw/docs/(docs)/copilots/assistant-frame.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +10 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-visible.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/use-assistant-instructions.mdx +1 -0
- package/.docs/raw/docs/(docs)/devtools.mdx +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +3 -2
- package/.docs/raw/docs/(docs)/installation.mdx +2 -1
- package/.docs/raw/docs/(docs)/rtl.mdx +1 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +36 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +34 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +55 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +37 -8
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +64 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +52 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +36 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +98 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +31 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +33 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +28 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +94 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +464 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +24 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +79 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +52 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +125 -125
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +78 -221
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +127 -242
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +46 -20
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +66 -87
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +50 -58
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +80 -48
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +67 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +323 -461
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +36 -43
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +70 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +182 -554
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +65 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +35 -22
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +57 -140
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +70 -161
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +84 -108
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +82 -86
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -314
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +9 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +10 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +15 -70
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +43 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +25 -28
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +11 -63
- package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +11 -48
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +10 -42
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +18 -30
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +68 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +79 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +92 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +48 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +62 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +19 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +131 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +54 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +36 -0
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +230 -2
- package/.docs/raw/docs/cloud/ai-sdk.mdx +222 -4
- package/.docs/raw/docs/cloud/index.mdx +2 -2
- package/.docs/raw/docs/cloud/langgraph.mdx +274 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/attachments.mdx +45 -40
- package/.docs/raw/docs/guides/branching.mdx +76 -0
- package/.docs/raw/docs/guides/chain-of-thought.mdx +166 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/context-api.mdx +54 -26
- package/.docs/raw/docs/{(docs)/guides → guides}/dictation.mdx +3 -1
- package/.docs/raw/docs/guides/editing.mdx +102 -0
- package/.docs/raw/docs/guides/generative-ui.mdx +142 -0
- package/.docs/raw/docs/guides/image-generation.mdx +74 -0
- package/.docs/raw/docs/guides/index.mdx +103 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/interactables.mdx +51 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/latex.mdx +53 -10
- package/.docs/raw/docs/guides/mcp-apps.mdx +231 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/mentions.mdx +63 -88
- package/.docs/raw/docs/{(docs)/guides → guides}/message-timing.mdx +45 -6
- package/.docs/raw/docs/{(docs)/guides → guides}/multi-agent.mdx +66 -6
- package/.docs/raw/docs/{(docs)/guides → guides}/quoting.mdx +11 -18
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +212 -0
- package/.docs/raw/docs/guides/resumable-stream-stores.mdx +152 -0
- package/.docs/raw/docs/guides/resumable-streams.mdx +210 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/slash-commands.mdx +104 -38
- package/.docs/raw/docs/guides/speech.mdx +156 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/suggestions.mdx +91 -69
- package/.docs/raw/docs/{(docs)/guides → guides}/tool-ui.mdx +110 -38
- package/.docs/raw/docs/{(docs)/guides → guides}/tools.mdx +197 -40
- package/.docs/raw/docs/{(docs)/guides → guides}/voice.mdx +41 -2
- package/.docs/raw/docs/ink/adapters.mdx +37 -1
- package/.docs/raw/docs/ink/custom-backend.mdx +59 -8
- package/.docs/raw/docs/ink/index.mdx +11 -14
- package/.docs/raw/docs/ink/migration.mdx +1 -3
- package/.docs/raw/docs/ink/primitives.mdx +386 -9
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +520 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +191 -0
- package/.docs/raw/docs/integrations/auth/clerk.mdx +172 -0
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +196 -0
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +79 -0
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +188 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +57 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +201 -0
- package/.docs/raw/docs/integrations/gateways/index.mdx +162 -0
- package/.docs/raw/docs/integrations/index.mdx +185 -0
- package/.docs/raw/docs/integrations/observability/helicone.mdx +130 -0
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +163 -0
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +150 -0
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +712 -0
- package/.docs/raw/docs/integrations/tools/mcp.mdx +267 -0
- package/.docs/raw/docs/integrations/tools/react-mcp.mdx +337 -0
- package/.docs/raw/docs/migrations/v0-14.mdx +297 -0
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -0
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/primitives/attachment.mdx +1 -0
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +90 -85
- package/.docs/raw/docs/primitives/composer.mdx +55 -1
- package/.docs/raw/docs/primitives/error.mdx +1 -0
- package/.docs/raw/docs/primitives/index.mdx +4 -3
- package/.docs/raw/docs/primitives/message.mdx +68 -5
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -0
- package/.docs/raw/docs/primitives/suggestion.mdx +10 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +39 -0
- package/.docs/raw/docs/primitives/thread.mdx +16 -13
- package/.docs/raw/docs/react-native/hooks.mdx +2 -2
- package/.docs/raw/docs/react-native/index.mdx +5 -7
- package/.docs/raw/docs/react-native/migration.mdx +1 -3
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +396 -0
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +60 -0
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +216 -0
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +70 -0
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +243 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +154 -0
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +52 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +73 -128
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +70 -64
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +337 -123
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +265 -0
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +125 -0
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +67 -0
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +428 -0
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +703 -0
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +348 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +261 -1236
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +746 -0
- package/.docs/raw/docs/runtimes/custom/overview.mdx +71 -0
- package/.docs/raw/docs/runtimes/google-adk/api.mdx +256 -0
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +717 -0
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +69 -0
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +229 -0
- package/.docs/raw/docs/runtimes/langchain.mdx +533 -0
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +305 -0
- package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +104 -0
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +84 -0
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +496 -0
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +127 -0
- package/.docs/raw/docs/runtimes/langgraph/threads.mdx +113 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -23
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +191 -0
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +48 -0
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +119 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +78 -203
- package/.docs/raw/docs/ui/accordion.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -0
- package/.docs/raw/docs/ui/attachment.mdx +1 -0
- package/.docs/raw/docs/ui/badge.mdx +1 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +12 -1
- package/.docs/raw/docs/ui/context-display.mdx +1 -0
- package/.docs/raw/docs/ui/diff-viewer.mdx +1 -0
- package/.docs/raw/docs/ui/directive-text.mdx +1 -0
- package/.docs/raw/docs/ui/file.mdx +1 -0
- package/.docs/raw/docs/ui/image.mdx +1 -0
- package/.docs/raw/docs/ui/markdown.mdx +2 -14
- package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
- package/.docs/raw/docs/ui/mermaid.mdx +1 -0
- package/.docs/raw/docs/ui/message-timing.mdx +3 -2
- package/.docs/raw/docs/ui/model-selector.mdx +9 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +325 -313
- package/.docs/raw/docs/ui/quote.mdx +1 -0
- package/.docs/raw/docs/ui/reasoning.mdx +66 -33
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -0
- package/.docs/raw/docs/ui/select.mdx +1 -0
- package/.docs/raw/docs/ui/sources.mdx +18 -0
- package/.docs/raw/docs/ui/streamdown.mdx +35 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -0
- package/.docs/raw/docs/ui/tabs.mdx +1 -0
- package/.docs/raw/docs/ui/thread-list.mdx +19 -2
- package/.docs/raw/docs/ui/thread.mdx +58 -3
- package/.docs/raw/docs/ui/tool-fallback.mdx +1 -0
- package/.docs/raw/docs/ui/tool-group.mdx +39 -11
- package/.docs/raw/docs/ui/voice.mdx +1 -0
- package/.docs/raw/docs/utilities/heat-graph.mdx +1 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +278 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +1 -0
- package/README.md +14 -72
- package/dist/constants.d.ts +12 -9
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +13 -9
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts +4 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js +109 -121
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts +4 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js +45 -42
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +1 -2
- package/dist/prepare-docs/prepare.js +17 -17
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/stdio.d.ts +1 -3
- package/dist/stdio.js +6 -3
- package/dist/stdio.js.map +1 -1
- package/dist/tools/docs.d.ts +20 -15
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +140 -161
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +20 -15
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +74 -86
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/tests/test-setup.d.ts +5 -2
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +21 -28
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -5
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +17 -17
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/mcp-format.d.ts +8 -5
- package/dist/utils/mcp-format.d.ts.map +1 -1
- package/dist/utils/mcp-format.js +9 -9
- package/dist/utils/mcp-format.js.map +1 -1
- package/dist/utils/mdx.d.ts +8 -6
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/mdx.js +22 -22
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts +9 -6
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +66 -76
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/security.d.ts +4 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +19 -40
- package/dist/utils/security.js.map +1 -1
- package/package.json +6 -6
- package/src/tools/tests/path-traversal.test.ts +1 -1
- package/.docs/raw/docs/(docs)/guides/branching.mdx +0 -65
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +0 -164
- package/.docs/raw/docs/(docs)/guides/editing.mdx +0 -66
- package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -38
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -40
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -260
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -103
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -254
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +0 -159
- package/.docs/raw/docs/runtimes/a2a/index.mdx +0 -298
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +0 -1033
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +0 -314
- package/.docs/raw/docs/runtimes/custom/local.mdx +0 -1464
- package/.docs/raw/docs/runtimes/data-stream.mdx +0 -422
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +0 -686
- package/.docs/raw/docs/runtimes/helicone.mdx +0 -61
- package/.docs/raw/docs/runtimes/langchain/comparison.mdx +0 -60
- package/.docs/raw/docs/runtimes/langchain/index.mdx +0 -210
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +0 -699
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +0 -12
- package/.docs/raw/docs/runtimes/langserve.mdx +0 -116
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -218
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +0 -18
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -217
- package/dist/prepare-docs/prepare.d.ts.map +0 -1
- package/dist/stdio.d.ts.map +0 -1
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/deprecation-policy.mdx +0 -0
- /package/.docs/raw/docs/{(reference) → migrations}/react-compatibility.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/react-langgraph-v0-7.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-11.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-12.mdx +0 -0
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: ActionBarPrimitive
|
|
3
|
-
description:
|
|
3
|
+
description: Composable message action controls for copy, edit, reload, speech, and feedback in assistant-ui chat interfaces.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { ActionBarPrimitiveCopyProps, ActionBarPrimitiveEditProps, ActionBarPrimitiveExportMarkdownProps, ActionBarPrimitiveFeedbackNegativeProps, ActionBarPrimitiveFeedbackPositiveProps, ActionBarPrimitiveReloadProps, ActionBarPrimitiveRootProps, ActionBarPrimitiveSpeakProps, ActionBarPrimitiveStopSpeakingProps } from "@/generated/typeDocs";
|
|
7
|
+
import { ActionBarPrimitive as ActionBarPrimitiveDocs } from "@/generated/primitiveDocs";
|
|
7
8
|
|
|
9
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
10
|
+
{/* Do not edit manually. */}
|
|
8
11
|
|
|
12
|
+
For examples and usage patterns, see [ActionBar](/docs/primitives/action-bar).
|
|
13
|
+
|
|
14
|
+
{/* api-manual:start */}
|
|
9
15
|
## Anatomy
|
|
10
16
|
|
|
11
17
|
```tsx
|
|
@@ -25,300 +31,179 @@ const AssistantMessageBar = () => (
|
|
|
25
31
|
</ActionBarPrimitive.Root>
|
|
26
32
|
);
|
|
27
33
|
```
|
|
34
|
+
{/* api-manual:end */}
|
|
35
|
+
|
|
36
|
+
{/* api-reference:start */}
|
|
37
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
38
|
+
{/* Do not edit this block manually. */}
|
|
28
39
|
|
|
29
40
|
## API Reference
|
|
30
41
|
|
|
31
42
|
### Root
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default: "false",
|
|
47
|
-
description: (
|
|
48
|
-
<span>
|
|
49
|
-
Do not render the ActionBar when the thread is in running state.
|
|
50
|
-
</span>
|
|
51
|
-
),
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "autohide",
|
|
55
|
-
type: '"always" | "not-last" | "never"',
|
|
56
|
-
default: '"never"',
|
|
57
|
-
description: (
|
|
58
|
-
<span>
|
|
59
|
-
Do not render the ActionBar unless the mouse is hovering over the
|
|
60
|
-
message.
|
|
61
|
-
<br />
|
|
62
|
-
<br />
|
|
63
|
-
<Code>"always"</Code>: always autohide.
|
|
64
|
-
<br />
|
|
65
|
-
<Code>"not-last"</Code>: only autohide if the message is not the last
|
|
66
|
-
one in the thread.
|
|
67
|
-
</span>
|
|
68
|
-
),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "autohideFloat",
|
|
72
|
-
type: '"always" | "single-branch" | "never"',
|
|
73
|
-
default: '"never"',
|
|
74
|
-
description: (
|
|
75
|
-
<span>
|
|
76
|
-
Float the ActionBar during autohide.
|
|
77
|
-
<br />
|
|
78
|
-
<br />
|
|
79
|
-
<Code>"always"</Code>: always float during autohide.
|
|
80
|
-
<br />
|
|
81
|
-
<Code>"single-branch"</Code>: only float if the message is the only
|
|
82
|
-
one in the thread.
|
|
83
|
-
<br />
|
|
84
|
-
<br />
|
|
85
|
-
Note: this only sets `data-floating` on the ActionBar. You need to set
|
|
86
|
-
the appropriate styles on the ActionBar to make it float.
|
|
87
|
-
</span>
|
|
88
|
-
),
|
|
89
|
-
},
|
|
90
|
-
]}
|
|
91
|
-
/>
|
|
44
|
+
{ActionBarPrimitiveDocs.Root?.deprecated && (
|
|
45
|
+
<Callout type="warn">
|
|
46
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.Root.deprecated}
|
|
47
|
+
</Callout>
|
|
48
|
+
)}
|
|
49
|
+
|
|
50
|
+
{ActionBarPrimitiveDocs.Root?.description}
|
|
51
|
+
|
|
52
|
+
{ActionBarPrimitiveDocs.Root?.element && (
|
|
53
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.Root?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
<ParametersTable {...ActionBarPrimitiveRootProps} />
|
|
92
57
|
|
|
58
|
+
{/* api-manual:ActionBarPrimitive.Root:start */}
|
|
93
59
|
| Data attribute | Values |
|
|
94
60
|
| --- | --- |
|
|
95
61
|
| `[data-floating]` | Present when floating |
|
|
62
|
+
{/* api-manual:ActionBarPrimitive.Root:end */}
|
|
96
63
|
|
|
97
|
-
###
|
|
64
|
+
### Copy
|
|
98
65
|
|
|
99
|
-
|
|
66
|
+
{ActionBarPrimitiveDocs.Copy?.deprecated && (
|
|
67
|
+
<Callout type="warn">
|
|
68
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.Copy.deprecated}
|
|
69
|
+
</Callout>
|
|
70
|
+
)}
|
|
100
71
|
|
|
101
|
-
|
|
72
|
+
{ActionBarPrimitiveDocs.Copy?.description}
|
|
102
73
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
name: "asChild",
|
|
108
|
-
},
|
|
109
|
-
]}
|
|
110
|
-
/>
|
|
74
|
+
{ActionBarPrimitiveDocs.Copy?.element && (
|
|
75
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.Copy?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
76
|
+
)}
|
|
111
77
|
|
|
112
|
-
|
|
78
|
+
<ParametersTable {...ActionBarPrimitiveCopyProps} />
|
|
113
79
|
|
|
114
|
-
|
|
80
|
+
{/* api-manual:ActionBarPrimitive.Copy:start */}
|
|
81
|
+
| Data attribute | Values |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `[data-copied]` | Present when the message was recently copied. |
|
|
84
|
+
{/* api-manual:ActionBarPrimitive.Copy:end */}
|
|
115
85
|
|
|
116
|
-
|
|
86
|
+
### Reload
|
|
117
87
|
|
|
118
|
-
|
|
119
|
-
type="
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
]}
|
|
125
|
-
/>
|
|
88
|
+
{ActionBarPrimitiveDocs.Reload?.deprecated && (
|
|
89
|
+
<Callout type="warn">
|
|
90
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.Reload.deprecated}
|
|
91
|
+
</Callout>
|
|
92
|
+
)}
|
|
126
93
|
|
|
127
|
-
|
|
94
|
+
{ActionBarPrimitiveDocs.Reload?.description}
|
|
128
95
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
<ParametersTable
|
|
134
|
-
type="ActionBarPrimitiveCopyProps"
|
|
135
|
-
parameters={[
|
|
136
|
-
{
|
|
137
|
-
name: "asChild",
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: "copiedDuration",
|
|
141
|
-
type: "number",
|
|
142
|
-
description:
|
|
143
|
-
"The duration in milliseconds to change the message status to 'copied'.",
|
|
144
|
-
default: "3000",
|
|
145
|
-
},
|
|
146
|
-
]}
|
|
147
|
-
/>
|
|
96
|
+
{ActionBarPrimitiveDocs.Reload?.element && (
|
|
97
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.Reload?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
98
|
+
)}
|
|
148
99
|
|
|
149
|
-
|
|
150
|
-
| --- | --- |
|
|
151
|
-
| `[data-copied]` | Present when the message was recently copied. |
|
|
100
|
+
<ParametersTable {...ActionBarPrimitiveReloadProps} />
|
|
152
101
|
|
|
153
|
-
|
|
102
|
+
### Edit
|
|
154
103
|
|
|
155
|
-
|
|
104
|
+
{ActionBarPrimitiveDocs.Edit?.deprecated && (
|
|
105
|
+
<Callout type="warn">
|
|
106
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.Edit.deprecated}
|
|
107
|
+
</Callout>
|
|
108
|
+
)}
|
|
156
109
|
|
|
157
|
-
|
|
158
|
-
<ActionBarPrimitive.Copy>
|
|
159
|
-
<AuiIf condition={(s) => !s.message.isCopied}>
|
|
160
|
-
<CopyIcon />
|
|
161
|
-
</AuiIf>
|
|
162
|
-
<AuiIf condition={(s) => s.message.isCopied}>
|
|
163
|
-
<CopySuccessIcon />
|
|
164
|
-
</AuiIf>
|
|
165
|
-
</ActionBarPrimitive.Copy>
|
|
166
|
-
```
|
|
110
|
+
{ActionBarPrimitiveDocs.Edit?.description}
|
|
167
111
|
|
|
168
|
-
|
|
112
|
+
{ActionBarPrimitiveDocs.Edit?.element && (
|
|
113
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.Edit?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
114
|
+
)}
|
|
169
115
|
|
|
170
|
-
|
|
171
|
-
<ActionBarPrimitive.Copy className="group">
|
|
172
|
-
<CopyIcon className="group-data-[copied]:hidden" />
|
|
173
|
-
<CheckIcon className="hidden group-data-[copied]:block" />
|
|
174
|
-
</ActionBarPrimitive.Copy>
|
|
175
|
-
```
|
|
116
|
+
<ParametersTable {...ActionBarPrimitiveEditProps} />
|
|
176
117
|
|
|
177
118
|
### Speak
|
|
178
119
|
|
|
179
|
-
|
|
120
|
+
{ActionBarPrimitiveDocs.Speak?.deprecated && (
|
|
121
|
+
<Callout type="warn">
|
|
122
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.Speak.deprecated}
|
|
123
|
+
</Callout>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
{ActionBarPrimitiveDocs.Speak?.description}
|
|
180
127
|
|
|
181
|
-
|
|
128
|
+
{ActionBarPrimitiveDocs.Speak?.element && (
|
|
129
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.Speak?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
130
|
+
)}
|
|
182
131
|
|
|
183
|
-
<ParametersTable
|
|
184
|
-
type="ActionBarPrimitiveSpeakProps"
|
|
185
|
-
parameters={[
|
|
186
|
-
{
|
|
187
|
-
name: "asChild",
|
|
188
|
-
},
|
|
189
|
-
]}
|
|
190
|
-
/>
|
|
132
|
+
<ParametersTable {...ActionBarPrimitiveSpeakProps} />
|
|
191
133
|
|
|
192
134
|
### StopSpeaking
|
|
193
135
|
|
|
194
|
-
|
|
136
|
+
{ActionBarPrimitiveDocs.StopSpeaking?.deprecated && (
|
|
137
|
+
<Callout type="warn">
|
|
138
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.StopSpeaking.deprecated}
|
|
139
|
+
</Callout>
|
|
140
|
+
)}
|
|
141
|
+
|
|
142
|
+
{ActionBarPrimitiveDocs.StopSpeaking?.description}
|
|
143
|
+
|
|
144
|
+
{ActionBarPrimitiveDocs.StopSpeaking?.element && (
|
|
145
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.StopSpeaking?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
146
|
+
)}
|
|
195
147
|
|
|
196
|
-
|
|
148
|
+
<ParametersTable {...ActionBarPrimitiveStopSpeakingProps} />
|
|
197
149
|
|
|
198
|
-
|
|
199
|
-
type="ActionBarPrimitiveStopSpeakingProps"
|
|
200
|
-
parameters={[
|
|
201
|
-
{
|
|
202
|
-
name: "asChild",
|
|
203
|
-
},
|
|
204
|
-
]}
|
|
205
|
-
/>
|
|
150
|
+
### FeedbackPositive
|
|
206
151
|
|
|
207
|
-
|
|
152
|
+
{ActionBarPrimitiveDocs.FeedbackPositive?.deprecated && (
|
|
153
|
+
<Callout type="warn">
|
|
154
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.FeedbackPositive.deprecated}
|
|
155
|
+
</Callout>
|
|
156
|
+
)}
|
|
208
157
|
|
|
209
|
-
|
|
158
|
+
{ActionBarPrimitiveDocs.FeedbackPositive?.description}
|
|
210
159
|
|
|
211
|
-
|
|
160
|
+
{ActionBarPrimitiveDocs.FeedbackPositive?.element && (
|
|
161
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.FeedbackPositive?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
162
|
+
)}
|
|
212
163
|
|
|
213
|
-
<ParametersTable
|
|
214
|
-
type="ActionBarPrimitiveFeedbackPositiveProps"
|
|
215
|
-
parameters={[
|
|
216
|
-
{
|
|
217
|
-
name: "asChild",
|
|
218
|
-
},
|
|
219
|
-
]}
|
|
220
|
-
/>
|
|
164
|
+
<ParametersTable {...ActionBarPrimitiveFeedbackPositiveProps} />
|
|
221
165
|
|
|
166
|
+
{/* api-manual:ActionBarPrimitive.FeedbackPositive:start */}
|
|
222
167
|
| Data attribute | Values |
|
|
223
168
|
| --- | --- |
|
|
224
169
|
| `[data-submitted]` | Present when positive feedback was submitted. |
|
|
170
|
+
{/* api-manual:ActionBarPrimitive.FeedbackPositive:end */}
|
|
225
171
|
|
|
226
|
-
###
|
|
172
|
+
### FeedbackNegative
|
|
227
173
|
|
|
228
|
-
|
|
174
|
+
{ActionBarPrimitiveDocs.FeedbackNegative?.deprecated && (
|
|
175
|
+
<Callout type="warn">
|
|
176
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.FeedbackNegative.deprecated}
|
|
177
|
+
</Callout>
|
|
178
|
+
)}
|
|
229
179
|
|
|
230
|
-
|
|
180
|
+
{ActionBarPrimitiveDocs.FeedbackNegative?.description}
|
|
231
181
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
{
|
|
236
|
-
name: "asChild",
|
|
237
|
-
},
|
|
238
|
-
]}
|
|
239
|
-
/>
|
|
182
|
+
{ActionBarPrimitiveDocs.FeedbackNegative?.element && (
|
|
183
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.FeedbackNegative?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
184
|
+
)}
|
|
240
185
|
|
|
186
|
+
<ParametersTable {...ActionBarPrimitiveFeedbackNegativeProps} />
|
|
187
|
+
|
|
188
|
+
{/* api-manual:ActionBarPrimitive.FeedbackNegative:start */}
|
|
241
189
|
| Data attribute | Values |
|
|
242
190
|
| --- | --- |
|
|
243
191
|
| `[data-submitted]` | Present when negative feedback was submitted. |
|
|
192
|
+
{/* api-manual:ActionBarPrimitive.FeedbackNegative:end */}
|
|
244
193
|
|
|
245
194
|
### ExportMarkdown
|
|
246
195
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
type="ActionBarPrimitiveExportMarkdownProps"
|
|
253
|
-
parameters={[
|
|
254
|
-
{
|
|
255
|
-
name: "asChild",
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
name: "filename",
|
|
259
|
-
type: "string",
|
|
260
|
-
description:
|
|
261
|
-
"The filename for the downloaded Markdown file. Defaults to 'message-{timestamp}.md'. Ignored when onExport is provided.",
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: "onExport",
|
|
265
|
-
type: "(content: string) => void | Promise<void>",
|
|
266
|
-
description:
|
|
267
|
-
"Optional callback function that receives the message content. When provided, overrides the default Markdown download behavior. Use this to implement custom export logic (PDF, JSON, TXT, etc.).",
|
|
268
|
-
},
|
|
269
|
-
]}
|
|
270
|
-
/>
|
|
271
|
-
|
|
272
|
-
#### Examples
|
|
273
|
-
|
|
274
|
-
Default Markdown export:
|
|
275
|
-
|
|
276
|
-
```tsx
|
|
277
|
-
<ActionBarPrimitive.ExportMarkdown>
|
|
278
|
-
<DownloadIcon />
|
|
279
|
-
Export as Markdown
|
|
280
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
With custom filename:
|
|
196
|
+
{ActionBarPrimitiveDocs.ExportMarkdown?.deprecated && (
|
|
197
|
+
<Callout type="warn">
|
|
198
|
+
<strong>Deprecated.</strong> {ActionBarPrimitiveDocs.ExportMarkdown.deprecated}
|
|
199
|
+
</Callout>
|
|
200
|
+
)}
|
|
284
201
|
|
|
285
|
-
|
|
286
|
-
<ActionBarPrimitive.ExportMarkdown filename="chat-response.md">
|
|
287
|
-
<DownloadIcon />
|
|
288
|
-
Download
|
|
289
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
290
|
-
```
|
|
202
|
+
{ActionBarPrimitiveDocs.ExportMarkdown?.description}
|
|
291
203
|
|
|
292
|
-
|
|
204
|
+
{ActionBarPrimitiveDocs.ExportMarkdown?.element && (
|
|
205
|
+
<p>This primitive renders a <code>{`<${ActionBarPrimitiveDocs.ExportMarkdown?.element}>`}</code> element unless <code>asChild</code> is set.</p>
|
|
206
|
+
)}
|
|
293
207
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
onExport={async (content) => {
|
|
297
|
-
const pdf = await generatePdf(content);
|
|
298
|
-
downloadFile(pdf, "message.pdf");
|
|
299
|
-
}}
|
|
300
|
-
>
|
|
301
|
-
<FileIcon />
|
|
302
|
-
Export PDF
|
|
303
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
Export as JSON:
|
|
307
|
-
|
|
308
|
-
```tsx
|
|
309
|
-
<ActionBarPrimitive.ExportMarkdown
|
|
310
|
-
onExport={(content) => {
|
|
311
|
-
const json = JSON.stringify({ content, timestamp: Date.now() });
|
|
312
|
-
const blob = new Blob([json], { type: "application/json" });
|
|
313
|
-
const url = URL.createObjectURL(blob);
|
|
314
|
-
const a = document.createElement("a");
|
|
315
|
-
a.href = url;
|
|
316
|
-
a.download = "message.json";
|
|
317
|
-
a.click();
|
|
318
|
-
URL.revokeObjectURL(url);
|
|
319
|
-
}}
|
|
320
|
-
>
|
|
321
|
-
<CodeIcon />
|
|
322
|
-
Export JSON
|
|
323
|
-
</ActionBarPrimitive.ExportMarkdown>
|
|
324
|
-
```
|
|
208
|
+
<ParametersTable {...ActionBarPrimitiveExportMarkdownProps} />
|
|
209
|
+
{/* api-reference:end */}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: AuiIf
|
|
3
|
-
description: Conditional rendering
|
|
3
|
+
description: Conditional rendering primitive for showing React UI from assistant-ui thread, message, composer, and runtime state.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
{/* api-reference:skip-auto-generation */}
|
|
7
7
|
|
|
8
|
+
{/* api-manual:start */}
|
|
8
9
|
|
|
9
10
|
## Anatomy
|
|
10
11
|
|
|
@@ -13,7 +14,7 @@ import { AuiIf } from "@assistant-ui/react";
|
|
|
13
14
|
|
|
14
15
|
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
15
16
|
<WelcomeScreen />
|
|
16
|
-
</AuiIf
|
|
17
|
+
</AuiIf>;
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Overview
|
|
@@ -29,7 +30,8 @@ import { AuiIf } from "@assistant-ui/react";
|
|
|
29
30
|
name: "condition",
|
|
30
31
|
type: "(state: AssistantState) => boolean",
|
|
31
32
|
required: true,
|
|
32
|
-
description:
|
|
33
|
+
description:
|
|
34
|
+
"A function that receives the assistant state and returns whether to render children.",
|
|
33
35
|
},
|
|
34
36
|
{
|
|
35
37
|
name: "children",
|
|
@@ -54,7 +56,8 @@ The condition function receives an `AssistantState` object with the following pr
|
|
|
54
56
|
{
|
|
55
57
|
name: "message",
|
|
56
58
|
type: "MessageState",
|
|
57
|
-
description:
|
|
59
|
+
description:
|
|
60
|
+
"The current message state (available within a message context).",
|
|
58
61
|
},
|
|
59
62
|
{
|
|
60
63
|
name: "composer",
|
|
@@ -64,12 +67,14 @@ The condition function receives an `AssistantState` object with the following pr
|
|
|
64
67
|
{
|
|
65
68
|
name: "part",
|
|
66
69
|
type: "PartState",
|
|
67
|
-
description:
|
|
70
|
+
description:
|
|
71
|
+
"The current message part state (available within a part context).",
|
|
68
72
|
},
|
|
69
73
|
{
|
|
70
74
|
name: "attachment",
|
|
71
75
|
type: "AttachmentState",
|
|
72
|
-
description:
|
|
76
|
+
description:
|
|
77
|
+
"The current attachment state (available within an attachment context).",
|
|
73
78
|
},
|
|
74
79
|
]}
|
|
75
80
|
/>
|
|
@@ -111,6 +116,13 @@ The condition function receives an `AssistantState` object with the following pr
|
|
|
111
116
|
<Disclaimer />
|
|
112
117
|
</AuiIf>
|
|
113
118
|
|
|
119
|
+
// Render content only after the assistant finishes streaming
|
|
120
|
+
<AuiIf condition={(s) =>
|
|
121
|
+
s.message.role === "assistant" && s.message.status?.type === "complete"
|
|
122
|
+
}>
|
|
123
|
+
<FollowUpCard />
|
|
124
|
+
</AuiIf>
|
|
125
|
+
|
|
114
126
|
// Toggle copy icon based on copied state
|
|
115
127
|
<ActionBarPrimitive.Copy>
|
|
116
128
|
<AuiIf condition={(s) => !s.message.isCopied}>
|
|
@@ -177,23 +189,37 @@ const isThreadEmpty: AuiIf.Condition = (s) => s.thread.isEmpty;
|
|
|
177
189
|
|
|
178
190
|
<AuiIf condition={isThreadEmpty}>
|
|
179
191
|
<WelcomeScreen />
|
|
180
|
-
</AuiIf
|
|
192
|
+
</AuiIf>;
|
|
181
193
|
```
|
|
182
194
|
|
|
183
195
|
## Migration from Deprecated Components
|
|
184
196
|
|
|
185
197
|
<Callout type="warn">
|
|
186
|
-
`ThreadPrimitive.If`, `MessagePrimitive.If`, and `ComposerPrimitive.If` are
|
|
198
|
+
`ThreadPrimitive.If`, `MessagePrimitive.If`, and `ComposerPrimitive.If` are
|
|
199
|
+
deprecated. Use `AuiIf` instead.
|
|
200
|
+
</Callout>
|
|
201
|
+
|
|
202
|
+
| Before | After |
|
|
203
|
+
| -------------------------------------- | ----------------------------------------------------------- |
|
|
204
|
+
| `<ThreadPrimitive.If empty>` | `<AuiIf condition={(s) => s.thread.isEmpty}>` |
|
|
205
|
+
| `<ThreadPrimitive.If running>` | `<AuiIf condition={(s) => s.thread.isRunning}>` |
|
|
206
|
+
| `<ThreadPrimitive.If running={false}>` | `<AuiIf condition={(s) => !s.thread.isRunning}>` |
|
|
207
|
+
| `<MessagePrimitive.If user>` | `<AuiIf condition={(s) => s.message.role === "user"}>` |
|
|
208
|
+
| `<MessagePrimitive.If assistant>` | `<AuiIf condition={(s) => s.message.role === "assistant"}>` |
|
|
209
|
+
| `<MessagePrimitive.If copied>` | `<AuiIf condition={(s) => s.message.isCopied}>` |
|
|
210
|
+
| `<MessagePrimitive.If speaking>` | `<AuiIf condition={(s) => s.message.speech != null}>` |
|
|
211
|
+
| `<MessagePrimitive.If last>` | `<AuiIf condition={(s) => s.message.isLast}>` |
|
|
212
|
+
| `<ComposerPrimitive.If editing>` | `<AuiIf condition={(s) => s.composer.isEditing}>` |
|
|
213
|
+
|
|
214
|
+
## AssistantIf
|
|
215
|
+
|
|
216
|
+
<Callout type="warn">
|
|
217
|
+
<strong>Deprecated:</strong> Use `AuiIf` instead. This alias was removed in
|
|
218
|
+
v0.13.
|
|
187
219
|
</Callout>
|
|
188
220
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| `<MessagePrimitive.If user>` | `<AuiIf condition={(s) => s.message.role === "user"}>` |
|
|
195
|
-
| `<MessagePrimitive.If assistant>` | `<AuiIf condition={(s) => s.message.role === "assistant"}>` |
|
|
196
|
-
| `<MessagePrimitive.If copied>` | `<AuiIf condition={(s) => s.message.isCopied}>` |
|
|
197
|
-
| `<MessagePrimitive.If speaking>` | `<AuiIf condition={(s) => s.message.speech != null}>` |
|
|
198
|
-
| `<MessagePrimitive.If last>` | `<AuiIf condition={(s) => s.message.isLast}>` |
|
|
199
|
-
| `<ComposerPrimitive.If editing>` | `<AuiIf condition={(s) => s.composer.isEditing}>` |
|
|
221
|
+
```tsx
|
|
222
|
+
import { AssistantIf } from "@assistant-ui/react";
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
{/* api-manual:end */}
|