@assistant-ui/mcp-docs-server 0.1.31 → 0.1.33

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 (281) hide show
  1. package/.docs/organized/code-examples/waterfall.md +23 -25
  2. package/.docs/organized/code-examples/with-a2a.md +28 -28
  3. package/.docs/organized/code-examples/with-ag-ui.md +35 -30
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +16 -14
  5. package/.docs/organized/code-examples/with-artifacts.md +44 -38
  6. package/.docs/organized/code-examples/with-assistant-transport.md +68 -56
  7. package/.docs/organized/code-examples/with-browser-extension.md +357 -0
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +425 -90
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +30 -29
  10. package/.docs/organized/code-examples/with-cloud.md +16 -14
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +19 -17
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +29 -26
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -18
  14. package/.docs/organized/code-examples/with-expo.md +37 -31
  15. package/.docs/organized/code-examples/with-external-store.md +13 -11
  16. package/.docs/organized/code-examples/with-ffmpeg.md +327 -290
  17. package/.docs/organized/code-examples/with-generative-ui.md +1195 -194
  18. package/.docs/organized/code-examples/with-google-adk.md +13 -11
  19. package/.docs/organized/code-examples/with-heat-graph.md +16 -14
  20. package/.docs/organized/code-examples/with-image-generation.md +456 -0
  21. package/.docs/organized/code-examples/with-interactables.md +322 -244
  22. package/.docs/organized/code-examples/with-langchain.md +18 -16
  23. package/.docs/organized/code-examples/with-langgraph.md +95 -88
  24. package/.docs/organized/code-examples/with-livekit.md +30 -27
  25. package/.docs/organized/code-examples/with-mcp.md +754 -0
  26. package/.docs/organized/code-examples/with-opencode.md +70 -70
  27. package/.docs/organized/code-examples/with-react-hook-form.md +24 -22
  28. package/.docs/organized/code-examples/with-react-ink.md +4 -4
  29. package/.docs/organized/code-examples/with-react-router.md +20 -18
  30. package/.docs/organized/code-examples/with-resumable-stream.md +661 -0
  31. package/.docs/organized/code-examples/with-store.md +22 -20
  32. package/.docs/organized/code-examples/with-tanstack.md +18 -19
  33. package/.docs/organized/code-examples/with-tap-runtime.md +31 -28
  34. package/.docs/raw/docs/(docs)/architecture.mdx +43 -2
  35. package/.docs/raw/docs/(docs)/cli.mdx +2 -2
  36. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +34 -26
  37. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +32 -26
  38. package/.docs/raw/docs/(docs)/index.mdx +2 -2
  39. package/.docs/raw/docs/(docs)/installation.mdx +2 -2
  40. package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +26 -24
  41. package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
  42. package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +20 -12
  43. package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
  44. package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +41 -16
  45. package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +12 -23
  46. package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +20 -0
  47. package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +37 -8
  48. package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +11 -9
  49. package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +64 -0
  50. package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +22 -0
  51. package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +52 -0
  52. package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +46 -0
  53. package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +18 -0
  54. package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +33 -0
  55. package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +45 -0
  56. package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +98 -0
  57. package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +18 -13
  58. package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +31 -52
  59. package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
  60. package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +15 -28
  61. package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +64 -18
  62. package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +434 -0
  63. package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +24 -0
  64. package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +11 -12
  65. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +109 -0
  66. package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +58 -0
  67. package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +22 -0
  68. package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +20 -0
  69. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +109 -132
  70. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +78 -221
  71. package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +127 -242
  72. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +39 -20
  73. package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +66 -87
  74. package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +50 -58
  75. package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +80 -48
  76. package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +67 -0
  77. package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +323 -461
  78. package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +36 -43
  79. package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +29 -24
  80. package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
  81. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +202 -588
  82. package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +65 -0
  83. package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +35 -22
  84. package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +57 -140
  85. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +70 -161
  86. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +84 -108
  87. package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +77 -96
  88. package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -349
  89. package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +9 -21
  90. package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +10 -21
  91. package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +15 -70
  92. package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +18 -13
  93. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +25 -28
  94. package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +11 -63
  95. package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +20 -0
  96. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +11 -48
  97. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +10 -47
  98. package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +18 -30
  99. package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +85 -0
  100. package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
  101. package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +127 -0
  102. package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
  103. package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +91 -0
  104. package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +48 -0
  105. package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +62 -0
  106. package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +22 -0
  107. package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +19 -0
  108. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +143 -0
  109. package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +22 -0
  110. package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +54 -0
  111. package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +36 -0
  112. package/.docs/raw/docs/cloud/ai-sdk.mdx +1 -3
  113. package/.docs/raw/docs/cloud/index.mdx +2 -2
  114. package/.docs/raw/docs/guides/attachments.mdx +4 -4
  115. package/.docs/raw/docs/guides/branching.mdx +1 -1
  116. package/.docs/raw/docs/guides/chain-of-thought.mdx +12 -14
  117. package/.docs/raw/docs/guides/context-api.mdx +6 -5
  118. package/.docs/raw/docs/guides/dictation.mdx +2 -2
  119. package/.docs/raw/docs/guides/editing.mdx +1 -1
  120. package/.docs/raw/docs/guides/image-generation.mdx +74 -0
  121. package/.docs/raw/docs/guides/index.mdx +5 -14
  122. package/.docs/raw/docs/guides/latex.mdx +2 -2
  123. package/.docs/raw/docs/guides/mentions.mdx +6 -6
  124. package/.docs/raw/docs/guides/message-timing.mdx +38 -5
  125. package/.docs/raw/docs/guides/quoting.mdx +1 -1
  126. package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +212 -0
  127. package/.docs/raw/docs/guides/resumable-stream-stores.mdx +152 -0
  128. package/.docs/raw/docs/guides/resumable-streams.mdx +210 -0
  129. package/.docs/raw/docs/guides/slash-commands.mdx +2 -2
  130. package/.docs/raw/docs/guides/speech.mdx +2 -2
  131. package/.docs/raw/docs/guides/suggestions.mdx +89 -5
  132. package/.docs/raw/docs/guides/voice.mdx +2 -2
  133. package/.docs/raw/docs/ink/adapters.mdx +37 -1
  134. package/.docs/raw/docs/ink/custom-backend.mdx +59 -8
  135. package/.docs/raw/docs/ink/hooks.mdx +98 -85
  136. package/.docs/raw/docs/ink/index.mdx +10 -11
  137. package/.docs/raw/docs/ink/migration.mdx +1 -1
  138. package/.docs/raw/docs/ink/primitives.mdx +350 -9
  139. package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
  140. package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
  141. package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
  142. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
  143. package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
  144. package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +2 -2
  145. package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
  146. package/.docs/raw/docs/integrations/gateways/index.mdx +9 -4
  147. package/.docs/raw/docs/integrations/index.mdx +17 -5
  148. package/.docs/raw/docs/integrations/observability/langfuse.mdx +8 -1
  149. package/.docs/raw/docs/integrations/observability/langsmith.mdx +8 -4
  150. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +17 -2
  151. package/.docs/raw/docs/migrations/toolkit-tools.mdx +226 -0
  152. package/.docs/raw/docs/primitives/chain-of-thought.mdx +10 -16
  153. package/.docs/raw/docs/primitives/composer.mdx +53 -0
  154. package/.docs/raw/docs/primitives/index.mdx +2 -2
  155. package/.docs/raw/docs/primitives/message.mdx +9 -10
  156. package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
  157. package/.docs/raw/docs/react-native/hooks.mdx +57 -82
  158. package/.docs/raw/docs/react-native/index.mdx +4 -4
  159. package/.docs/raw/docs/react-native/migration.mdx +1 -1
  160. package/.docs/raw/docs/react-native/primitives.mdx +2 -2
  161. package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +7 -4
  162. package/.docs/raw/docs/runtimes/a2a/overview.mdx +2 -2
  163. package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +2 -2
  164. package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +32 -1
  165. package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +2 -2
  166. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +7 -2
  167. package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
  168. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +129 -1
  169. package/.docs/raw/docs/runtimes/concepts/threads.mdx +7 -1
  170. package/.docs/raw/docs/runtimes/custom/data-stream.mdx +27 -2
  171. package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -1
  172. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +18 -7
  173. package/.docs/raw/docs/runtimes/custom/overview.mdx +2 -2
  174. package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +108 -38
  175. package/.docs/raw/docs/runtimes/google-adk/overview.mdx +2 -2
  176. package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
  177. package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +2 -2
  178. package/.docs/raw/docs/runtimes/langgraph/overview.mdx +2 -2
  179. package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +1 -1
  180. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +64 -50
  181. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +98 -86
  182. package/.docs/raw/docs/runtimes/opencode/overview.mdx +2 -2
  183. package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
  184. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +12 -5
  185. package/.docs/raw/docs/tools/backend.mdx +136 -0
  186. package/.docs/raw/docs/tools/defining-tools.mdx +413 -0
  187. package/.docs/raw/docs/tools/dynamic-tools.mdx +110 -0
  188. package/.docs/raw/docs/tools/generative-ui.mdx +214 -0
  189. package/.docs/raw/docs/tools/index.mdx +76 -0
  190. package/.docs/raw/docs/{guides → tools}/interactables.mdx +3 -3
  191. package/.docs/raw/docs/tools/mcp-apps.mdx +231 -0
  192. package/.docs/raw/docs/{integrations/tools → tools}/mcp.mdx +77 -50
  193. package/.docs/raw/docs/{guides → tools}/multi-agent.mdx +19 -21
  194. package/.docs/raw/docs/tools/tool-ui.mdx +967 -0
  195. package/.docs/raw/docs/tools/user-managed-mcp.mdx +337 -0
  196. package/.docs/raw/docs/ui/composer-trigger-popover.mdx +11 -1
  197. package/.docs/raw/docs/ui/directive-text.mdx +3 -3
  198. package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
  199. package/.docs/raw/docs/ui/model-selector.mdx +8 -8
  200. package/.docs/raw/docs/ui/part-grouping.mdx +84 -50
  201. package/.docs/raw/docs/ui/reasoning.mdx +4 -5
  202. package/.docs/raw/docs/ui/sources.mdx +17 -0
  203. package/.docs/raw/docs/ui/streamdown.mdx +34 -2
  204. package/.docs/raw/docs/ui/thread-list.mdx +2 -2
  205. package/.docs/raw/docs/ui/thread.mdx +2 -2
  206. package/.docs/raw/docs/ui/tool-group.mdx +5 -6
  207. package/.docs/raw/docs/utilities/heat-graph.mdx +1 -1
  208. package/README.md +14 -72
  209. package/dist/constants.d.ts +12 -9
  210. package/dist/constants.d.ts.map +1 -1
  211. package/dist/constants.js +13 -9
  212. package/dist/constants.js.map +1 -1
  213. package/dist/index.d.ts +7 -3
  214. package/dist/index.d.ts.map +1 -1
  215. package/dist/index.js +25 -24
  216. package/dist/index.js.map +1 -1
  217. package/dist/prepare-docs/code-examples.d.ts +4 -1
  218. package/dist/prepare-docs/code-examples.d.ts.map +1 -1
  219. package/dist/prepare-docs/code-examples.js +109 -121
  220. package/dist/prepare-docs/code-examples.js.map +1 -1
  221. package/dist/prepare-docs/copy-raw.d.ts +4 -1
  222. package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
  223. package/dist/prepare-docs/copy-raw.js +45 -42
  224. package/dist/prepare-docs/copy-raw.js.map +1 -1
  225. package/dist/prepare-docs/prepare.d.ts +1 -2
  226. package/dist/prepare-docs/prepare.js +17 -17
  227. package/dist/prepare-docs/prepare.js.map +1 -1
  228. package/dist/stdio.d.ts +1 -3
  229. package/dist/stdio.js +6 -3
  230. package/dist/stdio.js.map +1 -1
  231. package/dist/tools/docs.d.ts +20 -15
  232. package/dist/tools/docs.d.ts.map +1 -1
  233. package/dist/tools/docs.js +140 -161
  234. package/dist/tools/docs.js.map +1 -1
  235. package/dist/tools/examples.d.ts +20 -15
  236. package/dist/tools/examples.d.ts.map +1 -1
  237. package/dist/tools/examples.js +74 -86
  238. package/dist/tools/examples.js.map +1 -1
  239. package/dist/tools/tests/test-setup.d.ts +5 -2
  240. package/dist/tools/tests/test-setup.d.ts.map +1 -1
  241. package/dist/tools/tests/test-setup.js +21 -28
  242. package/dist/tools/tests/test-setup.js.map +1 -1
  243. package/dist/utils/logger.d.ts +8 -5
  244. package/dist/utils/logger.d.ts.map +1 -1
  245. package/dist/utils/logger.js +17 -17
  246. package/dist/utils/logger.js.map +1 -1
  247. package/dist/utils/mcp-format.d.ts +8 -5
  248. package/dist/utils/mcp-format.d.ts.map +1 -1
  249. package/dist/utils/mcp-format.js +9 -9
  250. package/dist/utils/mcp-format.js.map +1 -1
  251. package/dist/utils/mdx.d.ts +8 -6
  252. package/dist/utils/mdx.d.ts.map +1 -1
  253. package/dist/utils/mdx.js +22 -22
  254. package/dist/utils/mdx.js.map +1 -1
  255. package/dist/utils/paths.d.ts +9 -6
  256. package/dist/utils/paths.d.ts.map +1 -1
  257. package/dist/utils/paths.js +66 -76
  258. package/dist/utils/paths.js.map +1 -1
  259. package/dist/utils/security.d.ts +4 -1
  260. package/dist/utils/security.d.ts.map +1 -1
  261. package/dist/utils/security.js +19 -40
  262. package/dist/utils/security.js.map +1 -1
  263. package/package.json +5 -5
  264. package/.docs/organized/code-examples/with-parent-id-grouping.md +0 -596
  265. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -151
  266. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -230
  267. package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +0 -41
  268. package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -40
  269. package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -260
  270. package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -103
  271. package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -254
  272. package/.docs/raw/docs/guides/tool-ui.mdx +0 -858
  273. package/.docs/raw/docs/guides/tools.mdx +0 -675
  274. package/dist/prepare-docs/prepare.d.ts.map +0 -1
  275. package/dist/stdio.d.ts.map +0 -1
  276. /package/.docs/raw/docs/{(reference)/migrations → migrations}/deprecation-policy.mdx +0 -0
  277. /package/.docs/raw/docs/{(reference) → migrations}/react-compatibility.mdx +0 -0
  278. /package/.docs/raw/docs/{(reference)/migrations → migrations}/react-langgraph-v0-7.mdx +0 -0
  279. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-11.mdx +0 -0
  280. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-12.mdx +0 -0
  281. /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-14.mdx +0 -0
