@assistant-ui/mcp-docs-server 0.1.31 → 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 +11 -11
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +13 -13
- package/.docs/organized/code-examples/with-artifacts.md +13 -13
- package/.docs/organized/code-examples/with-assistant-transport.md +10 -10
- package/.docs/organized/code-examples/with-browser-extension.md +345 -0
- package/.docs/organized/code-examples/with-chain-of-thought.md +54 -17
- 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 +13 -13
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -16
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +17 -16
- package/.docs/organized/code-examples/with-expo.md +24 -24
- package/.docs/organized/code-examples/with-external-store.md +10 -10
- package/.docs/organized/code-examples/with-ffmpeg.md +13 -13
- package/.docs/organized/code-examples/with-generative-ui.md +210 -13
- package/.docs/organized/code-examples/with-google-adk.md +10 -10
- 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 +13 -13
- 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 +18 -17
- package/.docs/organized/code-examples/with-mcp.md +748 -0
- package/.docs/organized/code-examples/with-opencode.md +11 -11
- package/.docs/organized/code-examples/with-parent-id-grouping.md +11 -11
- 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 +15 -15
- 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 +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +2 -2
- package/.docs/raw/docs/(docs)/installation.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +26 -24
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +20 -12
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +37 -16
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +12 -23
- 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 +11 -9
- 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 +18 -13
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +18 -57
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +15 -28
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +64 -18
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +434 -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 +11 -12
- 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 +110 -131
- 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 +39 -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 +29 -24
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +175 -591
- 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 +77 -96
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -349
- 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 +18 -13
- 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 -47
- 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.mdx +1 -1
- package/.docs/raw/docs/cloud/index.mdx +2 -2
- package/.docs/raw/docs/guides/attachments.mdx +4 -4
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chain-of-thought.mdx +5 -5
- package/.docs/raw/docs/guides/context-api.mdx +4 -4
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/editing.mdx +1 -1
- 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 +2 -2
- package/.docs/raw/docs/guides/interactables.mdx +2 -2
- package/.docs/raw/docs/guides/latex.mdx +2 -2
- package/.docs/raw/docs/guides/mcp-apps.mdx +231 -0
- package/.docs/raw/docs/guides/mentions.mdx +2 -2
- package/.docs/raw/docs/guides/message-timing.mdx +38 -5
- package/.docs/raw/docs/guides/multi-agent.mdx +2 -2
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- 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/guides/slash-commands.mdx +1 -1
- package/.docs/raw/docs/guides/speech.mdx +2 -2
- package/.docs/raw/docs/guides/suggestions.mdx +88 -4
- package/.docs/raw/docs/guides/tool-ui.mdx +2 -2
- package/.docs/raw/docs/guides/tools.mdx +66 -5
- package/.docs/raw/docs/guides/voice.mdx +2 -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 +10 -11
- package/.docs/raw/docs/ink/primitives.mdx +349 -8
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +9 -4
- package/.docs/raw/docs/integrations/index.mdx +15 -3
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +8 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +8 -4
- package/.docs/raw/docs/integrations/tools/react-mcp.mdx +337 -0
- package/.docs/raw/docs/primitives/composer.mdx +53 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -2
- package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
- package/.docs/raw/docs/react-native/hooks.mdx +2 -2
- package/.docs/raw/docs/react-native/index.mdx +4 -4
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +4 -4
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +32 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +7 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +7 -0
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +27 -2
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -1
- package/.docs/raw/docs/runtimes/custom/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +12 -5
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +11 -1
- package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/sources.mdx +17 -0
- package/.docs/raw/docs/ui/streamdown.mdx +34 -2
- package/.docs/raw/docs/ui/thread-list.mdx +2 -2
- package/.docs/raw/docs/ui/thread.mdx +2 -2
- 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 +5 -5
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +0 -41
- 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/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
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-14.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
|
/>
|
|
@@ -184,23 +189,37 @@ const isThreadEmpty: AuiIf.Condition = (s) => s.thread.isEmpty;
|
|
|
184
189
|
|
|
185
190
|
<AuiIf condition={isThreadEmpty}>
|
|
186
191
|
<WelcomeScreen />
|
|
187
|
-
</AuiIf
|
|
192
|
+
</AuiIf>;
|
|
188
193
|
```
|
|
189
194
|
|
|
190
195
|
## Migration from Deprecated Components
|
|
191
196
|
|
|
192
197
|
<Callout type="warn">
|
|
193
|
-
`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.
|
|
194
219
|
</Callout>
|
|
195
220
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
| `<MessagePrimitive.If user>` | `<AuiIf condition={(s) => s.message.role === "user"}>` |
|
|
202
|
-
| `<MessagePrimitive.If assistant>` | `<AuiIf condition={(s) => s.message.role === "assistant"}>` |
|
|
203
|
-
| `<MessagePrimitive.If copied>` | `<AuiIf condition={(s) => s.message.isCopied}>` |
|
|
204
|
-
| `<MessagePrimitive.If speaking>` | `<AuiIf condition={(s) => s.message.speech != null}>` |
|
|
205
|
-
| `<MessagePrimitive.If last>` | `<AuiIf condition={(s) => s.message.isLast}>` |
|
|
206
|
-
| `<ComposerPrimitive.If editing>` | `<AuiIf condition={(s) => s.composer.isEditing}>` |
|
|
221
|
+
```tsx
|
|
222
|
+
import { AssistantIf } from "@assistant-ui/react";
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
{/* api-manual:end */}
|