@assistant-ui/mcp-docs-server 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/.docs/organized/code-examples/waterfall.md +8 -9
  2. package/.docs/organized/code-examples/with-a2a.md +16 -11
  3. package/.docs/organized/code-examples/with-ag-ui.md +16 -11
  4. package/.docs/organized/code-examples/{with-ai-sdk-v6.md → with-ai-sdk-v7.md} +32 -21
  5. package/.docs/organized/code-examples/with-artifacts.md +17 -10
  6. package/.docs/organized/code-examples/with-assistant-transport.md +15 -8
  7. package/.docs/organized/code-examples/with-browser-extension.md +15 -8
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +17 -10
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +10 -9
  10. package/.docs/organized/code-examples/with-cloud.md +18 -13
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +17 -10
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +20 -13
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -13
  14. package/.docs/organized/code-examples/with-eve.md +16 -9
  15. package/.docs/organized/code-examples/with-expo.md +27 -24
  16. package/.docs/organized/code-examples/with-external-store.md +16 -11
  17. package/.docs/organized/code-examples/with-ffmpeg.md +18 -13
  18. package/.docs/organized/code-examples/with-generative-ui.md +20 -15
  19. package/.docs/organized/code-examples/with-google-adk.md +15 -8
  20. package/.docs/organized/code-examples/with-heat-graph.md +8 -9
  21. package/.docs/organized/code-examples/with-image-generation.md +17 -10
  22. package/.docs/organized/code-examples/with-interactables.md +19 -15
  23. package/.docs/organized/code-examples/with-langchain.md +17 -10
  24. package/.docs/organized/code-examples/with-langgraph.md +17 -10
  25. package/.docs/organized/code-examples/with-livekit.md +21 -14
  26. package/.docs/organized/code-examples/with-mcp.md +25 -12
  27. package/.docs/organized/code-examples/with-opencode.md +22 -17
  28. package/.docs/organized/code-examples/with-pi.md +47 -12
  29. package/.docs/organized/code-examples/with-react-hook-form.md +19 -14
  30. package/.docs/organized/code-examples/with-react-ink-web.md +6 -6
  31. package/.docs/organized/code-examples/with-react-ink.md +2 -2
  32. package/.docs/organized/code-examples/with-react-router.md +20 -15
  33. package/.docs/organized/code-examples/with-resumable-stream.md +19 -12
  34. package/.docs/organized/code-examples/with-store.md +8 -9
  35. package/.docs/organized/code-examples/with-tanstack.md +16 -10
  36. package/.docs/organized/code-examples/with-tap-runtime.md +16 -11
  37. package/.docs/organized/code-examples/with-virtualized-thread.md +17 -12
  38. package/.docs/raw/docs/(docs)/base-ui.mdx +39 -0
  39. package/.docs/raw/docs/(docs)/cli.mdx +17 -1
  40. package/.docs/raw/docs/(docs)/installation.mdx +15 -1
  41. package/.docs/raw/docs/(docs)/rtl.mdx +2 -4
  42. package/.docs/raw/docs/(reference)/api-reference/generative-ui/actions.mdx +56 -0
  43. package/.docs/raw/docs/(reference)/api-reference/generative-ui/components.mdx +86 -0
  44. package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +19 -1
  45. package/.docs/raw/docs/(reference)/api-reference/generative-ui/json-generative-ui.mdx +42 -0
  46. package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +53 -2
  47. package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +81 -0
  48. package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +86 -0
  49. package/.docs/raw/docs/(reference)/api-reference/generative-ui/tokens.mdx +62 -0
  50. package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
  51. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +4 -2
  52. package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +37 -0
  53. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +1 -0
  54. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +29 -29
  55. package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +1 -0
  56. package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +3 -0
  57. package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +2 -0
  58. package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +0 -2
  59. package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +12 -9
  60. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +4 -0
  61. package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +7 -1
  62. package/.docs/raw/docs/cloud/langgraph.mdx +3 -1
  63. package/.docs/raw/docs/guides/chatgpt-subscription.mdx +108 -0
  64. package/.docs/raw/docs/guides/dictation.mdx +185 -257
  65. package/.docs/raw/docs/guides/index.mdx +10 -0
  66. package/.docs/raw/docs/guides/mentions.mdx +31 -3
  67. package/.docs/raw/docs/guides/resumable-streams.mdx +12 -1
  68. package/.docs/raw/docs/guides/speech.mdx +47 -29
  69. package/.docs/raw/docs/guides/suggestions.mdx +70 -1
  70. package/.docs/raw/docs/guides/voice.mdx +197 -267
  71. package/.docs/raw/docs/ink/primitives.mdx +35 -1
  72. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +10 -4
  73. package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +3 -3
  74. package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +1 -1
  75. package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +3 -3
  76. package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
  77. package/.docs/raw/docs/integrations/gateways/index.mdx +2 -2
  78. package/.docs/raw/docs/integrations/observability/helicone.mdx +1 -1
  79. package/.docs/raw/docs/integrations/observability/langfuse.mdx +1 -1
  80. package/.docs/raw/docs/integrations/observability/langsmith.mdx +1 -1
  81. package/.docs/raw/docs/migrations/index.mdx +50 -0
  82. package/.docs/raw/docs/migrations/toolkit-tools.mdx +4 -2
  83. package/.docs/raw/docs/primitives/chain-of-thought.mdx +6 -1
  84. package/.docs/raw/docs/primitives/composer.mdx +16 -0
  85. package/.docs/raw/docs/primitives/selection-toolbar.mdx +25 -0
  86. package/.docs/raw/docs/react-native/primitives.mdx +23 -0
  87. package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +124 -0
  88. package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +10 -1
  89. package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +13 -4
  90. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +11 -11
  91. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +5 -5
  92. package/.docs/raw/docs/runtimes/ai-sdk/{v6.mdx → v6-legacy.mdx} +8 -6
  93. package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +717 -0
  94. package/.docs/raw/docs/runtimes/concepts/adapters.mdx +1 -1
  95. package/.docs/raw/docs/runtimes/concepts/architecture.mdx +1 -1
  96. package/.docs/raw/docs/runtimes/custom/data-stream.mdx +10 -19
  97. package/.docs/raw/docs/runtimes/custom/external-store.mdx +1 -1
  98. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +2 -0
  99. package/.docs/raw/docs/runtimes/eve/overview.mdx +1 -1
  100. package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +181 -0
  101. package/.docs/raw/docs/tools/backend.mdx +6 -3
  102. package/.docs/raw/docs/tools/defining-tools.mdx +7 -1
  103. package/.docs/raw/docs/tools/generative-ui.mdx +60 -2
  104. package/.docs/raw/docs/tools/mcp-apps.mdx +29 -11
  105. package/.docs/raw/docs/tools/mcp.mdx +100 -3
  106. package/.docs/raw/docs/tools/tool-ui.mdx +6 -4
  107. package/.docs/raw/docs/tools/user-managed-mcp.mdx +26 -3
  108. package/.docs/raw/docs/ui/accordion.mdx +16 -10
  109. package/.docs/raw/docs/ui/assistant-modal.mdx +8 -4
  110. package/.docs/raw/docs/ui/attachment.mdx +5 -1
  111. package/.docs/raw/docs/ui/badge.mdx +23 -12
  112. package/.docs/raw/docs/ui/follow-up-suggestions.mdx +2 -2
  113. package/.docs/raw/docs/ui/model-selector.mdx +32 -2
  114. package/.docs/raw/docs/ui/select.mdx +22 -14
  115. package/.docs/raw/docs/ui/sources.mdx +1 -1
  116. package/.docs/raw/docs/ui/tabs.mdx +25 -14
  117. package/.docs/raw/docs/utilities/heat-graph.mdx +2 -2
  118. package/dist/constants.d.ts.map +1 -1
  119. package/dist/index.d.ts +0 -1
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +39 -0
  122. package/dist/index.js.map +1 -1
  123. package/dist/prepare-docs/code-examples.d.ts.map +1 -1
  124. package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
  125. package/dist/prompts/xulux-playground.d.ts +12 -0
  126. package/dist/prompts/xulux-playground.d.ts.map +1 -0
  127. package/dist/prompts/xulux-playground.js +33 -0
  128. package/dist/prompts/xulux-playground.js.map +1 -0
  129. package/dist/tools/docs.d.ts +2 -4
  130. package/dist/tools/docs.d.ts.map +1 -1
  131. package/dist/tools/docs.js +24 -8
  132. package/dist/tools/docs.js.map +1 -1
  133. package/dist/tools/examples.d.ts +2 -4
  134. package/dist/tools/examples.d.ts.map +1 -1
  135. package/dist/tools/examples.js +9 -6
  136. package/dist/tools/examples.js.map +1 -1
  137. package/dist/tools/resources.d.ts +0 -1
  138. package/dist/tools/resources.d.ts.map +1 -1
  139. package/dist/tools/search.d.ts +2 -5
  140. package/dist/tools/search.d.ts.map +1 -1
  141. package/dist/tools/tests/test-setup.d.ts.map +1 -1
  142. package/dist/tools/tests/test-setup.js +5 -1
  143. package/dist/tools/tests/test-setup.js.map +1 -1
  144. package/dist/tools/xulux-templates.d.ts +72 -0
  145. package/dist/tools/xulux-templates.d.ts.map +1 -0
  146. package/dist/tools/xulux-templates.js +82 -0
  147. package/dist/tools/xulux-templates.js.map +1 -0
  148. package/dist/utils/cache.d.ts +5 -0
  149. package/dist/utils/cache.d.ts.map +1 -0
  150. package/dist/utils/cache.js +18 -0
  151. package/dist/utils/cache.js.map +1 -0
  152. package/dist/utils/logger.d.ts.map +1 -1
  153. package/dist/utils/mcp-format.d.ts +1 -0
  154. package/dist/utils/mcp-format.d.ts.map +1 -1
  155. package/dist/utils/mcp-format.js +7 -4
  156. package/dist/utils/mcp-format.js.map +1 -1
  157. package/dist/utils/mdx.d.ts.map +1 -1
  158. package/dist/utils/paths.d.ts +1 -1
  159. package/dist/utils/paths.d.ts.map +1 -1
  160. package/dist/utils/paths.js +3 -1
  161. package/dist/utils/paths.js.map +1 -1
  162. package/dist/utils/search.d.ts.map +1 -1
  163. package/dist/utils/security.d.ts.map +1 -1
  164. package/dist/xulux/catalog-client.d.ts +14 -0
  165. package/dist/xulux/catalog-client.d.ts.map +1 -0
  166. package/dist/xulux/catalog-client.js +67 -0
  167. package/dist/xulux/catalog-client.js.map +1 -0
  168. package/dist/xulux/fallback-catalog.d.ts +7 -0
  169. package/dist/xulux/fallback-catalog.d.ts.map +1 -0
  170. package/dist/xulux/fallback-catalog.js +47 -0
  171. package/dist/xulux/fallback-catalog.js.map +1 -0
  172. package/dist/xulux/fetch-sandbox.d.ts +5 -0
  173. package/dist/xulux/fetch-sandbox.d.ts.map +1 -0
  174. package/dist/xulux/fetch-sandbox.js +40 -0
  175. package/dist/xulux/fetch-sandbox.js.map +1 -0
  176. package/dist/xulux/template-service.d.ts +84 -0
  177. package/dist/xulux/template-service.d.ts.map +1 -0
  178. package/dist/xulux/template-service.js +223 -0
  179. package/dist/xulux/template-service.js.map +1 -0
  180. package/dist/xulux/types.d.ts +55 -0
  181. package/dist/xulux/types.d.ts.map +1 -0
  182. package/dist/xulux/types.js +6 -0
  183. package/dist/xulux/types.js.map +1 -0
  184. package/package.json +5 -5
  185. package/src/index.ts +53 -0
  186. package/src/prompts/xulux-playground.ts +36 -0
  187. package/src/tools/docs.ts +25 -3
  188. package/src/tools/examples.ts +15 -10
  189. package/src/tools/tests/docs.test.ts +20 -0
  190. package/src/tools/tests/examples.test.ts +5 -5
  191. package/src/tools/tests/listings-cache.test.ts +19 -0
  192. package/src/tools/tests/mcp-protocol.test.ts +81 -1
  193. package/src/tools/tests/test-setup.ts +8 -0
  194. package/src/tools/tests/xulux-templates.test.ts +262 -0
  195. package/src/tools/xulux-templates.ts +141 -0
  196. package/src/utils/cache.ts +20 -0
  197. package/src/utils/mcp-format.ts +8 -6
  198. package/src/utils/paths.ts +4 -1
  199. package/src/utils/tests/cache.test.ts +51 -0
  200. package/src/utils/tests/mcp-format.test.ts +22 -0
  201. package/src/utils/tests/security.test.ts +1 -1
  202. package/src/xulux/catalog-client.ts +105 -0
  203. package/src/xulux/fallback-catalog.ts +63 -0
  204. package/src/xulux/fetch-sandbox.ts +56 -0
  205. package/src/xulux/template-service.ts +406 -0
  206. package/src/xulux/types.ts +60 -0
  207. package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +0 -464