@@ -1,87 +1,32 @@
1
1
  ---
2
2
  title: ComposerRuntime
3
- description: Runtime for programmatically controlling the message composer.
3
+ description: ComposerRuntime state and actions for controlling assistant-ui composer text, attachments, submission, cancellation, and pending input.
4
4
  ---
5
5
 
6
- The composer runtime allows you to view or edit anything related to how new information is added and sent. For instance you can use the composer runtime to read the state, add attachments, update text, send a message, etc.
6
+ import { ComposerRuntime, ComposerState, EditComposerRuntime, EditComposerState } from "@/generated/typeDocs";
7
7
 
8
- import { ComposerRuntime, ThreadComposerRuntime, EditComposerRuntime, ThreadComposerState } from "@/generated/typeDocs";
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
9
10
 
10
- ### `useAui` (Composer Actions)
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
11
14
 
12
- Grabs the nearest composer (whether it’s the edit composer or the thread’s composer) via `useAui`:
15
+ ## API Reference
13
16
 
14
- ```tsx
15
- // Example
16
- import { useAui } from "@assistant-ui/react";
17
-
18
- const aui = useAui();
19
-
20
- // set the text
21
- aui.composer().setText("Hello from the composer");
22
-
23
- // send whatever is in the composer
24
- aui.composer().send();
25
-
26
- // get the current text in the composer state
27
- const composerState = aui.composer().getState();
28
- const currentText = composerState.text;
29
-
30
- ```
17
+ ### ComposerRuntime
31
18
 
