@assistant-ui/mcp-docs-server 0.2.3 → 0.3.1
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/README.md +16 -43
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -91
- package/dist/index.js.map +1 -1
- package/dist/proxy.d.ts +9 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +91 -0
- package/dist/proxy.js.map +1 -0
- package/package.json +8 -12
- package/src/index.ts +3 -115
- package/src/proxy.test.ts +385 -0
- package/src/proxy.ts +126 -0
- package/.docs/organized/code-examples/waterfall.md +0 -807
- package/.docs/organized/code-examples/with-a2a.md +0 -675
- package/.docs/organized/code-examples/with-ag-ui.md +0 -553
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +0 -466
- package/.docs/organized/code-examples/with-artifacts.md +0 -815
- package/.docs/organized/code-examples/with-assistant-transport.md +0 -576
- package/.docs/organized/code-examples/with-browser-extension.md +0 -371
- package/.docs/organized/code-examples/with-chain-of-thought.md +0 -962
- package/.docs/organized/code-examples/with-cloud-standalone.md +0 -681
- package/.docs/organized/code-examples/with-cloud.md +0 -439
- package/.docs/organized/code-examples/with-custom-thread-list.md +0 -569
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +0 -527
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +0 -697
- package/.docs/organized/code-examples/with-eve.md +0 -405
- package/.docs/organized/code-examples/with-expo.md +0 -2246
- package/.docs/organized/code-examples/with-external-store.md +0 -421
- package/.docs/organized/code-examples/with-ffmpeg.md +0 -829
- package/.docs/organized/code-examples/with-generative-ui.md +0 -1810
- package/.docs/organized/code-examples/with-google-adk.md +0 -368
- package/.docs/organized/code-examples/with-heat-graph.md +0 -304
- package/.docs/organized/code-examples/with-image-generation.md +0 -463
- package/.docs/organized/code-examples/with-interactables.md +0 -733
- package/.docs/organized/code-examples/with-langchain.md +0 -446
- package/.docs/organized/code-examples/with-langgraph.md +0 -855
- package/.docs/organized/code-examples/with-livekit.md +0 -643
- package/.docs/organized/code-examples/with-mcp.md +0 -782
- package/.docs/organized/code-examples/with-nuxt.md +0 -2428
- package/.docs/organized/code-examples/with-opencode.md +0 -1974
- package/.docs/organized/code-examples/with-openui.md +0 -450
- package/.docs/organized/code-examples/with-pi.md +0 -2084
- package/.docs/organized/code-examples/with-react-hook-form.md +0 -727
- package/.docs/organized/code-examples/with-react-ink-web.md +0 -740
- package/.docs/organized/code-examples/with-react-ink.md +0 -473
- package/.docs/organized/code-examples/with-react-router.md +0 -936
- package/.docs/organized/code-examples/with-resumable-stream.md +0 -668
- package/.docs/organized/code-examples/with-store.md +0 -679
- package/.docs/organized/code-examples/with-svelte.md +0 -415
- package/.docs/organized/code-examples/with-sveltekit.md +0 -1061
- package/.docs/organized/code-examples/with-tanstack.md +0 -812
- package/.docs/organized/code-examples/with-tap-runtime.md +0 -813
- package/.docs/organized/code-examples/with-virtualized-thread.md +0 -681
- package/.docs/organized/code-examples/with-vue.md +0 -408
- package/.docs/raw/docs/(getting-started)/architecture.mdx +0 -146
- package/.docs/raw/docs/(getting-started)/base-ui.mdx +0 -39
- package/.docs/raw/docs/(getting-started)/cli.mdx +0 -542
- package/.docs/raw/docs/(getting-started)/devtools.mdx +0 -79
- package/.docs/raw/docs/(getting-started)/index.mdx +0 -23
- package/.docs/raw/docs/(getting-started)/installation.mdx +0 -483
- package/.docs/raw/docs/(getting-started)/llm.mdx +0 -211
- package/.docs/raw/docs/(getting-started)/rtl.mdx +0 -78
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +0 -36
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +0 -34
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +0 -44
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +0 -59
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +0 -26
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +0 -84
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +0 -64
- package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +0 -57
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +0 -49
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/a2ui.mdx +0 -40
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/actions.mdx +0 -56
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/components.mdx +0 -86
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +0 -39
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/json-generative-ui.mdx +0 -42
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +0 -84
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +0 -85
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +0 -45
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +0 -93
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/tokens.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +0 -129
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +0 -31
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +0 -34
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +0 -350
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +0 -28
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +0 -97
- package/.docs/raw/docs/(reference)/api-reference/integrations/ai-sdk.mdx +0 -200
- package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +0 -118
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +0 -28
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -37
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +0 -50
- package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +0 -566
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +0 -152
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +0 -239
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +0 -208
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +0 -108
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +0 -99
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +0 -145
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +0 -82
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +0 -637
- package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +0 -65
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +0 -73
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +0 -117
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +0 -339
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +0 -77
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +0 -88
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +0 -81
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +0 -129
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +0 -138
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +0 -122
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +0 -289
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +0 -32
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +0 -43
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +0 -43
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +0 -36
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +0 -85
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +0 -45
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +0 -55
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +0 -151
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +0 -106
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +0 -178
- package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +0 -48
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +0 -19
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +0 -152
- package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +0 -54
- package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +0 -36
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +0 -527
- package/.docs/raw/docs/cloud/ai-sdk.mdx +0 -604
- package/.docs/raw/docs/cloud/authorization.mdx +0 -252
- package/.docs/raw/docs/cloud/index.mdx +0 -46
- package/.docs/raw/docs/cloud/langgraph.mdx +0 -554
- package/.docs/raw/docs/copilots/assistant-frame.mdx +0 -411
- package/.docs/raw/docs/copilots/make-assistant-visible.mdx +0 -82
- package/.docs/raw/docs/copilots/model-context.mdx +0 -156
- package/.docs/raw/docs/copilots/motivation.mdx +0 -202
- package/.docs/raw/docs/copilots/use-assistant-instructions.mdx +0 -64
- package/.docs/raw/docs/guides/attachments.mdx +0 -619
- package/.docs/raw/docs/guides/branching.mdx +0 -76
- package/.docs/raw/docs/guides/chain-of-thought.mdx +0 -164
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +0 -108
- package/.docs/raw/docs/guides/context-api.mdx +0 -619
- package/.docs/raw/docs/guides/dictation.mdx +0 -298
- package/.docs/raw/docs/guides/editing.mdx +0 -102
- package/.docs/raw/docs/guides/electron.mdx +0 -369
- package/.docs/raw/docs/guides/headless-composer-input.mdx +0 -113
- package/.docs/raw/docs/guides/image-generation.mdx +0 -74
- package/.docs/raw/docs/guides/index.mdx +0 -117
- package/.docs/raw/docs/guides/input-history.mdx +0 -55
- package/.docs/raw/docs/guides/latex.mdx +0 -158
- package/.docs/raw/docs/guides/mentions.mdx +0 -575
- package/.docs/raw/docs/guides/message-timing.mdx +0 -215
- package/.docs/raw/docs/guides/quoting.mdx +0 -169
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +0 -212
- package/.docs/raw/docs/guides/resumable-stream-stores.mdx +0 -152
- package/.docs/raw/docs/guides/resumable-streams.mdx +0 -292
- package/.docs/raw/docs/guides/slash-commands.mdx +0 -358
- package/.docs/raw/docs/guides/speech.mdx +0 -172
- package/.docs/raw/docs/guides/suggestions.mdx +0 -384
- package/.docs/raw/docs/guides/virtualization.mdx +0 -133
- package/.docs/raw/docs/guides/voice.mdx +0 -310
- package/.docs/raw/docs/ink/adapters.mdx +0 -99
- package/.docs/raw/docs/ink/custom-backend.mdx +0 -254
- package/.docs/raw/docs/ink/hooks.mdx +0 -469
- package/.docs/raw/docs/ink/index.mdx +0 -237
- package/.docs/raw/docs/ink/migration.mdx +0 -138
- package/.docs/raw/docs/ink/primitives.mdx +0 -1259
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +0 -528
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +0 -188
- package/.docs/raw/docs/integrations/auth/clerk.mdx +0 -166
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +0 -191
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +0 -88
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents.mdx +0 -283
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +0 -188
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +0 -57
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +0 -201
- package/.docs/raw/docs/integrations/gateways/index.mdx +0 -162
- package/.docs/raw/docs/integrations/index.mdx +0 -178
- package/.docs/raw/docs/integrations/observability/helicone.mdx +0 -129
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +0 -161
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +0 -151
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +0 -773
- package/.docs/raw/docs/migrations/deprecation-policy.mdx +0 -42
- package/.docs/raw/docs/migrations/index.mdx +0 -50
- package/.docs/raw/docs/migrations/react-compatibility.mdx +0 -74
- package/.docs/raw/docs/migrations/react-langgraph-v0-7.mdx +0 -328
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +0 -236
- package/.docs/raw/docs/migrations/v0-11.mdx +0 -172
- package/.docs/raw/docs/migrations/v0-12.mdx +0 -302
- package/.docs/raw/docs/migrations/v0-14.mdx +0 -297
- package/.docs/raw/docs/migrations/v0-15.mdx +0 -270
- package/.docs/raw/docs/primitives/action-bar.mdx +0 -352
- package/.docs/raw/docs/primitives/assistant-modal.mdx +0 -216
- package/.docs/raw/docs/primitives/attachment.mdx +0 -217
- package/.docs/raw/docs/primitives/branch-picker.mdx +0 -222
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +0 -315
- package/.docs/raw/docs/primitives/composer.mdx +0 -659
- package/.docs/raw/docs/primitives/error.mdx +0 -142
- package/.docs/raw/docs/primitives/index.mdx +0 -99
- package/.docs/raw/docs/primitives/message.mdx +0 -618
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +0 -191
- package/.docs/raw/docs/primitives/suggestion.mdx +0 -254
- package/.docs/raw/docs/primitives/thread-list.mdx +0 -467
- package/.docs/raw/docs/primitives/thread.mdx +0 -509
- package/.docs/raw/docs/react-native/adapters.mdx +0 -94
- package/.docs/raw/docs/react-native/custom-backend.mdx +0 -207
- package/.docs/raw/docs/react-native/hooks.mdx +0 -339
- package/.docs/raw/docs/react-native/index.mdx +0 -289
- package/.docs/raw/docs/react-native/migration.mdx +0 -142
- package/.docs/raw/docs/react-native/primitives.mdx +0 -976
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +0 -399
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +0 -60
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +0 -216
- package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +0 -124
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +0 -70
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +0 -243
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +0 -267
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +0 -61
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +0 -122
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +0 -135
- package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +0 -636
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +0 -731
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +0 -118
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +0 -265
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +0 -167
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +0 -68
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +0 -513
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +0 -763
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +0 -339
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +0 -957
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +0 -902
- package/.docs/raw/docs/runtimes/custom/overview.mdx +0 -71
- package/.docs/raw/docs/runtimes/eve/overview.mdx +0 -151
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +0 -192
- package/.docs/raw/docs/runtimes/google-adk/api.mdx +0 -256
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +0 -784
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +0 -69
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +0 -229
- package/.docs/raw/docs/runtimes/langchain.mdx +0 -901
- package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +0 -181
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +0 -305
- package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +0 -104
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +0 -84
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +0 -496
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +0 -144
- package/.docs/raw/docs/runtimes/langgraph/threads.mdx +0 -113
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +0 -29
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -93
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +0 -347
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +0 -393
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +0 -194
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +0 -58
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +0 -119
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +0 -133
- package/.docs/raw/docs/tools/a2ui.mdx +0 -107
- package/.docs/raw/docs/tools/backend.mdx +0 -147
- package/.docs/raw/docs/tools/defining-tools.mdx +0 -574
- package/.docs/raw/docs/tools/dynamic-tools.mdx +0 -112
- package/.docs/raw/docs/tools/generative-ui-primitive.mdx +0 -180
- package/.docs/raw/docs/tools/generative-ui-slack.mdx +0 -167
- package/.docs/raw/docs/tools/generative-ui-teams.mdx +0 -160
- package/.docs/raw/docs/tools/generative-ui.mdx +0 -322
- package/.docs/raw/docs/tools/index.mdx +0 -72
- package/.docs/raw/docs/tools/interactables.mdx +0 -1084
- package/.docs/raw/docs/tools/mcp-apps.mdx +0 -363
- package/.docs/raw/docs/tools/mcp.mdx +0 -466
- package/.docs/raw/docs/tools/multi-agent.mdx +0 -237
- package/.docs/raw/docs/tools/openui.mdx +0 -175
- package/.docs/raw/docs/tools/tool-ui.mdx +0 -1020
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +0 -428
- package/.docs/raw/docs/ui/assistant-modal.mdx +0 -166
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +0 -89
- package/.docs/raw/docs/ui/attachment.mdx +0 -279
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +0 -247
- package/.docs/raw/docs/ui/context-display.mdx +0 -148
- package/.docs/raw/docs/ui/directive-text.mdx +0 -114
- package/.docs/raw/docs/ui/file.mdx +0 -159
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +0 -82
- package/.docs/raw/docs/ui/image.mdx +0 -102
- package/.docs/raw/docs/ui/markdown.mdx +0 -103
- package/.docs/raw/docs/ui/mcp-config.mdx +0 -107
- package/.docs/raw/docs/ui/mermaid.mdx +0 -92
- package/.docs/raw/docs/ui/message-timing.mdx +0 -93
- package/.docs/raw/docs/ui/model-selector.mdx +0 -455
- package/.docs/raw/docs/ui/part-grouping.mdx +0 -614
- package/.docs/raw/docs/ui/quote.mdx +0 -211
- package/.docs/raw/docs/ui/reasoning.mdx +0 -214
- package/.docs/raw/docs/ui/scrollbar.mdx +0 -77
- package/.docs/raw/docs/ui/sources.mdx +0 -186
- package/.docs/raw/docs/ui/streamdown.mdx +0 -392
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +0 -205
- package/.docs/raw/docs/ui/thread-list.mdx +0 -411
- package/.docs/raw/docs/ui/thread.mdx +0 -559
- package/.docs/raw/docs/ui/tool-fallback.mdx +0 -141
- package/.docs/raw/docs/ui/tool-group.mdx +0 -240
- package/.docs/raw/docs/ui/voice.mdx +0 -173
- package/.docs/raw/docs/utilities/heat-graph.mdx +0 -237
- package/.docs/raw/docs/utilities/react-o11y.mdx +0 -362
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +0 -212
- package/dist/constants.d.ts +0 -14
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -19
- package/dist/constants.js.map +0 -1
- package/dist/prepare-docs/code-examples.d.ts +0 -5
- package/dist/prepare-docs/code-examples.d.ts.map +0 -1
- package/dist/prepare-docs/code-examples.js +0 -117
- package/dist/prepare-docs/code-examples.js.map +0 -1
- package/dist/prepare-docs/copy-raw.d.ts +0 -5
- package/dist/prepare-docs/copy-raw.d.ts.map +0 -1
- package/dist/prepare-docs/copy-raw.js +0 -49
- package/dist/prepare-docs/copy-raw.js.map +0 -1
- package/dist/prepare-docs/prepare.d.ts +0 -1
- package/dist/prepare-docs/prepare.js +0 -22
- package/dist/prepare-docs/prepare.js.map +0 -1
- package/dist/prompts/xulux-playground.d.ts +0 -12
- package/dist/prompts/xulux-playground.d.ts.map +0 -1
- package/dist/prompts/xulux-playground.js +0 -33
- package/dist/prompts/xulux-playground.js.map +0 -1
- package/dist/tools/docs.d.ts +0 -22
- package/dist/tools/docs.d.ts.map +0 -1
- package/dist/tools/docs.js +0 -177
- package/dist/tools/docs.js.map +0 -1
- package/dist/tools/examples.d.ts +0 -24
- package/dist/tools/examples.d.ts.map +0 -1
- package/dist/tools/examples.js +0 -87
- package/dist/tools/examples.js.map +0 -1
- package/dist/tools/resources.d.ts +0 -6
- package/dist/tools/resources.d.ts.map +0 -1
- package/dist/tools/resources.js +0 -75
- package/dist/tools/resources.js.map +0 -1
- package/dist/tools/search.d.ts +0 -24
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js +0 -39
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/tests/mcp-test-client.d.ts +0 -15
- package/dist/tools/tests/mcp-test-client.d.ts.map +0 -1
- package/dist/tools/tests/mcp-test-client.js +0 -68
- package/dist/tools/tests/mcp-test-client.js.map +0 -1
- package/dist/tools/tests/test-setup.d.ts +0 -7
- package/dist/tools/tests/test-setup.d.ts.map +0 -1
- package/dist/tools/tests/test-setup.js +0 -36
- package/dist/tools/tests/test-setup.js.map +0 -1
- package/dist/tools/xulux-templates.d.ts +0 -58
- package/dist/tools/xulux-templates.d.ts.map +0 -1
- package/dist/tools/xulux-templates.js +0 -84
- package/dist/tools/xulux-templates.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -5
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -18
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -10
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -20
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/mcp-format.d.ts +0 -11
- package/dist/utils/mcp-format.d.ts.map +0 -1
- package/dist/utils/mcp-format.js +0 -14
- package/dist/utils/mcp-format.js.map +0 -1
- package/dist/utils/mdx.d.ts +0 -12
- package/dist/utils/mdx.d.ts.map +0 -1
- package/dist/utils/mdx.js +0 -45
- package/dist/utils/mdx.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -12
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -93
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/search.d.ts +0 -10
- package/dist/utils/search.d.ts.map +0 -1
- package/dist/utils/search.js +0 -97
- package/dist/utils/search.js.map +0 -1
- package/dist/utils/security.d.ts +0 -5
- package/dist/utils/security.d.ts.map +0 -1
- package/dist/utils/security.js +0 -22
- package/dist/utils/security.js.map +0 -1
- package/dist/xulux/catalog-client.d.ts +0 -14
- package/dist/xulux/catalog-client.d.ts.map +0 -1
- package/dist/xulux/catalog-client.js +0 -112
- package/dist/xulux/catalog-client.js.map +0 -1
- package/dist/xulux/fallback-catalog.d.ts +0 -7
- package/dist/xulux/fallback-catalog.d.ts.map +0 -1
- package/dist/xulux/fallback-catalog.js +0 -47
- package/dist/xulux/fallback-catalog.js.map +0 -1
- package/dist/xulux/fetch-sandbox.d.ts +0 -5
- package/dist/xulux/fetch-sandbox.d.ts.map +0 -1
- package/dist/xulux/fetch-sandbox.js +0 -40
- package/dist/xulux/fetch-sandbox.js.map +0 -1
- package/dist/xulux/template-service.d.ts +0 -84
- package/dist/xulux/template-service.d.ts.map +0 -1
- package/dist/xulux/template-service.js +0 -223
- package/dist/xulux/template-service.js.map +0 -1
- package/dist/xulux/types.d.ts +0 -55
- package/dist/xulux/types.d.ts.map +0 -1
- package/dist/xulux/types.js +0 -6
- package/dist/xulux/types.js.map +0 -1
- package/src/constants.ts +0 -24
- package/src/prepare-docs/code-examples.ts +0 -158
- package/src/prepare-docs/copy-raw.ts +0 -50
- package/src/prepare-docs/prepare.ts +0 -24
- package/src/prompts/xulux-playground.ts +0 -36
- package/src/tools/docs.ts +0 -255
- package/src/tools/examples.ts +0 -114
- package/src/tools/resources.ts +0 -111
- package/src/tools/search.ts +0 -46
- package/src/tools/tests/completions.test.ts +0 -60
- package/src/tools/tests/directory-size-cap.test.ts +0 -50
- package/src/tools/tests/docs.test.ts +0 -147
- package/src/tools/tests/examples.test.ts +0 -94
- package/src/tools/tests/integration.test.ts +0 -45
- package/src/tools/tests/json-parsing.test.ts +0 -23
- package/src/tools/tests/listings-cache.test.ts +0 -19
- package/src/tools/tests/mcp-protocol.test.ts +0 -216
- package/src/tools/tests/mcp-test-client.ts +0 -111
- package/src/tools/tests/path-traversal.test.ts +0 -84
- package/src/tools/tests/resources.test.ts +0 -133
- package/src/tools/tests/search.test.ts +0 -37
- package/src/tools/tests/test-setup.ts +0 -50
- package/src/tools/tests/xulux-templates.test.ts +0 -325
- package/src/tools/xulux-templates.ts +0 -141
- package/src/utils/cache.ts +0 -20
- package/src/utils/logger.ts +0 -20
- package/src/utils/mcp-format.ts +0 -14
- package/src/utils/mdx.ts +0 -59
- package/src/utils/paths.ts +0 -139
- package/src/utils/search.ts +0 -131
- package/src/utils/security.ts +0 -52
- package/src/utils/tests/cache.test.ts +0 -51
- package/src/utils/tests/mcp-format.test.ts +0 -22
- package/src/utils/tests/security.test.ts +0 -119
- package/src/xulux/catalog-client.ts +0 -150
- package/src/xulux/fallback-catalog.ts +0 -63
- package/src/xulux/fetch-sandbox.ts +0 -56
- package/src/xulux/template-service.ts +0 -406
- package/src/xulux/types.ts +0 -64
|
@@ -1,976 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Primitives
|
|
3
|
-
description: Composable React Native components for building chat UIs.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Primitives are thin wrappers around React Native components (`View`, `TextInput`, `FlatList`, `Pressable`) that integrate with the assistant-ui runtime. They accept all standard React Native props and add runtime-aware behavior.
|
|
7
|
-
|
|
8
|
-
Primitives are accessed via namespace imports (e.g. `ThreadPrimitive.Root`, `ComposerPrimitive.Input`), matching the pattern used in `@assistant-ui/react`.
|
|
9
|
-
|
|
10
|
-
Many primitives share their core logic with `@assistant-ui/react` via `@assistant-ui/core/react` — only the UI layer (View/Pressable/Text vs DOM elements) differs.
|
|
11
|
-
|
|
12
|
-
## Thread
|
|
13
|
-
|
|
14
|
-
```tsx
|
|
15
|
-
import { AuiIf, ThreadPrimitive } from "@assistant-ui/react-native";
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### ThreadPrimitive.Root
|
|
19
|
-
|
|
20
|
-
Container `View` for the thread area.
|
|
21
|
-
|
|
22
|
-
```tsx
|
|
23
|
-
<ThreadPrimitive.Root style={{ flex: 1 }}>
|
|
24
|
-
{children}
|
|
25
|
-
</ThreadPrimitive.Root>
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
| Prop | Type | Description |
|
|
29
|
-
|------|------|-------------|
|
|
30
|
-
| `...rest` | `ViewProps` | Standard React Native View props |
|
|
31
|
-
|
|
32
|
-
### ThreadPrimitive.Messages
|
|
33
|
-
|
|
34
|
-
Deprecated `FlatList`-based message list kept for backwards compatibility. It uses `ThreadPrimitive.MessagesFlatList` internally, but keeps the previous no-auto-scroll default so existing apps with custom scroll handling do not change behavior on upgrade.
|
|
35
|
-
|
|
36
|
-
Use `ThreadPrimitive.MessagesFlatList` for new React Native threads.
|
|
37
|
-
|
|
38
|
-
```tsx
|
|
39
|
-
<ThreadPrimitive.Messages>
|
|
40
|
-
{() => <MyMessage />}
|
|
41
|
-
</ThreadPrimitive.Messages>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
You can also provide role-specific components:
|
|
45
|
-
|
|
46
|
-
```tsx
|
|
47
|
-
<ThreadPrimitive.Messages>
|
|
48
|
-
{({ message }) => {
|
|
49
|
-
if (message.role === "user") return <MyUserMessage />;
|
|
50
|
-
return <MyAssistantMessage />;
|
|
51
|
-
}}
|
|
52
|
-
</ThreadPrimitive.Messages>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
| Prop | Type | Description |
|
|
56
|
-
|------|------|-------------|
|
|
57
|
-
| `components` | `MessageComponents` | Component map — provide either a `Message` component (used for all roles) or role-specific `UserMessage`, `AssistantMessage`, and optionally `SystemMessage`. Edit composers can be set via `EditComposer` or role-specific variants (`UserEditComposer`, `AssistantEditComposer`, `SystemEditComposer`). |
|
|
58
|
-
| `...rest` | `ThreadPrimitive.MessagesFlatList` props | Same props as `ThreadPrimitive.MessagesFlatList`, with the auto-scroll options defaulting to `false` on this deprecated wrapper |
|
|
59
|
-
|
|
60
|
-
### ThreadPrimitive.MessagesFlatList
|
|
61
|
-
|
|
62
|
-
Canonical React Native message viewport backed by `FlatList`. It scopes each row to its message, forwards refs to the underlying `FlatList`, and handles scroll-to-bottom behavior for common chat flows.
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
<ThreadPrimitive.MessagesFlatList autoScroll>
|
|
66
|
-
{() => <MyMessage />}
|
|
67
|
-
</ThreadPrimitive.MessagesFlatList>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
| Prop | Type | Description |
|
|
71
|
-
|------|------|-------------|
|
|
72
|
-
| `children` | `({ message }) => ReactNode` | Render function for each message |
|
|
73
|
-
| `components` | `MessageComponents` | Component map alternative to `children` |
|
|
74
|
-
| `autoScroll` | `boolean` | Automatically keeps the list at the bottom while it is already near the bottom. Defaults to `true` |
|
|
75
|
-
| `scrollToBottomOnRunStart` | `boolean` | Scrolls to the bottom when a run starts. Defaults to `true` |
|
|
76
|
-
| `scrollToBottomOnInitialize` | `boolean` | Scrolls to the bottom when messages first appear. Defaults to `true` |
|
|
77
|
-
| `scrollToBottomOnThreadSwitch` | `boolean` | Scrolls to the bottom when switching threads. Defaults to `true` |
|
|
78
|
-
| `...rest` | `FlatListProps` | Standard FlatList props, except `data`, `renderItem`, and `children` |
|
|
79
|
-
|
|
80
|
-
The built-in auto-scroll behavior assumes the default, non-inverted `FlatList` direction.
|
|
81
|
-
|
|
82
|
-
### ThreadPrimitive.MessageByIndex
|
|
83
|
-
|
|
84
|
-
Renders a single message at a specific index in the thread. Provides message context so that `useAuiState((s) => s.message)` works inside the rendered component. This component is shared from `@assistant-ui/core/react`.
|
|
85
|
-
|
|
86
|
-
```tsx
|
|
87
|
-
<ThreadPrimitive.MessageByIndex
|
|
88
|
-
index={0}
|
|
89
|
-
components={{
|
|
90
|
-
UserMessage: MyUserMessage,
|
|
91
|
-
AssistantMessage: MyAssistantMessage,
|
|
92
|
-
}}
|
|
93
|
-
/>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
| Prop | Type | Description |
|
|
97
|
-
|------|------|-------------|
|
|
98
|
-
| `index` | `number` | Zero-based index of the message to render |
|
|
99
|
-
| `components` | `MessageComponents` | Same component map as `ThreadPrimitive.Messages` |
|
|
100
|
-
|
|
101
|
-
### ThreadPrimitive.Empty
|
|
102
|
-
|
|
103
|
-
Renders its children only when the thread is empty (no messages and not loading). Deprecated in favor of `AuiIf`.
|
|
104
|
-
|
|
105
|
-
```tsx
|
|
106
|
-
<ThreadPrimitive.Empty>
|
|
107
|
-
<Text>Send a message to get started</Text>
|
|
108
|
-
</ThreadPrimitive.Empty>
|
|
109
|
-
|
|
110
|
-
// preferred
|
|
111
|
-
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
112
|
-
<Text>Send a message to get started</Text>
|
|
113
|
-
</AuiIf>
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### ThreadPrimitive.If
|
|
117
|
-
|
|
118
|
-
Conditional rendering based on thread state. Deprecated in favor of `AuiIf`.
|
|
119
|
-
|
|
120
|
-
```tsx
|
|
121
|
-
<ThreadPrimitive.If empty>
|
|
122
|
-
<Text>No messages yet</Text>
|
|
123
|
-
</ThreadPrimitive.If>
|
|
124
|
-
|
|
125
|
-
// preferred
|
|
126
|
-
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
127
|
-
<Text>No messages yet</Text>
|
|
128
|
-
</AuiIf>
|
|
129
|
-
|
|
130
|
-
<AuiIf condition={(s) => s.thread.isRunning}>
|
|
131
|
-
<ActivityIndicator />
|
|
132
|
-
</AuiIf>
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
| Prop | Type | Description |
|
|
136
|
-
|------|------|-------------|
|
|
137
|
-
| `empty` | `boolean` | Renders children when thread emptiness matches this value |
|
|
138
|
-
| `running` | `boolean` | Renders children when thread running state matches this value |
|
|
139
|
-
|
|
140
|
-
### ThreadPrimitive.Suggestion
|
|
141
|
-
|
|
142
|
-
`Pressable` that inserts or sends a hard-coded suggestion prompt. Unlike `SuggestionPrimitive.Trigger`, this component does not require a suggestion context — the prompt is passed directly as a prop.
|
|
143
|
-
|
|
144
|
-
```tsx
|
|
145
|
-
<ThreadPrimitive.Suggestion prompt="What can you help me with?" send>
|
|
146
|
-
<Text>What can you help me with?</Text>
|
|
147
|
-
</ThreadPrimitive.Suggestion>
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
| Prop | Type | Description |
|
|
151
|
-
|------|------|-------------|
|
|
152
|
-
| `prompt` | `string` | The text to send or insert into the composer |
|
|
153
|
-
| `send` | `boolean` | When true, sends the prompt immediately; when false, inserts into composer (default: false) |
|
|
154
|
-
| `clearComposer` | `boolean` | Whether to replace composer text (default: true) |
|
|
155
|
-
| `...rest` | `PressableProps` | Standard Pressable props (except `onPress`) |
|
|
156
|
-
|
|
157
|
-
### ThreadPrimitive.Suggestions
|
|
158
|
-
|
|
159
|
-
Renders all suggestions using the provided component configuration. This component is shared from `@assistant-ui/core/react`.
|
|
160
|
-
|
|
161
|
-
```tsx
|
|
162
|
-
<ThreadPrimitive.Suggestions>
|
|
163
|
-
{() => <MySuggestion />}
|
|
164
|
-
</ThreadPrimitive.Suggestions>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
| Prop | Type | Description |
|
|
168
|
-
|------|------|-------------|
|
|
169
|
-
| `components` | `{ Suggestion: ComponentType }` | Component to render for each suggestion |
|
|
170
|
-
|
|
171
|
-
### ThreadPrimitive.SuggestionByIndex
|
|
172
|
-
|
|
173
|
-
Renders a single suggestion at the specified index, providing suggestion context. This component is shared from `@assistant-ui/core/react`.
|
|
174
|
-
|
|
175
|
-
```tsx
|
|
176
|
-
<ThreadPrimitive.SuggestionByIndex
|
|
177
|
-
index={0}
|
|
178
|
-
components={{ Suggestion: MySuggestion }}
|
|
179
|
-
/>
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
| Prop | Type | Description |
|
|
183
|
-
|------|------|-------------|
|
|
184
|
-
| `index` | `number` | Zero-based index of the suggestion to render |
|
|
185
|
-
| `components` | `{ Suggestion: ComponentType }` | Component to render for the suggestion |
|
|
186
|
-
|
|
187
|
-
### AuiIf
|
|
188
|
-
|
|
189
|
-
Conditional rendering based on assistant state. Replaces the deprecated `ThreadPrimitive.Empty`, `ThreadPrimitive.If`, `MessagePrimitive.If`, and `ComposerPrimitive.If`.
|
|
190
|
-
|
|
191
|
-
```tsx
|
|
192
|
-
import { AuiIf } from "@assistant-ui/react-native";
|
|
193
|
-
|
|
194
|
-
<AuiIf condition={(s) => s.thread.isEmpty}>
|
|
195
|
-
<Text>Send a message to get started</Text>
|
|
196
|
-
</AuiIf>
|
|
197
|
-
|
|
198
|
-
<AuiIf condition={(s) => s.thread.isRunning}>
|
|
199
|
-
<ActivityIndicator />
|
|
200
|
-
</AuiIf>
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
| Prop | Type | Description |
|
|
204
|
-
|------|------|-------------|
|
|
205
|
-
| `condition` | `(state) => boolean` | Selector that determines whether children are rendered |
|
|
206
|
-
|
|
207
|
-
## Composer
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
import {
|
|
211
|
-
ComposerPrimitive,
|
|
212
|
-
QueueItemPrimitive,
|
|
213
|
-
} from "@assistant-ui/react-native";
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
### ComposerPrimitive.Root
|
|
217
|
-
|
|
218
|
-
Container `View` for the composer area.
|
|
219
|
-
|
|
220
|
-
```tsx
|
|
221
|
-
<ComposerPrimitive.Root style={styles.composerContainer}>
|
|
222
|
-
{children}
|
|
223
|
-
</ComposerPrimitive.Root>
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### ComposerPrimitive.Input
|
|
227
|
-
|
|
228
|
-
`TextInput` wired to the composer runtime. Value and `onChangeText` are managed automatically.
|
|
229
|
-
|
|
230
|
-
```tsx
|
|
231
|
-
<ComposerPrimitive.Input
|
|
232
|
-
placeholder="Message..."
|
|
233
|
-
multiline
|
|
234
|
-
style={styles.input}
|
|
235
|
-
/>
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
| Prop | Type | Description |
|
|
239
|
-
|------|------|-------------|
|
|
240
|
-
| `submitMode` | `"enter" \| "none"` | Whether Enter sends the message on web (default: `"enter"`) |
|
|
241
|
-
| `...rest` | `TextInputProps` | Standard TextInput props (except `value`, `onChangeText`) |
|
|
242
|
-
|
|
243
|
-
### ComposerPrimitive.Send
|
|
244
|
-
|
|
245
|
-
`Pressable` that sends the current message. Automatically disabled when the composer is empty.
|
|
246
|
-
|
|
247
|
-
```tsx
|
|
248
|
-
<ComposerPrimitive.Send style={styles.sendButton}>
|
|
249
|
-
<Text>Send</Text>
|
|
250
|
-
</ComposerPrimitive.Send>
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### ComposerPrimitive.Cancel
|
|
254
|
-
|
|
255
|
-
`Pressable` that cancels the current run. Automatically disabled when no run is active.
|
|
256
|
-
|
|
257
|
-
```tsx
|
|
258
|
-
<ComposerPrimitive.Cancel style={styles.cancelButton}>
|
|
259
|
-
<Text>Stop</Text>
|
|
260
|
-
</ComposerPrimitive.Cancel>
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### ComposerPrimitive.Attachments
|
|
264
|
-
|
|
265
|
-
Renders composer attachments using the provided component configuration.
|
|
266
|
-
|
|
267
|
-
```tsx
|
|
268
|
-
<ComposerPrimitive.Attachments>
|
|
269
|
-
{({ attachment }) => {
|
|
270
|
-
if (attachment.type === "image") return <MyImageAttachment />;
|
|
271
|
-
if (attachment.type === "document") return <MyDocumentAttachment />;
|
|
272
|
-
return <MyFallbackAttachment />;
|
|
273
|
-
}}
|
|
274
|
-
</ComposerPrimitive.Attachments>
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
| Prop | Type | Description |
|
|
278
|
-
|------|------|-------------|
|
|
279
|
-
| `components` | `{ Image?, Document?, File?, Attachment? }` | Component renderers by attachment type |
|
|
280
|
-
|
|
281
|
-
### ComposerPrimitive.AddAttachment
|
|
282
|
-
|
|
283
|
-
`Pressable` for triggering attachment addition. The actual file picker must be implemented by the consumer (e.g. using `expo-document-picker` or `expo-image-picker`).
|
|
284
|
-
|
|
285
|
-
```tsx
|
|
286
|
-
<ComposerPrimitive.AddAttachment>
|
|
287
|
-
<Text>Attach</Text>
|
|
288
|
-
</ComposerPrimitive.AddAttachment>
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
### ComposerPrimitive.Queue
|
|
292
|
-
|
|
293
|
-
Renders all queued composer items. Each item is wrapped in a `QueueItemByIndexProvider`, so `QueueItemPrimitive.*` can read item state and call queue actions inside the render prop. Backed by the shared `ComposerPrimitiveQueue` from `@assistant-ui/core/react`.
|
|
294
|
-
|
|
295
|
-
```tsx
|
|
296
|
-
<ComposerPrimitive.Queue>
|
|
297
|
-
{({ queueItem }) => (
|
|
298
|
-
<View>
|
|
299
|
-
<QueueItemPrimitive.Text />
|
|
300
|
-
<QueueItemPrimitive.Steer>
|
|
301
|
-
<Text>Run now</Text>
|
|
302
|
-
</QueueItemPrimitive.Steer>
|
|
303
|
-
<QueueItemPrimitive.Remove>
|
|
304
|
-
<Text>Remove</Text>
|
|
305
|
-
</QueueItemPrimitive.Remove>
|
|
306
|
-
</View>
|
|
307
|
-
)}
|
|
308
|
-
</ComposerPrimitive.Queue>
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
| Prop | Type | Description |
|
|
312
|
-
|------|------|-------------|
|
|
313
|
-
| `children` | `(value: { queueItem: QueueItemState }) => ReactNode` | Render function called for each queue item |
|
|
314
|
-
|
|
315
|
-
### ComposerPrimitive.Quote
|
|
316
|
-
|
|
317
|
-
Renders the active composer quote preview. Children are only rendered while `s.composer.quote` is set, so this acts as both a container and a gate.
|
|
318
|
-
|
|
319
|
-
```tsx
|
|
320
|
-
<ComposerPrimitive.Quote>
|
|
321
|
-
<View>
|
|
322
|
-
<Text>Quoting:</Text>
|
|
323
|
-
<ComposerPrimitive.QuoteText />
|
|
324
|
-
<ComposerPrimitive.QuoteDismiss>
|
|
325
|
-
<Text>Clear</Text>
|
|
326
|
-
</ComposerPrimitive.QuoteDismiss>
|
|
327
|
-
</View>
|
|
328
|
-
</ComposerPrimitive.Quote>
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
| Prop | Type | Description |
|
|
332
|
-
|------|------|-------------|
|
|
333
|
-
| `children` | `ReactNode` | Quote preview content; only rendered when a quote is set |
|
|
334
|
-
| `...rest` | `ViewProps` | Standard React Native View props |
|
|
335
|
-
|
|
336
|
-
### ComposerPrimitive.QuoteText
|
|
337
|
-
|
|
338
|
-
Renders the quoted text from `s.composer.quote?.text`. Pass `children` to override the displayed value.
|
|
339
|
-
|
|
340
|
-
```tsx
|
|
341
|
-
<ComposerPrimitive.QuoteText />
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
| Prop | Type | Description |
|
|
345
|
-
|------|------|-------------|
|
|
346
|
-
| `children` | `ReactNode` | Override content; defaults to `s.composer.quote?.text` |
|
|
347
|
-
| `...rest` | `TextProps` | Standard React Native Text props |
|
|
348
|
-
|
|
349
|
-
### ComposerPrimitive.QuoteDismiss
|
|
350
|
-
|
|
351
|
-
`Pressable` that clears the active quote by calling `aui.composer.setQuote(undefined)`.
|
|
352
|
-
|
|
353
|
-
```tsx
|
|
354
|
-
<ComposerPrimitive.QuoteDismiss>
|
|
355
|
-
<Text>Clear</Text>
|
|
356
|
-
</ComposerPrimitive.QuoteDismiss>
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
| Prop | Type | Description |
|
|
360
|
-
|------|------|-------------|
|
|
361
|
-
| `children` | `PressableProps["children"]` | Button content, including Pressable render-function children |
|
|
362
|
-
| `...rest` | `Omit<PressableProps, "onPress">` | Standard React Native Pressable props except `onPress` |
|
|
363
|
-
|
|
364
|
-
### ComposerPrimitive.AttachmentByIndex
|
|
365
|
-
|
|
366
|
-
Renders a single composer attachment at the specified index. Useful for building custom attachment layouts.
|
|
367
|
-
|
|
368
|
-
```tsx
|
|
369
|
-
<ComposerPrimitive.AttachmentByIndex
|
|
370
|
-
index={0}
|
|
371
|
-
components={{
|
|
372
|
-
Image: MyImageAttachment,
|
|
373
|
-
Attachment: MyFallbackAttachment,
|
|
374
|
-
}}
|
|
375
|
-
/>
|
|
376
|
-
```
|
|
377
|
-
|
|
378
|
-
| Prop | Type | Description |
|
|
379
|
-
|------|------|-------------|
|
|
380
|
-
| `index` | `number` | Zero-based index of the attachment to render |
|
|
381
|
-
| `components` | `{ Image?, Document?, File?, Attachment? }` | Component renderers by attachment type |
|
|
382
|
-
|
|
383
|
-
### ComposerPrimitive.EditInput
|
|
384
|
-
|
|
385
|
-
`TextInput` wired to the edit composer runtime. Used inside an edit composer to allow editing an existing message. Value and `onChangeText` are managed automatically.
|
|
386
|
-
|
|
387
|
-
```tsx
|
|
388
|
-
<ComposerPrimitive.EditInput
|
|
389
|
-
placeholder="Edit message..."
|
|
390
|
-
multiline
|
|
391
|
-
style={styles.input}
|
|
392
|
-
/>
|
|
393
|
-
```
|
|
394
|
-
|
|
395
|
-
| Prop | Type | Description |
|
|
396
|
-
|------|------|-------------|
|
|
397
|
-
| `...rest` | `TextInputProps` | Standard TextInput props (except `value`, `onChangeText`) |
|
|
398
|
-
|
|
399
|
-
### ComposerPrimitive.EditSend
|
|
400
|
-
|
|
401
|
-
`Pressable` that confirms and submits a message edit. Automatically disabled when the composer is empty.
|
|
402
|
-
|
|
403
|
-
```tsx
|
|
404
|
-
<ComposerPrimitive.EditSend style={styles.sendButton}>
|
|
405
|
-
<Text>Save</Text>
|
|
406
|
-
</ComposerPrimitive.EditSend>
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
### ComposerPrimitive.EditCancel
|
|
410
|
-
|
|
411
|
-
`Pressable` that cancels an in-progress message edit and returns to the original message.
|
|
412
|
-
|
|
413
|
-
```tsx
|
|
414
|
-
<ComposerPrimitive.EditCancel style={styles.cancelButton}>
|
|
415
|
-
<Text>Cancel</Text>
|
|
416
|
-
</ComposerPrimitive.EditCancel>
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
### Conditional Rendering (Composer)
|
|
420
|
-
|
|
421
|
-
Use `AuiIf` for conditional rendering based on composer state:
|
|
422
|
-
|
|
423
|
-
```tsx
|
|
424
|
-
<AuiIf condition={(s) => s.composer.isEditing}>
|
|
425
|
-
<Text>Currently editing</Text>
|
|
426
|
-
</AuiIf>
|
|
427
|
-
|
|
428
|
-
<AuiIf condition={(s) => s.composer.dictation != null}>
|
|
429
|
-
<Text>Dictation active</Text>
|
|
430
|
-
</AuiIf>
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
## Message
|
|
434
|
-
|
|
435
|
-
```tsx
|
|
436
|
-
import { MessagePrimitive } from "@assistant-ui/react-native";
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### MessagePrimitive.Root
|
|
440
|
-
|
|
441
|
-
Container `View` for a single message.
|
|
442
|
-
|
|
443
|
-
```tsx
|
|
444
|
-
<MessagePrimitive.Root style={styles.messageBubble}>
|
|
445
|
-
{children}
|
|
446
|
-
</MessagePrimitive.Root>
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
### MessagePrimitive.Content
|
|
450
|
-
|
|
451
|
-
Renders message content parts using render-prop functions instead of the component-map approach used by `MessagePrimitive.Parts`. Each part type receives a `part` object and its `index`. Registered toolkit renderers are automatically dispatched and take priority over `renderToolCall`.
|
|
452
|
-
|
|
453
|
-
```tsx
|
|
454
|
-
<MessagePrimitive.Content
|
|
455
|
-
renderText={({ part }) => <Text>{part.text}</Text>}
|
|
456
|
-
renderToolCall={({ part, index }) => (
|
|
457
|
-
<Text>Tool: {part.toolName}</Text>
|
|
458
|
-
)}
|
|
459
|
-
renderImage={({ part }) => (
|
|
460
|
-
<Image source={{ uri: part.image }} />
|
|
461
|
-
)}
|
|
462
|
-
/>
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
| Prop | Type | Description |
|
|
466
|
-
|------|------|-------------|
|
|
467
|
-
| `renderText` | `(props: { part, index }) => ReactElement` | Renderer for text parts (default: React Native `<Text>`) |
|
|
468
|
-
| `renderToolCall` | `(props: { part, index }) => ReactElement` | Fallback renderer for tool-call parts not handled by registered tool UIs |
|
|
469
|
-
| `renderImage` | `(props: { part, index }) => ReactElement` | Renderer for image parts |
|
|
470
|
-
| `renderReasoning` | `(props: { part, index }) => ReactElement` | Renderer for reasoning parts |
|
|
471
|
-
| `renderSource` | `(props: { part, index }) => ReactElement` | Renderer for source parts |
|
|
472
|
-
| `renderFile` | `(props: { part, index }) => ReactElement` | Renderer for file parts |
|
|
473
|
-
| `renderData` | `(props: { part, index }) => ReactElement` | Fallback renderer for data parts not handled by registered data UIs |
|
|
474
|
-
|
|
475
|
-
#### Rendering Markdown
|
|
476
|
-
|
|
477
|
-
`MessagePrimitive.Content` renders text parts with React Native's `<Text>` by default, so markdown syntax is displayed as plain text. To render markdown, install a React Native markdown renderer and pass it through `renderText`:
|
|
478
|
-
|
|
479
|
-
<InstallCommand npm={["react-native-markdown-display"]} />
|
|
480
|
-
|
|
481
|
-
```tsx
|
|
482
|
-
import Markdown from "react-native-markdown-display";
|
|
483
|
-
import { MessagePrimitive } from "@assistant-ui/react-native";
|
|
484
|
-
|
|
485
|
-
const AssistantMessage = () => {
|
|
486
|
-
return (
|
|
487
|
-
<MessagePrimitive.Root>
|
|
488
|
-
<MessagePrimitive.Content
|
|
489
|
-
renderText={({ part }) => (
|
|
490
|
-
<Markdown>{part.text}</Markdown>
|
|
491
|
-
)}
|
|
492
|
-
/>
|
|
493
|
-
</MessagePrimitive.Root>
|
|
494
|
-
);
|
|
495
|
-
};
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
### MessagePrimitive.Parts
|
|
499
|
-
|
|
500
|
-
Renders message content parts via a `components` prop. Tool call and data parts automatically render registered toolkit renderers and data UIs (via `useAssistantDataUI`), falling back to components provided here. A default `Text` component using React Native's `<Text>` is provided out of the box.
|
|
501
|
-
|
|
502
|
-
```tsx
|
|
503
|
-
<MessagePrimitive.Parts>
|
|
504
|
-
{({ part }) => {
|
|
505
|
-
if (part.type === "text") return <Text>{part.text}</Text>;
|
|
506
|
-
if (part.type === "image") return <Image source={{ uri: part.image }} />;
|
|
507
|
-
if (part.type === "tool-call") return <MyToolCallComponent {...part} />;
|
|
508
|
-
return null;
|
|
509
|
-
}}
|
|
510
|
-
</MessagePrimitive.Parts>
|
|
511
|
-
```
|
|
512
|
-
|
|
513
|
-
| Prop | Type | Description |
|
|
514
|
-
|------|------|-------------|
|
|
515
|
-
| `components` | `object` | Component map for rendering each part type. See below. |
|
|
516
|
-
|
|
517
|
-
**`components` fields:**
|
|
518
|
-
|
|
519
|
-
| Field | Type | Description |
|
|
520
|
-
|-------|------|-------------|
|
|
521
|
-
| `Text` | `TextMessagePartComponent` | Text part renderer (default: React Native `<Text>`) |
|
|
522
|
-
| `Image` | `ImageMessagePartComponent` | Image part renderer |
|
|
523
|
-
| `Reasoning` | `ReasoningMessagePartComponent` | Reasoning part renderer |
|
|
524
|
-
| `Source` | `SourceMessagePartComponent` | Source part renderer |
|
|
525
|
-
| `File` | `FileMessagePartComponent` | File part renderer |
|
|
526
|
-
| `Unstable_Audio` | `Unstable_AudioMessagePartComponent` | Audio part renderer (deprecated, render `audio/*` from `File`) |
|
|
527
|
-
| `tools` | `{ by_name?, Fallback? }` or `{ Override }` | Tool call rendering config — use `by_name` to map tool names to components, `Fallback` for unregistered tools, or `Override` to handle all tool calls |
|
|
528
|
-
| `data` | `{ by_name?, Fallback? }` | Data part rendering config — use `by_name` to map data event names, `Fallback` for unmatched events |
|
|
529
|
-
| `Empty` | `EmptyMessagePartComponent` | Component shown for empty messages |
|
|
530
|
-
| `Quote` | `QuoteMessagePartComponent` | Component for rendering quoted message references |
|
|
531
|
-
| `ChainOfThought` | `ComponentType` | Groups all reasoning and tool-call parts into a single component (mutually exclusive with `Reasoning`/`tools`/`ToolGroup`/`ReasoningGroup`) |
|
|
532
|
-
|
|
533
|
-
### MessagePrimitive.PartByIndex
|
|
534
|
-
|
|
535
|
-
Renders a single message part at the specified index, providing part context. Useful for building custom part layouts outside of `MessagePrimitive.Parts`. This component is shared from `@assistant-ui/core/react`.
|
|
536
|
-
|
|
537
|
-
```tsx
|
|
538
|
-
<MessagePrimitive.PartByIndex
|
|
539
|
-
index={0}
|
|
540
|
-
components={{
|
|
541
|
-
Text: ({ text }) => <Text>{text}</Text>,
|
|
542
|
-
tools: { Fallback: MyToolComponent },
|
|
543
|
-
}}
|
|
544
|
-
/>
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
| Prop | Type | Description |
|
|
548
|
-
|------|------|-------------|
|
|
549
|
-
| `index` | `number` | Zero-based index of the message part to render |
|
|
550
|
-
| `components` | `object` | Same component map as `MessagePrimitive.Parts` |
|
|
551
|
-
|
|
552
|
-
### Conditional Rendering (Message)
|
|
553
|
-
|
|
554
|
-
Use `AuiIf` for conditional rendering based on message properties:
|
|
555
|
-
|
|
556
|
-
```tsx
|
|
557
|
-
<AuiIf condition={(s) => s.message.role === "user"}>
|
|
558
|
-
<Text>You said:</Text>
|
|
559
|
-
</AuiIf>
|
|
560
|
-
|
|
561
|
-
<AuiIf condition={(s) => s.message.role === "assistant" && s.message.isLast}>
|
|
562
|
-
<ActivityIndicator />
|
|
563
|
-
</AuiIf>
|
|
564
|
-
```
|
|
565
|
-
|
|
566
|
-
### MessagePrimitive.Attachments
|
|
567
|
-
|
|
568
|
-
Renders user message attachments using the provided component configuration.
|
|
569
|
-
|
|
570
|
-
```tsx
|
|
571
|
-
<MessagePrimitive.Attachments>
|
|
572
|
-
{({ attachment }) => {
|
|
573
|
-
if (attachment.type === "image") return <MyImageAttachment />;
|
|
574
|
-
return <MyFallbackAttachment />;
|
|
575
|
-
}}
|
|
576
|
-
</MessagePrimitive.Attachments>
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
| Prop | Type | Description |
|
|
580
|
-
|------|------|-------------|
|
|
581
|
-
| `components` | `{ Image?, Document?, File?, Attachment? }` | Component renderers by attachment type |
|
|
582
|
-
|
|
583
|
-
### MessagePrimitive.AttachmentByIndex
|
|
584
|
-
|
|
585
|
-
Renders a single message attachment at the specified index. Useful for building custom attachment layouts outside of `MessagePrimitive.Attachments`.
|
|
586
|
-
|
|
587
|
-
```tsx
|
|
588
|
-
<MessagePrimitive.AttachmentByIndex
|
|
589
|
-
index={0}
|
|
590
|
-
components={{
|
|
591
|
-
Image: MyImageAttachment,
|
|
592
|
-
Attachment: MyFallbackAttachment,
|
|
593
|
-
}}
|
|
594
|
-
/>
|
|
595
|
-
```
|
|
596
|
-
|
|
597
|
-
| Prop | Type | Description |
|
|
598
|
-
|------|------|-------------|
|
|
599
|
-
| `index` | `number` | Zero-based index of the attachment to render |
|
|
600
|
-
| `components` | `{ Image?, Document?, File?, Attachment? }` | Component renderers by attachment type |
|
|
601
|
-
|
|
602
|
-
## Attachment
|
|
603
|
-
|
|
604
|
-
```tsx
|
|
605
|
-
import { AttachmentPrimitive } from "@assistant-ui/react-native";
|
|
606
|
-
```
|
|
607
|
-
|
|
608
|
-
Primitives for rendering individual attachments (inside `ComposerPrimitive.Attachments` or `MessagePrimitive.Attachments`).
|
|
609
|
-
|
|
610
|
-
### AttachmentPrimitive.Root
|
|
611
|
-
|
|
612
|
-
Container `View` for an attachment.
|
|
613
|
-
|
|
614
|
-
```tsx
|
|
615
|
-
<AttachmentPrimitive.Root style={styles.attachment}>
|
|
616
|
-
{children}
|
|
617
|
-
</AttachmentPrimitive.Root>
|
|
618
|
-
```
|
|
619
|
-
|
|
620
|
-
### AttachmentPrimitive.Name
|
|
621
|
-
|
|
622
|
-
`Text` component displaying the attachment filename.
|
|
623
|
-
|
|
624
|
-
```tsx
|
|
625
|
-
<AttachmentPrimitive.Name style={styles.filename} />
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
### AttachmentPrimitive.Thumb
|
|
629
|
-
|
|
630
|
-
`Text` component displaying the file extension (e.g. `.pdf`), or the attachment type (e.g. `image`) when the filename has no extension (including leading-dot names like `.env`). If you pass `children`, they override that text.
|
|
631
|
-
|
|
632
|
-
```tsx
|
|
633
|
-
<AttachmentPrimitive.Thumb style={styles.extension} />
|
|
634
|
-
```
|
|
635
|
-
|
|
636
|
-
### AttachmentPrimitive.Remove
|
|
637
|
-
|
|
638
|
-
`Pressable` that removes the attachment from the composer.
|
|
639
|
-
|
|
640
|
-
```tsx
|
|
641
|
-
<AttachmentPrimitive.Remove>
|
|
642
|
-
<Text>Remove</Text>
|
|
643
|
-
</AttachmentPrimitive.Remove>
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
## QueueItem
|
|
647
|
-
|
|
648
|
-
```tsx
|
|
649
|
-
import { QueueItemPrimitive } from "@assistant-ui/react-native";
|
|
650
|
-
```
|
|
651
|
-
|
|
652
|
-
Primitives for rendering individual queued composer items. Use inside a `ComposerPrimitive.Queue` render prop, where the queue item context is set up by `QueueItemByIndexProvider`.
|
|
653
|
-
|
|
654
|
-
### QueueItemPrimitive.Text
|
|
655
|
-
|
|
656
|
-
Renders the queue item's text with React Native `<Text>`. Pass `children` to override the displayed value.
|
|
657
|
-
|
|
658
|
-
```tsx
|
|
659
|
-
<QueueItemPrimitive.Text />
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
| Prop | Type | Description |
|
|
663
|
-
|------|------|-------------|
|
|
664
|
-
| `children` | `ReactNode` | Override content; defaults to the text parts of `s.queueItem.parts` |
|
|
665
|
-
| `...rest` | `TextProps` | Standard React Native Text props |
|
|
666
|
-
|
|
667
|
-
### QueueItemPrimitive.Remove
|
|
668
|
-
|
|
669
|
-
`Pressable` that removes the queue item by calling `aui.queueItem.remove()`.
|
|
670
|
-
|
|
671
|
-
```tsx
|
|
672
|
-
<QueueItemPrimitive.Remove>
|
|
673
|
-
<Text>Remove</Text>
|
|
674
|
-
</QueueItemPrimitive.Remove>
|
|
675
|
-
```
|
|
676
|
-
|
|
677
|
-
| Prop | Type | Description |
|
|
678
|
-
|------|------|-------------|
|
|
679
|
-
| `children` | `PressableProps["children"]` | Button content, including Pressable render-function children |
|
|
680
|
-
| `...rest` | `Omit<PressableProps, "onPress">` | Standard React Native Pressable props except `onPress` |
|
|
681
|
-
|
|
682
|
-
### QueueItemPrimitive.Steer
|
|
683
|
-
|
|
684
|
-
`Pressable` that promotes the queue item to run next by calling `aui.queueItem.steer()`.
|
|
685
|
-
|
|
686
|
-
```tsx
|
|
687
|
-
<QueueItemPrimitive.Steer>
|
|
688
|
-
<Text>Run now</Text>
|
|
689
|
-
</QueueItemPrimitive.Steer>
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
| Prop | Type | Description |
|
|
693
|
-
|------|------|-------------|
|
|
694
|
-
| `children` | `PressableProps["children"]` | Button content, including Pressable render-function children |
|
|
695
|
-
| `...rest` | `Omit<PressableProps, "onPress">` | Standard React Native Pressable props except `onPress` |
|
|
696
|
-
|
|
697
|
-
## ActionBar
|
|
698
|
-
|
|
699
|
-
```tsx
|
|
700
|
-
import { ActionBarPrimitive } from "@assistant-ui/react-native";
|
|
701
|
-
```
|
|
702
|
-
|
|
703
|
-
### ActionBarPrimitive.Copy
|
|
704
|
-
|
|
705
|
-
`Pressable` that copies the message content. Pass a platform clipboard writer through `copyToClipboard`. Supports function-as-children for copy state feedback.
|
|
706
|
-
|
|
707
|
-
```tsx
|
|
708
|
-
import * as Clipboard from "expo-clipboard";
|
|
709
|
-
|
|
710
|
-
const copyToClipboard = async (text: string) => {
|
|
711
|
-
const didCopy = await Clipboard.setStringAsync(text);
|
|
712
|
-
if (!didCopy) throw new Error("Clipboard write failed");
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
<ActionBarPrimitive.Copy
|
|
716
|
-
copiedDuration={3000}
|
|
717
|
-
copyToClipboard={copyToClipboard}
|
|
718
|
-
>
|
|
719
|
-
{({ isCopied }) => <Text>{isCopied ? "Copied!" : "Copy"}</Text>}
|
|
720
|
-
</ActionBarPrimitive.Copy>
|
|
721
|
-
```
|
|
722
|
-
|
|
723
|
-
| Prop | Type | Description |
|
|
724
|
-
|------|------|-------------|
|
|
725
|
-
| `copiedDuration` | `number` | Duration in ms to show "copied" state (default: 3000) |
|
|
726
|
-
| `copyToClipboard` | `(text: string) => void \| Promise<void>` | Platform clipboard writer |
|
|
727
|
-
|
|
728
|
-
### ActionBarPrimitive.Edit
|
|
729
|
-
|
|
730
|
-
`Pressable` that enters edit mode for a message.
|
|
731
|
-
|
|
732
|
-
```tsx
|
|
733
|
-
<ActionBarPrimitive.Edit>
|
|
734
|
-
<Text>Edit</Text>
|
|
735
|
-
</ActionBarPrimitive.Edit>
|
|
736
|
-
```
|
|
737
|
-
|
|
738
|
-
### ActionBarPrimitive.Reload
|
|
739
|
-
|
|
740
|
-
`Pressable` that regenerates an assistant message.
|
|
741
|
-
|
|
742
|
-
```tsx
|
|
743
|
-
<ActionBarPrimitive.Reload>
|
|
744
|
-
<Text>Retry</Text>
|
|
745
|
-
</ActionBarPrimitive.Reload>
|
|
746
|
-
```
|
|
747
|
-
|
|
748
|
-
### ActionBarPrimitive.FeedbackPositive / ActionBarPrimitive.FeedbackNegative
|
|
749
|
-
|
|
750
|
-
`Pressable` buttons for submitting message feedback.
|
|
751
|
-
|
|
752
|
-
```tsx
|
|
753
|
-
<ActionBarPrimitive.FeedbackPositive>
|
|
754
|
-
{({ isSubmitted }) => <Text>{isSubmitted ? "Liked" : "Like"}</Text>}
|
|
755
|
-
</ActionBarPrimitive.FeedbackPositive>
|
|
756
|
-
|
|
757
|
-
<ActionBarPrimitive.FeedbackNegative>
|
|
758
|
-
{({ isSubmitted }) => <Text>{isSubmitted ? "Disliked" : "Dislike"}</Text>}
|
|
759
|
-
</ActionBarPrimitive.FeedbackNegative>
|
|
760
|
-
```
|
|
761
|
-
|
|
762
|
-
## BranchPicker
|
|
763
|
-
|
|
764
|
-
```tsx
|
|
765
|
-
import { BranchPickerPrimitive } from "@assistant-ui/react-native";
|
|
766
|
-
```
|
|
767
|
-
|
|
768
|
-
### BranchPickerPrimitive.Previous / BranchPickerPrimitive.Next
|
|
769
|
-
|
|
770
|
-
`Pressable` buttons to navigate between message branches.
|
|
771
|
-
|
|
772
|
-
```tsx
|
|
773
|
-
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
774
|
-
<BranchPickerPrimitive.Previous>
|
|
775
|
-
<Text>-</Text>
|
|
776
|
-
</BranchPickerPrimitive.Previous>
|
|
777
|
-
<BranchPickerPrimitive.Number />
|
|
778
|
-
<Text>/</Text>
|
|
779
|
-
<BranchPickerPrimitive.Count />
|
|
780
|
-
<BranchPickerPrimitive.Next>
|
|
781
|
-
<Text>+</Text>
|
|
782
|
-
</BranchPickerPrimitive.Next>
|
|
783
|
-
</View>
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
### BranchPickerPrimitive.Number / BranchPickerPrimitive.Count
|
|
787
|
-
|
|
788
|
-
`Text` components displaying the current branch number and total count.
|
|
789
|
-
|
|
790
|
-
## ThreadList
|
|
791
|
-
|
|
792
|
-
```tsx
|
|
793
|
-
import { ThreadListPrimitive } from "@assistant-ui/react-native";
|
|
794
|
-
```
|
|
795
|
-
|
|
796
|
-
### ThreadListPrimitive.Root
|
|
797
|
-
|
|
798
|
-
Container `View` for the thread list.
|
|
799
|
-
|
|
800
|
-
```tsx
|
|
801
|
-
<ThreadListPrimitive.Root style={styles.threadList}>
|
|
802
|
-
{children}
|
|
803
|
-
</ThreadListPrimitive.Root>
|
|
804
|
-
```
|
|
805
|
-
|
|
806
|
-
### ThreadListPrimitive.Items
|
|
807
|
-
|
|
808
|
-
`FlatList` of thread IDs with runtime integration.
|
|
809
|
-
|
|
810
|
-
```tsx
|
|
811
|
-
<ThreadListPrimitive.Items
|
|
812
|
-
renderItem={({ threadId }) => (
|
|
813
|
-
<ThreadListEntry threadId={threadId} />
|
|
814
|
-
)}
|
|
815
|
-
/>
|
|
816
|
-
```
|
|
817
|
-
|
|
818
|
-
| Prop | Type | Description |
|
|
819
|
-
|------|------|-------------|
|
|
820
|
-
| `renderItem` | `(props: { threadId: string; index: number }) => ReactElement` | Thread item renderer |
|
|
821
|
-
| `...rest` | `FlatListProps` | Standard FlatList props (except `data`, `renderItem`) |
|
|
822
|
-
|
|
823
|
-
### ThreadListPrimitive.New
|
|
824
|
-
|
|
825
|
-
`Pressable` that creates a new thread.
|
|
826
|
-
|
|
827
|
-
```tsx
|
|
828
|
-
<ThreadListPrimitive.New style={styles.newThreadButton}>
|
|
829
|
-
<Text>New Chat</Text>
|
|
830
|
-
</ThreadListPrimitive.New>
|
|
831
|
-
```
|
|
832
|
-
|
|
833
|
-
## ThreadListItem
|
|
834
|
-
|
|
835
|
-
```tsx
|
|
836
|
-
import { ThreadListItemPrimitive } from "@assistant-ui/react-native";
|
|
837
|
-
```
|
|
838
|
-
|
|
839
|
-
Primitives for rendering individual thread list items.
|
|
840
|
-
|
|
841
|
-
### ThreadListItemPrimitive.Root
|
|
842
|
-
|
|
843
|
-
Container `View` for a thread list item.
|
|
844
|
-
|
|
845
|
-
```tsx
|
|
846
|
-
<ThreadListItemPrimitive.Root style={styles.threadItem}>
|
|
847
|
-
{children}
|
|
848
|
-
</ThreadListItemPrimitive.Root>
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
### ThreadListItemPrimitive.Title
|
|
852
|
-
|
|
853
|
-
Renders the thread title text. Falls back to the provided fallback when title is empty. This component is shared from `@assistant-ui/core/react`.
|
|
854
|
-
|
|
855
|
-
```tsx
|
|
856
|
-
<ThreadListItemPrimitive.Title fallback="New Chat" />
|
|
857
|
-
```
|
|
858
|
-
|
|
859
|
-
| Prop | Type | Description |
|
|
860
|
-
|------|------|-------------|
|
|
861
|
-
| `fallback` | `ReactNode` | Content to show when title is empty |
|
|
862
|
-
|
|
863
|
-
### ThreadListItemPrimitive.Trigger
|
|
864
|
-
|
|
865
|
-
`Pressable` that switches to the thread.
|
|
866
|
-
|
|
867
|
-
```tsx
|
|
868
|
-
<ThreadListItemPrimitive.Trigger>
|
|
869
|
-
<ThreadListItemPrimitive.Title fallback="New Chat" />
|
|
870
|
-
</ThreadListItemPrimitive.Trigger>
|
|
871
|
-
```
|
|
872
|
-
|
|
873
|
-
### ThreadListItemPrimitive.Delete
|
|
874
|
-
|
|
875
|
-
`Pressable` that deletes the thread.
|
|
876
|
-
|
|
877
|
-
```tsx
|
|
878
|
-
<ThreadListItemPrimitive.Delete>
|
|
879
|
-
<Text>Delete</Text>
|
|
880
|
-
</ThreadListItemPrimitive.Delete>
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
### ThreadListItemPrimitive.Archive / ThreadListItemPrimitive.Unarchive
|
|
884
|
-
|
|
885
|
-
`Pressable` buttons that archive or unarchive the thread.
|
|
886
|
-
|
|
887
|
-
```tsx
|
|
888
|
-
<ThreadListItemPrimitive.Archive>
|
|
889
|
-
<Text>Archive</Text>
|
|
890
|
-
</ThreadListItemPrimitive.Archive>
|
|
891
|
-
|
|
892
|
-
<ThreadListItemPrimitive.Unarchive>
|
|
893
|
-
<Text>Unarchive</Text>
|
|
894
|
-
</ThreadListItemPrimitive.Unarchive>
|
|
895
|
-
```
|
|
896
|
-
|
|
897
|
-
## Suggestion
|
|
898
|
-
|
|
899
|
-
```tsx
|
|
900
|
-
import { SuggestionPrimitive } from "@assistant-ui/react-native";
|
|
901
|
-
```
|
|
902
|
-
|
|
903
|
-
Primitives for rendering suggestions. Use inside a `SuggestionByIndexProvider` (from `@assistant-ui/core/react`).
|
|
904
|
-
|
|
905
|
-
### SuggestionPrimitive.Title
|
|
906
|
-
|
|
907
|
-
`Text` component displaying the suggestion title.
|
|
908
|
-
|
|
909
|
-
```tsx
|
|
910
|
-
<SuggestionPrimitive.Title style={styles.suggestionTitle} />
|
|
911
|
-
```
|
|
912
|
-
|
|
913
|
-
### SuggestionPrimitive.Description
|
|
914
|
-
|
|
915
|
-
`Text` component displaying the suggestion description/label.
|
|
916
|
-
|
|
917
|
-
```tsx
|
|
918
|
-
<SuggestionPrimitive.Description style={styles.suggestionDescription} />
|
|
919
|
-
```
|
|
920
|
-
|
|
921
|
-
### SuggestionPrimitive.Trigger
|
|
922
|
-
|
|
923
|
-
`Pressable` that triggers the suggestion action (send or insert into composer).
|
|
924
|
-
|
|
925
|
-
```tsx
|
|
926
|
-
<SuggestionPrimitive.Trigger send>
|
|
927
|
-
<SuggestionPrimitive.Title />
|
|
928
|
-
</SuggestionPrimitive.Trigger>
|
|
929
|
-
```
|
|
930
|
-
|
|
931
|
-
| Prop | Type | Description |
|
|
932
|
-
|------|------|-------------|
|
|
933
|
-
| `send` | `boolean` | When true, sends immediately; when false, inserts into composer |
|
|
934
|
-
| `clearComposer` | `boolean` | Whether to clear/replace composer text (default: true) |
|
|
935
|
-
|
|
936
|
-
## ChainOfThought
|
|
937
|
-
|
|
938
|
-
```tsx
|
|
939
|
-
import { ChainOfThoughtPrimitive } from "@assistant-ui/react-native";
|
|
940
|
-
```
|
|
941
|
-
|
|
942
|
-
Primitives for rendering chain of thought content (grouped reasoning and tool-call parts).
|
|
943
|
-
|
|
944
|
-
### ChainOfThoughtPrimitive.Root
|
|
945
|
-
|
|
946
|
-
Container `View` for chain of thought content.
|
|
947
|
-
|
|
948
|
-
```tsx
|
|
949
|
-
<ChainOfThoughtPrimitive.Root style={styles.chainOfThought}>
|
|
950
|
-
{children}
|
|
951
|
-
</ChainOfThoughtPrimitive.Root>
|
|
952
|
-
```
|
|
953
|
-
|
|
954
|
-
### ChainOfThoughtPrimitive.AccordionTrigger
|
|
955
|
-
|
|
956
|
-
`Pressable` that toggles the collapsed state of the chain of thought.
|
|
957
|
-
|
|
958
|
-
```tsx
|
|
959
|
-
<ChainOfThoughtPrimitive.AccordionTrigger>
|
|
960
|
-
<Text>Toggle reasoning</Text>
|
|
961
|
-
</ChainOfThoughtPrimitive.AccordionTrigger>
|
|
962
|
-
```
|
|
963
|
-
|
|
964
|
-
### ChainOfThoughtPrimitive.Parts
|
|
965
|
-
|
|
966
|
-
Renders the parts within a chain of thought. Shared from `@assistant-ui/core/react`.
|
|
967
|
-
|
|
968
|
-
```tsx
|
|
969
|
-
<ChainOfThoughtPrimitive.Parts>
|
|
970
|
-
{({ part }) => {
|
|
971
|
-
if (part.type === "reasoning") return <Text>{part.text}</Text>;
|
|
972
|
-
if (part.type === "tool-call") return <MyToolComponent {...part} />;
|
|
973
|
-
return null;
|
|
974
|
-
}}
|
|
975
|
-
</ChainOfThoughtPrimitive.Parts>
|
|
976
|
-
```
|