@@ -1,464 +0,0 @@
1
- ---
2
- title: Utility Hooks
3
- description: Focused helpers for message parts, quotes, timing, and viewport behavior.
4
- ---
5
-
6
- Utility hooks expose commonly needed slices of assistant-ui behavior without requiring a full primitive.
7
-
8
- ## Message Helpers
9
-
10
- - `useMessageQuote` reads the quote state for the current message.
11
- - `useMessageTiming` reads timing metadata for the current message.
12
-
13
- ## Message Part Helpers
14
-
15
- - `useMessagePartText`
16
- - `useMessagePartReasoning`
17
- - `useMessagePartSource`
18
- - `useMessagePartFile`
19
- - `useMessagePartImage`
20
- - `useMessagePartData`
21
-
22
- These hooks are intended for custom message part renderers. They read the nearest message part context established by `MessagePrimitive.Parts`, `MessagePartPrimitive`, or the lower-level providers.
23
-
24
- ## Viewport Helpers
25
-
26
- - `useThreadViewport` reads and controls the thread viewport.
27
- - `useThreadViewportAutoScroll` wires auto-scroll behavior for custom viewport compositions.
28
- - `useScrollLock` helps reasoning and grouped-part UIs preserve scroll behavior while content changes.
29
-
30
- For primitive-specific prop APIs, see [Primitives](/docs/api-reference/primitives).
31
-
32
- {/* api-reference:start */}
33
- {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
34
- {/* Do not edit this block manually. */}
35
-
36
- ## API Reference
37
-
38
- Generated reference for Utilities.
39
-
40
- ### unstable_useCloudThreadListAdapter
41
-
42
- Deprecated: Use `useCloudThreadListAdapter` instead.
43
-
44
- ```tsx
45
- import { unstable_useCloudThreadListAdapter } from "@assistant-ui/react";
46
- ```
47
-
48
- Source: `packages/core/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx`
49
-
50
- ### unstable_useMentionAdapter
51
-
52
- Deprecated: Under active development and might change without notice.
53
-
54
- Creates a spreadable `\{ adapter, directive \}` bundle for `@` mentions.
55
- Supports tools registered via `useAssistantTool`, explicit items, or both —
56
- flat or categorized.
57
-
58
- ```tsx
59
- import { unstable_useMentionAdapter } from "@assistant-ui/react";
60
- ```
61
-
62
- Source: `packages/react/src/unstable/useMentionAdapter.ts`
63
-
64
- ### unstable_useSlashCommandAdapter
65
-
66
- Deprecated: Under active development and may change without notice.
67
-
68
- Bundles slash command definitions (with inline `execute` callbacks) into
69
- `\{adapter, action\}` that plug directly into `ComposerTriggerPopover`.
70
- `execute` stays in the hook closure and is never attached to the returned
71
- `TriggerItem`, keeping items serializable.
72
-
73
- ```tsx
74
- import { unstable_useSlashCommandAdapter } from "@assistant-ui/react";
75
- ```
76
-
77
- Source: `packages/react/src/unstable/useSlashCommandAdapter.ts`
78
-
79
- ### unstable_useTriggerPopoverRootContext
80
-
81
- ```tsx
82
- import { unstable_useTriggerPopoverRootContext } from "@assistant-ui/react";
83
- ```
84
-
85
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
86
-
87
- ### unstable_useTriggerPopoverRootContextOptional
88
-
89
- ```tsx
90
- import { unstable_useTriggerPopoverRootContextOptional } from "@assistant-ui/react";
91
- ```
92
-
93
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
94
-
95
- ### unstable_useTriggerPopoverScopeContext
96
-
97
- ```tsx
98
- import { unstable_useTriggerPopoverScopeContext } from "@assistant-ui/react";
99
- ```
100
-
101
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopover.tsx`
102
-
103
- ### unstable_useTriggerPopoverScopeContextOptional
104
-
105
- ```tsx
106
- import { unstable_useTriggerPopoverScopeContextOptional } from "@assistant-ui/react";
107
- ```
108
-
109
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopover.tsx`
110
-
111
- ### unstable_useTriggerPopoverTriggers
112
-
113
- Live map of registered triggers, re-rendering on change. Prefer
114
- `subscribeLifecycle` for incremental add/remove handling.
115
-
116
- ```tsx
117
- import { unstable_useTriggerPopoverTriggers } from "@assistant-ui/react";
118
- ```
119
-
120
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
121
-
122
- ### unstable_useTriggerPopoverTriggersOptional
123
-
124
- Like `useTriggerPopoverTriggers` but returns an empty map outside a root.
125
-
126
- ```tsx
127
- import { unstable_useTriggerPopoverTriggersOptional } from "@assistant-ui/react";
128
- ```
129
-
130
- Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
131
-
132
- ### useAssistantApi
133
-
134
- Deprecated: Use `useAui` instead. This alias will be removed in v0.13.
135
-
136
- ```tsx
137
- import { useAssistantApi } from "@assistant-ui/react";
138
- ```
139
-
140
- Source: `packages/store/src/useAui.ts`
141
-
142
- ### useAssistantEvent
143
-
144
- Deprecated: Use `useAuiEvent` instead. This alias will be removed in v0.13.
145
-
146
- ```tsx
147
- import { useAssistantEvent } from "@assistant-ui/react";
148
- ```
149
-
150
- Source: `packages/store/src/useAuiEvent.ts`
151
-
152
- ### useAssistantFrameHost
153
-
154
- React hook that manages the lifecycle of an AssistantFrameHost and its binding to the current AssistantRuntime.
155
-
156
- Usage example:
157
- ```typescript
158
- function MyComponent() {
159
- const iframeRef = useRef<HTMLIFrameElement>(null);
160
-
161
- useAssistantFrameHost({
162
- iframeRef,
163
- targetOrigin: "https://trusted-domain.com", // optional
164
- });
165
-
166
- return <iframe ref={iframeRef} src="..." />;
167
- }
168
- ```
169
-
170
- ```tsx
171
- import { useAssistantFrameHost } from "@assistant-ui/react";
172
- ```
173
-
174
- Source: `packages/react/src/model-context/frame/useAssistantFrameHost.ts`
175
-
176
- ### useAssistantState
177
-
178
- Deprecated: Use `useAuiState` instead. This alias will be removed in v0.13.
179
-
180
- Hook to access a slice of the assistant state with automatic subscription
181
-
182
- ```tsx
183
- import { useAssistantState } from "@assistant-ui/react";
184
- ```
185
-
186
- Source: `packages/store/src/useAuiState.ts`
187
-
188
- ### useAttachment
189
-
190
- Deprecated: Use `useAuiState((s) =&gt; s.attachment)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
191
-
192
- ```tsx
193
- import { useAttachment } from "@assistant-ui/react";
194
- ```
195
-
196
- Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
197
-
198
- ### useCloudThreadListAdapter
199
-
200
- ```tsx
201
- import { useCloudThreadListAdapter } from "@assistant-ui/react";
202
- ```
203
-
204
- Source: `packages/core/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx`
205
-
206
- ### useComposer
207
-
208
- Deprecated: Use `useAuiState((s) =&gt; s.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
209
-
210
- Hook to access the current composer state.
211
-
212
- This hook provides reactive access to the composer's state, including text content,
213
- attachments, editing status, and send/cancel capabilities.
214
-
215
- ```tsx
216
- import { useComposer } from "@assistant-ui/react";
217
- ```
218
-
219
- Source: `packages/react/src/legacy-runtime/hooks/ComposerContext.ts`
220
-
221
- ### useEditComposer
222
-
223
- Deprecated: Use `useAuiState((s) =&gt; s.message.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
224
-
225
- ```tsx
226
- import { useEditComposer } from "@assistant-ui/react";
227
- ```
228
-
229
- Source: `packages/react/src/legacy-runtime/hooks/MessageContext.ts`
230
-
231
- ### useEditComposerAttachment
232
-
233
- ```tsx
234
- import { useEditComposerAttachment } from "@assistant-ui/react";
235
- ```
236
-
237
- Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
238
-
239
- ### useExternalMessageConverter
240
-
241
- ```tsx
242
- import { useExternalMessageConverter } from "@assistant-ui/react";
243
- ```
244
-
245
- Source: `packages/core/src/react/runtimes/external-message-converter.ts`
246
-
247
- ### useMessage
248
-
249
- Deprecated: Use `useAuiState((s) =&gt; s.message)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
250
-
251
- Hook to access the current message state.
252
-
253
- This hook provides reactive access to the message's state, including content,
254
- role, status, and other message-level properties.
255
-
256
- ```tsx
257
- import { useMessage } from "@assistant-ui/react";
258
- ```
259
-
260
- Source: `packages/react/src/legacy-runtime/hooks/MessageContext.ts`
261
-
262
- ### useMessageAttachment
263
-
264
- ```tsx
265
- import { useMessageAttachment } from "@assistant-ui/react";
266
- ```
267
-
268
- Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
269
-
270
- ### useMessagePart
271
-
272
- Deprecated: Use `useAuiState((s) =&gt; s.part)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
273
-
274
- ```tsx
275
- import { useMessagePart } from "@assistant-ui/react";
276
- ```
277
-
278
- Source: `packages/react/src/legacy-runtime/hooks/MessagePartContext.ts`
279
-
280
- ### useMessagePartData
281
-
282
- ```tsx
283
- import { useMessagePartData } from "@assistant-ui/react";
284
- ```
285
-
286
- Source: `packages/react/src/primitives/messagePart/useMessagePartData.ts`
287
-
288
- ### useMessagePartFile
289
-
290
- ```tsx
291
- import { useMessagePartFile } from "@assistant-ui/react";
292
- ```
293
-
294
- Source: `packages/react/src/primitives/messagePart/useMessagePartFile.ts`
295
-
296
- ### useMessagePartImage
297
-
298
- ```tsx
299
- import { useMessagePartImage } from "@assistant-ui/react";
300
- ```
301
-
302
- Source: `packages/react/src/primitives/messagePart/useMessagePartImage.ts`
303
-
304
- ### useMessagePartReasoning
305
-
306
- ```tsx
307
- import { useMessagePartReasoning } from "@assistant-ui/react";
308
- ```
309
-
310
- Source: `packages/react/src/primitives/messagePart/useMessagePartReasoning.ts`
311
-
312
- ### useMessagePartSource
313
-
314
- ```tsx
315
- import { useMessagePartSource } from "@assistant-ui/react";
316
- ```
317
-
318
- Source: `packages/react/src/primitives/messagePart/useMessagePartSource.ts`
319
-
320
- ### useMessagePartText
321
-
322
- ```tsx
323
- import { useMessagePartText } from "@assistant-ui/react";
324
- ```
325
-
326
- Source: `packages/react/src/primitives/messagePart/useMessagePartText.ts`
327
-
328
- ### useMessageQuote
329
-
330
- Hook that returns the quote info for the current message, if any.
331
-
332
- Reads from `message.metadata.custom.quote`.
333
-
334
- ```tsx
335
- import { useMessageQuote } from "@assistant-ui/react";
336
- ```
337
-
338
- Source: `packages/react/src/hooks/useMessageQuote.ts`
339
-
340
- ### useMessageTiming
341
-
342
- Hook that returns timing information for the current assistant message.
343
-
344
- Reads from `message.metadata.timing`.
345
-
346
- ```tsx
347
- import { useMessageTiming } from "@assistant-ui/react";
348
- ```
349
-
350
- Source: `packages/react/src/hooks/useMessageTiming.ts`
351
-
352
- ### useRuntimeAdapters
353
-
354
- ```tsx
355
- import { useRuntimeAdapters } from "@assistant-ui/react";
356
- ```
357
-
358
- Source: `packages/core/src/react/runtimes/RuntimeAdapterProvider.tsx`
359
-
360
- ### useScrollLock
361
-
362
- Locks scroll position during collapsible/height animations and hides scrollbar.
363
-
364
- This utility prevents page jumps when content height changes during animations,
365
- providing a smooth user experience. It finds the nearest scrollable ancestor and
366
- temporarily locks its scroll position while the animation completes.
367
-
368
- - Prevents forced reflows: no layout reads, mutations scoped to scrollable parent only
369
- - Reactive: only intercepts scroll events when browser actually adjusts
370
- - Cleans up automatically after animation duration
371
-
372
- ```tsx
373
- import { useScrollLock } from "@assistant-ui/react";
374
- ```
375
-
376
- Source: `packages/react/src/primitives/reasoning/useScrollLock.ts`
377
-
378
- ### useThread
379
-
380
- Deprecated: Use `useAuiState((s) =&gt; s.thread)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
381
-
382
- Hook to access the current thread state.
383
-
384
- This hook provides reactive access to the thread's state, including messages,
385
- running status, capabilities, and other thread-level properties.
386
-
387
- ```tsx
388
- import { useThread } from "@assistant-ui/react";
389
- ```
390
-
391
- Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
392
-
393
- ### useThreadComposer
394
-
395
- Deprecated: Use `useAuiState((s) =&gt; s.thread.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
396
-
397
- ```tsx
398
- import { useThreadComposer } from "@assistant-ui/react";
399
- ```
400
-
401
- Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
402
-
403
- ### useThreadComposerAttachment
404
-
405
- ```tsx
406
- import { useThreadComposerAttachment } from "@assistant-ui/react";
407
- ```
408
-
409
- Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
410
-
411
- ### useThreadList
412
-
413
- Deprecated: Use `useAuiState((s) =&gt; s.threads)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
414
-
415
- ```tsx
416
- import { useThreadList } from "@assistant-ui/react";
417
- ```
418
-
419
- Source: `packages/react/src/legacy-runtime/hooks/AssistantContext.ts`
420
-
421
- ### useThreadListItem
422
-
423
- Deprecated: Use `useAuiState((s) =&gt; s.threadListItem)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
424
-
425
- ```tsx
426
- import { useThreadListItem } from "@assistant-ui/react";
427
- ```
428
-
429
- Source: `packages/react/src/legacy-runtime/hooks/ThreadListItemContext.ts`
430
-
431
- ### useThreadModelContext
432
-
433
- Deprecated: Use `useAuiState((s) =&gt; s.thread.modelContext)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
434
-
435
- ```tsx
436
- import { useThreadModelContext } from "@assistant-ui/react";
437
- ```
438
-
439
- Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
440
-
441
- ### useThreadViewport
442
-
443
- ```tsx
444
- import { useThreadViewport } from "@assistant-ui/react";
445
- ```
446
-
447
- Source: `packages/react/src/context/react/ThreadViewportContext.ts`
448
-
449
- ### useThreadViewportAutoScroll
450
-
451
- ```tsx
452
- import { useThreadViewportAutoScroll } from "@assistant-ui/react";
453
- ```
454
-
455
- Source: `packages/react/src/primitives/thread/useThreadViewportAutoScroll.ts`
456
-
457
- ### useThreadViewportStore
458
-
459
- ```tsx
460
- import { useThreadViewportStore } from "@assistant-ui/react";
461
- ```
462
-
463
- Source: `packages/react/src/context/react/ThreadViewportContext.ts`
464
- {/* api-reference:end */}