32
19
  <ParametersTable {...ComposerRuntime} />
33
20
 
21
+ ### ComposerState
34
22
 
35
- ### `useAuiState` (Thread Composer State)
36
-
37
- Access the thread’s new message composer state:
38
-
39
- ```tsx
40
- import { useAuiState, useAui } from "@assistant-ui/react";
41
-
42
- const text = useAuiState((s) => s.composer.text);
43
- const isEmpty = useAuiState((s) => s.composer.isEmpty);
44
-
45
- // For actions, use useAui
46
- const aui = useAui();
47
-
48
- // set the text
49
- aui.composer().setText("Hello from the thread composer");
50
-
51
- // send whatever is in the thread composer
52
- aui.composer().send();
53
-
54
- ```
23
+ <ParametersTable {...ComposerState} />
55
24
 
56
- <ParametersTable {...ThreadComposerRuntime} />
57
-
58
-
59
- ### `useAui` (Edit Composer Actions)
60
-
61
- Access edit composer actions via `useAui` from within a message component:
62
-
63
- ```tsx
64
- import { useAui } from "@assistant-ui/react";
65
-
66
- const aui = useAui();
67
-
68
- // Begin editing the current message (populates the composer with its content)
69
- aui.message().composer().beginEdit();
70
-
71
- // Update the text and send the edit
72
- aui.message().composer().setText("Updated message text");
73
- aui.message().composer().send();
74
-
75
- // Cancel editing without saving
76
- aui.message().composer().cancel();
77
- ```
25
+ ### EditComposerRuntime
78
26
 
79
27
  <ParametersTable {...EditComposerRuntime} />
80
28
 
81
- ### `ThreadComposerState`
82
-
83
- The state of the thread composer which is the composer the user can interact with at the bottom.
84
-
85
- <ParametersTable {...ThreadComposerState} />
86
-
29
+ ### EditComposerState
87
30
 
31
+ <ParametersTable {...EditComposerState} />
32
+ {/* api-reference:end */}
@@ -1,38 +1,43 @@
1
1
  ---
2
- title: Overview
3
- description: Runtime action and state references used by useAui and useAuiState.
2
+ title: Runtime State API Reference
3
+ description: Runtime state and actions exposed through useAui and useAuiState, covering AssistantRuntime, ThreadRuntime, ThreadListRuntime, ComposerRuntime, MessageRuntime, and attachment APIs for controlling assistant-ui chat.
4
4
  ---
5
5
 
6
- {/* AUTO-GENERATED by scripts/generate-api-reference-overviews.mts */}
7
- {/* Do not edit manually. */}
6
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
7
+ {/* The page list is generated from exported APIs; edit only the manual prose slot. */}
8
8
 
9
- Runtime state pages document the objects exposed through `useAui` and `useAuiState`. Use this section when you need to control assistant-ui programmatically or inspect the exact state available in a context.
9
+ {/* api-manual:start */}
10
+ Runtime state is the typed control surface behind assistant-ui. These pages document the actions and state objects available through `useAui`, `useAuiState`, and scoped runtimes.
11
+ {/* api-manual:end */}
10
12
 
11
13
  ## Pages
12
14
 
13
15
  <Cards>
14
16
  <Card title={"AssistantRuntime"} href={"/docs/api-reference/runtimes/assistant-runtime"}>
15
- {"Root runtime for managing threads, tool UIs, and assistant state."}
17
+ {"Top-level assistant-ui runtime actions and state for tools, threads, composers, messages, and assistant behavior."}
16
18
  </Card>
17
19
  <Card title={"AttachmentRuntime"} href={"/docs/api-reference/runtimes/attachment-runtime"}>
18
- {"Hooks for accessing attachment state in composer and messages."}
20
+ {"AttachmentRuntime state and actions for reading attachment data and controlling files inside assistant-ui messages and composers."}
19
21
  </Card>
20
22
  <Card title={"ComposerRuntime"} href={"/docs/api-reference/runtimes/composer-runtime"}>
21
- {"Runtime for programmatically controlling the message composer."}
23
+ {"ComposerRuntime state and actions for controlling assistant-ui composer text, attachments, submission, cancellation, and pending input."}
22
24
  </Card>
23
25
  <Card title={"MessagePartRuntime"} href={"/docs/api-reference/runtimes/message-part-runtime"}>
24
- {"Hook for accessing message part state within parts."}
26
+ {"MessagePartRuntime state and helpers for inspecting assistant-ui text, tool calls, data parts, reasoning, and custom message content."}
25
27
  </Card>
26
28
  <Card title={"MessageRuntime"} href={"/docs/api-reference/runtimes/message-runtime"}>
27
- {"Hooks for accessing message state and edit composer."}
29
+ {"MessageRuntime state and actions for editing, reloading, copying, rating, speaking, and branching assistant-ui messages."}
30
+ </Card>
31
+ <Card title={"QueueItemState"} href={"/docs/api-reference/runtimes/queue-state"}>
32
+ {"State shape for queued assistant-ui thread operations and pending runtime work."}
28
33
  </Card>
29
34
  <Card title={"ThreadListItemRuntime"} href={"/docs/api-reference/runtimes/thread-list-item-runtime"}>
30
- {"Runtime for managing individual thread list items."}
35
+ {"ThreadListItemRuntime state and actions for selecting, archiving, unarchiving, deleting, and renaming assistant-ui conversations."}
31
36
  </Card>
32
37
  <Card title={"ThreadListRuntime"} href={"/docs/api-reference/runtimes/thread-list-runtime"}>
33
- {"Runtime for accessing and managing the list of threads."}
38
+ {"ThreadListRuntime state and actions for managing remote assistant-ui conversations, active thread selection, and new thread creation."}
34
39
  </Card>
35
40
  <Card title={"ThreadRuntime"} href={"/docs/api-reference/runtimes/thread-runtime"}>
36
- {"Runtime for thread state, messages, and viewport management."}
41
+ {"ThreadRuntime state and actions for controlling assistant-ui messages, composers, suggestions, model context, and the full thread lifecycle."}
37
42
  </Card>
38
43
  </Cards>
@@ -1,46 +1,43 @@
1
1
  ---
2
2
  title: MessagePartRuntime
3
- description: Hook for accessing message part state within parts.
3
+ description: MessagePartRuntime state and helpers for inspecting assistant-ui text, tool calls, data parts, reasoning, and custom message content.
4
4
  ---
5
5
 
6
- import { MessagePartRuntime, TextMessagePartState } from "@/generated/typeDocs";
6
+ import { EnrichedPartState, MessagePartRuntime, MessagePartState, PartState } from "@/generated/typeDocs";
7
7
 
8
- ### `useAui` (Message Part Actions)
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
9
10
 
10
- Access message part actions via `useAui`:
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
11
14
 
12
- ```tsx
13
- import { useAui } from "@assistant-ui/react";
15
+ ## API Reference
14
16
 
15
- const aui = useAui();
17
+ ### EnrichedPartState
16
18
 
17
- // Add a tool result to a tool-call message part
18
- aui.part().addToolResult({ result: "Tool output" });
19
+ Enriched part state passed to children render functions.
19
20
 
20
- // Resume an interrupted tool call
21
- aui.part().resumeToolCall({ approved: true });
22
- ```
21
+ For tool-call parts, adds `toolUI`, `addResult`, and `resume`.
22
+ For data parts, adds `dataRendererUI`.
23
23
 
24
- <ParametersTable {...MessagePartRuntime} />
25
-
26
- ### `useAuiState` (Message Part State)
24
+ The render function is also invoked once with a synthetic empty text part
25
+ (`{ type: "text", text: "", status: { type: "running" } }`) when the
26
+ assistant message has no parts yet but is in the running state, so a
27
+ loading indicator can render. Differentiate this from a real empty text
28
+ via `part.status?.type === "running" && part.text === ""`.
27
29
 
28
- Access the message part state reactively:
30
+ <ParametersTable {...EnrichedPartState} />
29
31
 
30
- ```tsx
31
- import { useAuiState } from "@assistant-ui/react";
32
+ ### MessagePartRuntime
32
33
 
33
- const status = useAuiState((s) => s.part.status);
34
- const type = useAuiState((s) => s.part.type);
35
- ```
34
+ <ParametersTable {...MessagePartRuntime} />
36
35
 
37
- For imperative access, use `useAui`:
36
+ ### MessagePartState
38
37
 
39
- ```tsx
40
- import { useAui } from "@assistant-ui/react";
38
+ <ParametersTable {...MessagePartState} />
41
39
 
42
- const aui = useAui();
43
- const partState = aui.part().getState();
44
- ```
40
+ ### PartState
45
41
 
46
- <ParametersTable {...TextMessagePartState} />
42
+ <ParametersTable {...PartState} />
43
+ {/* api-reference:end */}
@@ -1,76 +1,24 @@
1
1
  ---
2
2
  title: MessageRuntime
3
- description: Hooks for accessing message state and edit composer.
3
+ description: MessageRuntime state and actions for editing, reloading, copying, rating, speaking, and branching assistant-ui messages.
4
4
  ---
5
5
 
6
- import {
7
- MessageRuntime,
8
- MessageState,
9
- ComposerState,
10
- } from "@/generated/typeDocs";
6
+ import { MessageRuntime, MessageState } from "@/generated/typeDocs";
11
7
 
12
- ### `useAui` (Message Actions)
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
13
10
 
14
- Access message actions via `useAui`:
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
15
14
 
16
- ```tsx
17
- import { useAui } from "@assistant-ui/react";
15
+ ## API Reference
18
16
 
19
- const aui = useAui();
20
-
21
- // Reload an assistant message (regenerate the response)
22
- aui.message().reload();
23
-
24
- // Switch to the previous or next branch
25
- aui.message().switchToBranch({ position: "previous" });
26
- aui.message().switchToBranch({ position: "next" });
27
-
28
- // Submit feedback on a message
29
- aui.message().submitFeedback({ type: "positive" });
30
- aui.message().submitFeedback({ type: "negative" });
31
-
32
- // Get the plain-text content of the message
33
- const text = aui.message().getCopyText();
34
-
35
- // Access a message part by index or tool call ID
36
- aui.message().part({ index: 0 });
37
- aui.message().part({ toolCallId: "call_123" });
38
-
39
- // Access an attachment by index
40
- aui.message().attachment({ index: 0 });
41
-
42
- // Access the edit composer for this message
43
- aui.message().composer();
44
-
45
- // Get a snapshot of the full message state
46
- const state = aui.message().getState();
47
- ```
17
+ ### MessageRuntime
48
18
 
49
19
  <ParametersTable {...MessageRuntime} />
50
20
 
51
- ### `useAuiState` (Message State)
52
-
53
- Access message state reactively:
54
-
55
- ```tsx
56
- import { useAuiState } from "@assistant-ui/react";
57
-
58
- const role = useAuiState((s) => s.message.role);
59
- const content = useAuiState((s) => s.message.content);
60
- const isLast = useAuiState((s) => s.message.isLast);
61
- ```
21
+ ### MessageState
62
22
 
63
23
  <ParametersTable {...MessageState} />
64
-
65
- ### `useAuiState` (Edit Composer)
66
-
67
- Access the edit composer state (used when editing a message):
68
-
69
- ```tsx
70
- import { useAuiState } from "@assistant-ui/react";
71
-
72
- const editText = useAuiState((s) => s.message.composer.text);
73
- const isEditing = useAuiState((s) => s.message.composer.isEditing);
74
- ```
75
-
76
- <ParametersTable {...ComposerState} />
24
+ {/* api-reference:end */}
@@ -0,0 +1,20 @@
1
+ ---
2
+ title: QueueItemState
3
+ description: State shape for queued assistant-ui thread operations and pending runtime work.
4
+ ---
5
+
6
+ import { QueueItemState } from "@/generated/typeDocs";
7
+
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
10
+
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
14
+
15
+ ## API Reference
16
+
17
+ ### QueueItemState
18
+
19
+ <ParametersTable {...QueueItemState} />
20
+ {/* api-reference:end */}
@@ -1,61 +1,24 @@
1
1
  ---
2
2
  title: ThreadListItemRuntime
3
- description: Runtime for managing individual thread list items.
3
+ description: ThreadListItemRuntime state and actions for selecting, archiving, unarchiving, deleting, and renaming assistant-ui conversations.
4
4
  ---
5
5
 
6
- import {
7
- ThreadListItemRuntime,
8
- ThreadListItemState,
9
- } from "@/generated/typeDocs";
6
+ import { ThreadListItemRuntime, ThreadListItemState } from "@/generated/typeDocs";
10
7
 
11
- ### `useAui` (Thread List Item Actions)
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
12
10
 
13
- Access thread list item actions via `useAui`:
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
14
14
 
15
- ```tsx
16
- import { useAui } from "@assistant-ui/react";
15
+ ## API Reference
17
16
 
18
- const aui = useAui();
19
-
20
- // Navigation
21
- await aui.threadListItem().switchTo();
22
-
23
- // Rename
24
- await aui.threadListItem().rename("New Title");
25
-
26
- // Archive / unarchive
27
- await aui.threadListItem().archive();
28
- await aui.threadListItem().unarchive();
29
-
30
- // Delete
31
- await aui.threadListItem().delete();
32
-
33
- // Initialize a new thread (returns remoteId and externalId)
34
- const { remoteId, externalId } = await aui.threadListItem().initialize();
35
-
36
- // Auto-generate a title from thread content
37
- await aui.threadListItem().generateTitle();
38
-
39
- // Detach the thread list item from its thread
40
- aui.threadListItem().detach();
41
-
42
- // Get current state
43
- const state = aui.threadListItem().getState();
44
- const { id, title, status } = state;
45
- ```
17
+ ### ThreadListItemRuntime
46
18
 
47
19
  <ParametersTable {...ThreadListItemRuntime} />
48
20
 
49
- ### `useAuiState` (Thread List Item State)
50
-
51
- Access the state for a specific thread list item:
52
-
53
- ```tsx
54
- import { useAuiState } from "@assistant-ui/react";
55
-
56
- const title = useAuiState((s) => s.threadListItem.title);
57
- const status = useAuiState((s) => s.threadListItem.status);
58
- const id = useAuiState((s) => s.threadListItem.id);
59
- ```
21
+ ### ThreadListItemState
60
22
 
61
23
  <ParametersTable {...ThreadListItemState} />
24
+ {/* api-reference:end */}
@@ -1,61 +1,24 @@
1
1
  ---
2
2
  title: ThreadListRuntime
3
- description: Runtime for accessing and managing the list of threads.
3
+ description: ThreadListRuntime state and actions for managing remote assistant-ui conversations, active thread selection, and new thread creation.
4
4
  ---
5
5
 
6
6
  import { ThreadListRuntime, ThreadListState } from "@/generated/typeDocs";
7
7
 
8
- ### `useAui` (Thread List Actions)
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
9
10
 
10
- Access thread list actions via `useAui`:
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
11
14
 
12
- ```tsx
13
- import { useAui } from "@assistant-ui/react";
15
+ ## API Reference
14
16
 
15
- const aui = useAui();
16
-
17
- // Switch threads
18
- await aui.threads().switchToNewThread();
19
- await aui.threads().switchToThread(threadId);
20
-
21
- // Re-fetch the thread list from the remote adapter
22
- // (e.g. after async auth completes)
23
- await aui.threads().reload();
24
-
25
- // Append the next page of threads when the adapter returned a `nextCursor`
26
- await aui.threads().loadMore();
27
-
28
- // Access the main thread runtime
29
- const mainThread = aui.threads().main;
30
-
31
- // Access a thread by ID
32
- const thread = aui.threads().getById(threadId);
33
-
34
- // Access thread list items
35
- const mainItem = aui.threads().mainItem;
36
- const itemByIndex = aui.threads().getItemByIndex(0);
37
- const itemById = aui.threads().getItemById(threadId);
38
- const archivedItem = aui.threads().getArchivedItemByIndex(0);
39
-
40
- // Get current state
41
- const state = aui.threads().getState();
42
- const threadIds = state.threadIds;
43
- const archivedThreadIds = state.archivedThreadIds;
44
- ```
17
+ ### ThreadListRuntime
45
18
 
46
19
  <ParametersTable {...ThreadListRuntime} />
47
20
 
48
- ### `useAuiState` (Thread List State)
49
-
50
- Access thread list state reactively:
51
-
52
- ```tsx
53
- import { useAuiState } from "@assistant-ui/react";
54
-
55
- const threads = useAuiState((s) => s.threads.threadIds);
56
- const isLoading = useAuiState((s) => s.threads.isLoading);
57
- const hasMore = useAuiState((s) => s.threads.hasMore);
58
- const isLoadingMore = useAuiState((s) => s.threads.isLoadingMore);
59
- ```
21
+ ### ThreadListState
60
22
 
61
23
  <ParametersTable {...ThreadListState} />
24
+ {/* api-reference:end */}
@@ -1,48 +1,36 @@
1
1
  ---
2
2
  title: ThreadRuntime
3
- description: Runtime for thread state, messages, and viewport management.
3
+ description: ThreadRuntime state and actions for controlling assistant-ui messages, composers, suggestions, model context, and the full thread lifecycle.
4
4
  ---
5
5
 
6
- import { ThreadRuntime, ThreadState } from "@/generated/typeDocs";
7
- import { ThreadViewportState } from "@/components/docs/parameters-table.context";
6
+ import { ThreadComposerRuntime, ThreadComposerState, ThreadRuntime, ThreadState, ThreadViewportState } from "@/generated/typeDocs";
8
7
 
9
- ### `useAui` (Thread Actions)
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
10
10
 
11
- Access thread actions via `useAui`:
11
+ {/* api-reference:start */}
12
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
13
+ {/* Do not edit this block manually. */}
12
14
 
13
- ```tsx
14
- import { useAui } from "@assistant-ui/react";
15
+ ## API Reference
15
16
 
16
- const aui = useAui();
17
- aui.thread().cancelRun();
18
- aui.thread().append({ role: "user", content: [{ type: "text", text: "Hello" }] });
19
- ```
17
+ ### ThreadComposerRuntime
20
18
 
21
- <ParametersTable {...ThreadRuntime} />
22
-
23
- ### `useAuiState` (Thread State)
24
-
25
- Access the thread state reactively:
19
+ <ParametersTable {...ThreadComposerRuntime} />
26
20
 
27
- ```tsx
28
- import { useAuiState } from "@assistant-ui/react";
21
+ ### ThreadComposerState
29
22
 
30
- const isRunning = useAuiState((s) => s.thread.isRunning);
31
- const isLoading = useAuiState((s) => s.thread.isLoading);
32
- const messages = useAuiState((s) => s.thread.messages);
33
- ```
23
+ <ParametersTable {...ThreadComposerState} />
34
24
 
35
- <ParametersTable {...ThreadState} />
25
+ ### ThreadRuntime
36
26
 
37
- ### `useThreadViewport`
27
+ <ParametersTable {...ThreadRuntime} />
38
28
 
39
- Manage thread viewport state (e.g., scrolling):
29
+ ### ThreadState
40
30
 
41
- ```tsx
42
- import { useThreadViewport } from "@assistant-ui/react";
31
+ <ParametersTable {...ThreadState} />
43
32
 
44
- const threadViewport = useThreadViewport();
45
- const isAtBottom = useThreadViewport((m) => m.isAtBottom);
46
- ```
33
+ ### ThreadViewportState
47
34
 
48
35
  <ParametersTable {...ThreadViewportState} />
36
+ {/* api-reference:end */}
@@ -0,0 +1,85 @@
1
+ ---
2
+ title: Component Tools
3
+ description: Register assistant tools from mounted React components, scoped to the lifetime of part of the UI tree.
4
+ ---
5
+
6
+ import { useAssistantTool } from "@/generated/typeDocs";
7
+
8
+ {/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
9
+ {/* Do not edit manually. */}
10
+
11
+ {/* api-manual:start */}
12
+ <Callout type="warn">
13
+ `makeAssistantTool` and `useAssistantTool` are **deprecated** compatibility
14
+ APIs, documented here for reference only. New code should define a toolkit —
15
+ see [Defining Tools](/docs/tools/defining-tools) and [Migrating Tools to
16
+ Toolkits](/docs/migrations/toolkit-tools).
17
+ </Callout>
18
+ {/* api-manual:end */}
19
+
20
+ {/* api-reference:start */}
21
+ {/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
22
+ {/* Do not edit this block manually. */}
23
+
24
+ ## API Reference
25
+
26
+ ### makeAssistantTool
27
+
28
+ <Callout type="warn">
29
+ <strong>Deprecated.</strong> Use a toolkit with `Tools({ toolkit })` and register it via
30
+ `useAui({ tools: Tools({ toolkit }) })` instead. See
31
+ https://assistant-ui.com/docs/migrations/toolkit-tools.
32
+ </Callout>
33
+
34
+ Creates a React component that registers an assistant tool when rendered.
35
+
36
+ Use this when exporting reusable tool modules that can be included in JSX
37
+ rather than calling [useAssistantTool](/docs/api-reference/tools/component-tools#useassistanttool) directly.
38
+
39
+ ```ts
40
+ type AssistantToolProps = CoreAssistantToolProps<TArgs, TResult> & {
41
+ /** Component used to render calls to this tool in assistant messages. */
42
+ render?: ToolCallMessagePartComponent<TArgs, TResult> | undefined;
43
+ /** Lightweight text rendered while a tool call is running or complete. */
44
+ renderText?: ToolCallText<TArgs, TResult> | undefined;
45
+ };
46
+
47
+ const makeAssistantTool: <TArgs extends Record<string, unknown>, TResult>(tool: AssistantToolProps<TArgs, TResult>) => AssistantTool;
48
+ ```
49
+
50
+ ### useAssistantTool
51
+
52
+ <Callout type="warn">
53
+ <strong>Deprecated.</strong> Use a toolkit with `Tools({ toolkit })` and register it via
54
+ `useAui({ tools: Tools({ toolkit }) })` instead. See
55
+ https://assistant-ui.com/docs/migrations/toolkit-tools.
56
+ </Callout>
57
+
58
+ Registers a tool with the assistant model context while the component is
59
+ mounted.
60
+
61
+ If `render` is provided, it is also installed as the renderer for matching
62
+ tool-call message parts. The registration is removed automatically when the
63
+ component unmounts or the tool definition changes.
64
+
65
+ Pass a referentially stable tool object, such as one declared at module
66
+ scope or memoized with `useMemo`, to avoid re-registering on every render.
67
+
68
+ ```tsx
69
+ const weatherTool = {
70
+ toolName: "get_weather",
71
+ type: "frontend",
72
+ description: "Get the weather for a city.",
73
+ parameters: weatherSchema,
74
+ execute: async ({ city }: { city: string }) => fetchWeather(city),
75
+ render: WeatherToolUI,
76
+ } satisfies AssistantToolProps<{ city: string }, Weather>;
77
+
78
+ function WeatherToolRegistration() {
79
+ useAssistantTool(weatherTool);
80
+ return null;
81
+ }
82
+ ```
83
+
84
+ <ParametersTable {...useAssistantTool} />
85
+ {/* api-reference:end */}