@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,6 +1,6 @@
1
1
  ---
2
- title: Suggestions
3
- description: Display suggested prompts to help users get started with your assistant.
2
+ title: Suggested Prompts
3
+ description: Display suggested starter prompts in your AI chat to onboard users faster. Configurable suggestion components for React, built into assistant-ui.
4
4
  platforms: ["react"]
5
5
  ---
6
6
 
@@ -136,9 +136,93 @@ Suggestions dismiss automatically once the user sends a message because `thread.
136
136
 
137
137
  The primitives available for rendering suggestions are `ThreadPrimitive.Suggestions`, `ThreadPrimitive.SuggestionByIndex`, `SuggestionPrimitive.Title`, `SuggestionPrimitive.Description`, and `SuggestionPrimitive.Trigger`. `ThreadPrimitive.SuggestionByIndex` is useful when you need layout control over a specific suggestion slot rather than iterating all of them. For the full prop reference and usage patterns, see the [Suggestion primitive docs](/docs/primitives/suggestion).
138
138
 
139
- ## Dynamic Suggestions
139
+ ## Runtime driven suggestions
140
140
 
141
- You can dynamically change suggestions based on your application state:
141
+ The static `Suggestions(...)` API covers welcome screens. For follow up prompts that depend on the conversation, a tool result, or your backend, push suggestions through the runtime itself. They land on `thread.suggestions` rather than the static `suggestions` scope, so they render through a different component.
142
+
143
+ ### Local runtime: `SuggestionAdapter`
144
+
145
+ Pass a `suggestion` adapter to `useLocalRuntime`. Its `generate` function runs after every assistant turn and may return a promise or an async generator for streaming updates.
146
+
147
+ ```tsx
148
+ import { useLocalRuntime, type SuggestionAdapter } from "@assistant-ui/react";
149
+
150
+ const suggestionAdapter: SuggestionAdapter = {
151
+ async generate({ messages }) {
152
+ const response = await fetch("/api/follow-ups", {
153
+ method: "POST",
154
+ body: JSON.stringify({ messages }),
155
+ });
156
+ const data: { prompt: string }[] = await response.json();
157
+ return data;
158
+ },
159
+ };
160
+
161
+ const runtime = useLocalRuntime(myChatModel, {
162
+ adapters: { suggestion: suggestionAdapter },
163
+ });
164
+ ```
165
+
166
+ ### External store runtime
167
+
168
+ `useExternalStoreRuntime` exposes a `suggestions` field, so you can drive follow ups straight from your application state.
169
+
170
+ ```tsx
171
+ const [suggestions, setSuggestions] = useState<ThreadSuggestion[]>([]);
172
+
173
+ const runtime = useExternalStoreRuntime({
174
+ messages,
175
+ onNew,
176
+ suggestions,
177
+ });
178
+
179
+ // Push a follow up after a tool result, a stream chunk, or any app event.
180
+ setSuggestions([{ prompt: "Summarize this case" }]);
181
+ ```
182
+
183
+ ### AI SDK runtime
184
+
185
+ `useChatRuntime` and `useAISDKRuntime` accept the same `suggestions` field and forward it to the underlying external store.
186
+
187
+ ```tsx
188
+ const [suggestions, setSuggestions] = useState<ThreadSuggestion[]>([]);
189
+
190
+ const runtime = useChatRuntime({ suggestions });
191
+ ```
192
+
193
+ The local runtime clears its suggestions when a new run starts. External store and AI SDK runtimes keep whatever state you push, so you control the lifetime.
194
+
195
+ ### Rendering runtime suggestions
196
+
197
+ Static suggestions go through `ThreadPrimitive.Suggestions`; runtime suggestions go through `thread.suggestions`. The shadcn registry ships `ThreadFollowupSuggestions` for the common single line pill layout. For a custom layout, read the array yourself:
198
+
199
+ ```tsx
200
+ import { useAuiState, ThreadPrimitive, AuiIf } from "@assistant-ui/react";
201
+
202
+ function FollowUps() {
203
+ const suggestions = useAuiState((s) => s.thread.suggestions);
204
+ return (
205
+ <AuiIf condition={(s) => !s.thread.isEmpty && !s.thread.isRunning}>
206
+ <div className="flex gap-2">
207
+ {suggestions.map((s, i) => (
208
+ <ThreadPrimitive.Suggestion
209
+ key={i}
210
+ prompt={s.prompt}
211
+ method="replace"
212
+ autoSend
213
+ >
214
+ {s.prompt}
215
+ </ThreadPrimitive.Suggestion>
216
+ ))}
217
+ </div>
218
+ </AuiIf>
219
+ );
220
+ }
221
+ ```
222
+
223
+ ## Reacting to application state
224
+
225
+ You can dynamically change the static suggestion list based on your application state:
142
226
 
143
227
  ```tsx
144
228
  import { useMemo } from "react";
@@ -224,5 +308,5 @@ The new API provides:
224
308
  ## Related
225
309
 
226
310
  - [Thread Component](/docs/ui/thread) - Main chat interface
227
- - [Tools Guide](/docs/guides/tools) - Configure assistant actions
311
+ - [Tools Guide](/docs/tools/defining-tools) - Configure assistant actions
228
312
  - [Context API](/docs/guides/context-api) - Access assistant state
@@ -1,6 +1,6 @@
1
1
  ---
2
- title: Realtime Voice
3
- description: Bidirectional realtime voice conversations with AI agents.
2
+ title: Realtime Voice Chat
3
+ description: Build bidirectional voice conversations with AI in React — realtime audio streaming, interruption handling, and visual state, integrated via assistant-ui.
4
4
  platforms: ["react"]
5
5
  ---
6
6
 
@@ -1,10 +1,46 @@
1
1
  ---
2
2
  title: Adapters
3
- description: Title generation adapters for React Ink.
3
+ description: Title generation and storage adapters for React Ink.
4
4
  ---
5
5
 
6
6
  Adapters customize runtime behavior. They can be passed as options to `useLocalRuntime` or `useRemoteThreadListRuntime`.
7
7
 
8
+ ## createFileStorageAdapter
9
+
10
+ A `RemoteThreadListAdapter` that persists threads and messages to a local directory. See [Custom Backend → Option 2](/docs/ink/custom-backend#option-2-local-file-persistence) for usage.
11
+
12
+ ```ts
13
+ import { createFileStorageAdapter } from "@assistant-ui/react-ink";
14
+
15
+ const adapter = createFileStorageAdapter({
16
+ dir: "/path/to/threads",
17
+ });
18
+ ```
19
+
20
+ ## TitleGenerationAdapter
21
+
22
+ Produces a thread title from a thread's messages. Pass one as the `titleGenerator` option to `createFileStorageAdapter`, or call it from a custom `RemoteThreadListAdapter`.
23
+
24
+ ```ts
25
+ type TitleGenerationAdapter = {
26
+ generateTitle(messages: readonly ThreadMessage[]): Promise<string>;
27
+ };
28
+ ```
29
+
30
+ `createSimpleTitleAdapter` is the built-in implementation; it derives the title from the first user message, truncated to 50 characters.
31
+
32
+ ```ts
33
+ import {
34
+ createFileStorageAdapter,
35
+ createSimpleTitleAdapter,
36
+ } from "@assistant-ui/react-ink";
37
+
38
+ const adapter = createFileStorageAdapter({
39
+ dir: "/path/to/threads",
40
+ titleGenerator: createSimpleTitleAdapter(),
41
+ });
42
+ ```
43
+
8
44
  ## RemoteThreadListAdapter
9
45
 
10
46
  Title generation is configured via the `generateTitle` method on `RemoteThreadListAdapter`. See the [Custom Backend](/docs/ink/custom-backend) page for a full example.
@@ -59,7 +59,57 @@ This gives you:
59
59
  - In-memory thread list (lost on process exit)
60
60
  - Multi-thread support
61
61
 
62
- ## Option 2: Full backend thread management
62
+ ## Option 2: Local file persistence
63
+
64
+ When you want threads and messages to survive across sessions without running a backend, use `createFileStorageAdapter`. It writes each thread to a JSON file on disk and plugs into `useRemoteThreadListRuntime`.
65
+
66
+ ```tsx title="app.tsx"
67
+ import { join } from "node:path";
68
+ import { homedir } from "node:os";
69
+ import {
70
+ useLocalRuntime,
71
+ useRemoteThreadListRuntime,
72
+ createFileStorageAdapter,
73
+ AssistantRuntimeProvider,
74
+ } from "@assistant-ui/react-ink";
75
+ import { myChatAdapter } from "./adapters/my-chat-adapter.js";
76
+
77
+ const threadListAdapter = createFileStorageAdapter({
78
+ dir: join(homedir(), ".my-cli", "threads"),
79
+ });
80
+
81
+ function useAppRuntime() {
82
+ return useRemoteThreadListRuntime({
83
+ runtimeHook: () => useLocalRuntime(myChatAdapter),
84
+ adapter: threadListAdapter,
85
+ });
86
+ }
87
+
88
+ export function App() {
89
+ const runtime = useAppRuntime();
90
+ return (
91
+ <AssistantRuntimeProvider runtime={runtime}>
92
+ {/* your chat UI */}
93
+ </AssistantRuntimeProvider>
94
+ );
95
+ }
96
+ ```
97
+
98
+ Writes are atomic (temp file + `rename`), so a crash mid-write cannot leave a partial JSON file. The directory is created lazily on first write.
99
+
100
+ ### Options
101
+
102
+ | Option | Description |
103
+ |---|---|
104
+ | `dir` | Directory where thread files are stored. Created if missing. |
105
+ | `prefix` | Key prefix for stored files. Defaults to `@assistant-ui:`. Useful when two apps share a directory. |
106
+ | `titleGenerator` | Optional [`TitleGenerationAdapter`](/docs/ink/adapters#titlegenerationadapter) that auto-generates thread titles from the first messages. Pass `createSimpleTitleAdapter()` for the built-in implementation. |
107
+
108
+ ### When this fits
109
+
110
+ Designed for single-process terminal apps where one user has one CLI running at a time. The wrapped read-modify-write on the thread list isn't lock-safe, so two CLI processes pointed at the same directory can lose updates to thread metadata (rename, archive). If that's your scenario, use Option 3 instead.
111
+
112
+ ## Option 3: Full backend thread management
63
113
 
64
114
  When you want your backend to own thread state (e.g. for persistence across sessions, team sharing, or server-side history), implement a `RemoteThreadListAdapter`.
65
115
 
@@ -194,10 +244,11 @@ export function App() {
194
244
 
195
245
  ## Which option to choose?
196
246
 
197
- | | Option 1: ChatModelAdapter | Option 2: RemoteThreadListAdapter |
198
- |---|---|---|
199
- | **Thread storage** | In-memory (process lifetime) | Your backend |
200
- | **Message storage** | In-memory | On-device (can add history adapter for server-side) |
201
- | **Cross-session persistence** | No | Yes |
202
- | **Setup complexity** | Minimal | Moderate |
203
- | **Best for** | CLI tools, demos, prototypes | Production apps with persistence |
247
+ | | Option 1: ChatModelAdapter | Option 2: createFileStorageAdapter | Option 3: RemoteThreadListAdapter |
248
+ |---|---|---|---|
249
+ | **Thread storage** | In-memory (process lifetime) | Local disk | Your backend |
250
+ | **Message storage** | In-memory | Local disk | In-memory (can add history adapter for server-side) |
251
+ | **Cross-session persistence** | No | Yes | Yes |
252
+ | **Multi-process safe** | N/A | No | Depends on backend |
253
+ | **Setup complexity** | Minimal | Minimal | Moderate |
254
+ | **Best for** | Demos, prototypes | Local CLI tools | Production apps with sync / team sharing |
@@ -60,6 +60,51 @@ useAuiEvent("thread.runStart", (payload) => {
60
60
  });
61
61
  ```
62
62
 
63
+ ### useNotification
64
+
65
+ Ring the terminal bell and emit an OSC desktop notification when the assistant finishes a run, stops with an error, or pauses for human approval.
66
+
67
+ ```tsx
68
+ import { useNotification } from "@assistant-ui/react-ink";
69
+
70
+ useNotification();
71
+ ```
72
+
73
+ Defaults:
74
+
75
+ - `task-complete`: bell + OSC 9
76
+ - `task-incomplete`: bell
77
+ - `needs-input` (assistant message in `requires-action` with `reason: "interrupt"`): bell
78
+
79
+ Pass `false` to suppress one trigger, or a `NotificationHandler` to override it:
80
+
81
+ ```tsx
82
+ useNotification({
83
+ onTaskComplete: { osc: "osc99" },
84
+ onTaskIncomplete: false,
85
+ onNeedsInput: {
86
+ custom: (event) => myLogger.log(event),
87
+ },
88
+ });
89
+ ```
90
+
91
+ | Option | Type | Description |
92
+ |--------|------|-------------|
93
+ | `enabled` | `boolean` | Master switch. Defaults to `true`. |
94
+ | `onTaskComplete` | `NotificationHandler<"task-complete"> \| false` | Fired when the latest assistant message status flips to `complete` after a run was observed. |
95
+ | `onTaskIncomplete` | `NotificationHandler<"task-incomplete"> \| false` | Fired when the latest assistant message status flips to `incomplete` after a run was observed. |
96
+ | `onNeedsInput` | `NotificationHandler<"needs-input"> \| false` | Fired when the latest assistant message enters `requires-action` with `reason: "interrupt"`. Tool-call pauses are skipped. |
97
+
98
+ `NotificationHandler<T>` fields (all optional, any combination):
99
+
100
+ | Field | Type | Description |
101
+ |-------|------|-------------|
102
+ | `bell` | `boolean` | Ring the terminal bell (`\x07`). |
103
+ | `osc` | `boolean \| "osc9" \| "osc99" \| "osc777"` | Send an OSC notification. `true` is equivalent to `"osc9"`. |
104
+ | `custom` | `(event: Extract<NotificationEvent, { type: T }>) => void` | User callback invoked with the event payload narrowed to this handler's type. |
105
+
106
+ Notifications are deduplicated per `thread:message:status:reason` tuple, so passing an inline config object does not produce duplicate fires. `ringBell` and `sendOSCNotification(title, body?, variant?)` are also exported for imperative use. OSC support depends on the terminal emulator.
107
+
63
108
  ## Runtime Hooks
64
109
 
65
110
  ### useLocalRuntime
@@ -108,52 +153,44 @@ const runtime = useRemoteThreadListRuntime({
108
153
 
109
154
  ## Model Context Hooks
110
155
 
111
- ### useAssistantTool
156
+ ### Tools
112
157
 
113
- Register a tool with an optional UI renderer. The tool definition is forwarded to the model, and when the model calls it, the `execute` function runs and the `render` component displays the result.
158
+ Register tools with a toolkit. The tool definition is forwarded to the model, and when the model calls it, the `execute` function runs and the `render` component displays the result.
114
159
 
115
- ```tsx
116
- import { useAssistantTool } from "@assistant-ui/react-ink";
160
+ ```tsx title="weather-toolkit.tsx"
161
+ import type { Toolkit } from "@assistant-ui/react-ink";
117
162
  import { Text } from "ink";
118
163
 
119
- useAssistantTool({
120
- toolName: "get_weather",
121
- description: "Get the current weather for a city",
122
- parameters: {
123
- type: "object",
124
- properties: {
125
- city: { type: "string" },
164
+ export const toolkit = {
165
+ get_weather: {
166
+ type: "frontend",
167
+ description: "Get the current weather for a city",
168
+ parameters: {
169
+ type: "object",
170
+ properties: {
171
+ city: { type: "string" },
172
+ },
173
+ required: ["city"],
126
174
  },
127
- required: ["city"],
128
- },
129
- execute: async ({ city }) => {
130
- const res = await fetch(`https://api.weather.example/${city}`);
131
- return res.json();
175
+ execute: async ({ city }) => {
176
+ const res = await fetch(`https://api.weather.example/${city}`);
177
+ return res.json();
178
+ },
179
+ render: ({ args, result }) => (
180
+ <Text>{args.city}: {result?.temperature}°F</Text>
181
+ ),
132
182
  },
133
- render: ({ args, result }) => (
134
- <Text>{args.city}: {result?.temperature}°F</Text>
135
- ),
136
- });
183
+ } satisfies Toolkit;
137
184
  ```
138
185
 
139
- ### useAssistantToolUI
140
-
141
- Register only a UI renderer for a tool (without tool definition or execute function).
142
-
143
- ```tsx
144
- import { useAssistantToolUI } from "@assistant-ui/react-ink";
145
- import { Text } from "ink";
186
+ ```tsx title="ToolProvider.tsx"
187
+ import { AuiProvider, Tools, useAui } from "@assistant-ui/react-ink";
188
+ import { toolkit } from "./weather-toolkit";
146
189
 
147
- useAssistantToolUI({
148
- toolName: "get_weather",
149
- render: ({ args, result, status }) => (
150
- <Text>
151
- {status?.type === "running"
152
- ? `Loading weather for ${args.city}...`
153
- : `${args.city}: ${result?.temperature}°F`}
154
- </Text>
155
- ),
156
- });
190
+ function ToolProvider({ children }: { children: React.ReactNode }) {
191
+ const aui = useAui({ tools: Tools({ toolkit }) });
192
+ return <AuiProvider value={aui}>{children}</AuiProvider>;
193
+ }
157
194
  ```
158
195
 
159
196
  ### useAssistantInstructions
@@ -181,48 +218,9 @@ useAssistantDataUI({
181
218
  ),
182
219
  });
183
220
  ```
184
- ### makeAssistantTool
185
-
186
- Create a component that registers a tool when mounted.
187
-
188
- ```tsx
189
- import { makeAssistantTool } from "@assistant-ui/react-ink";
190
- import { Text } from "ink";
191
-
192
- const WeatherTool = makeAssistantTool({
193
- toolName: "get_weather",
194
- description: "Get weather",
195
- parameters: { type: "object", properties: { city: { type: "string" } }, required: ["city"] },
196
- execute: async ({ city }) => ({ temperature: 72 }),
197
- render: ({ args, result }) => <Text>{args.city}: {result?.temperature}°F</Text>,
198
- });
199
-
200
- // Mount inside AssistantRuntimeProvider to register
201
- <WeatherTool />
202
- ```
203
-
204
- ### makeAssistantToolUI
221
+ ### Dynamic Tool Renderers
205
222
 
206
- Create a component that registers only a tool UI renderer (no tool definition or execute) when mounted.
207
-
208
- ```tsx
209
- import { makeAssistantToolUI } from "@assistant-ui/react-ink";
210
- import { Text } from "ink";
211
-
212
- const WeatherToolUI = makeAssistantToolUI({
213
- toolName: "get_weather",
214
- render: ({ args, result, status }) => (
215
- <Text>
216
- {status?.type === "running"
217
- ? `Loading weather for ${args.city}...`
218
- : `${args.city}: ${result?.temperature}°F`}
219
- </Text>
220
- ),
221
- });
222
-
223
- // Mount inside AssistantRuntimeProvider to register
224
- <WeatherToolUI />
225
- ```
223
+ Use a toolkit with `useInlineRender` when the renderer closes over changing props.
226
224
 
227
225
  ### makeAssistantDataUI
228
226
 
@@ -247,16 +245,31 @@ const WeatherCardUI = makeAssistantDataUI({
247
245
 
248
246
  Wrap a render function component so that it always uses the latest version without re-creating a stable reference. Useful when passing a render prop inline and the function closes over changing state.
249
247
 
250
- ```tsx
251
- import { useInlineRender } from "@assistant-ui/react-ink";
252
-
253
- const render = useInlineRender(({ args, result }) => (
254
- <Text>{args.city}: {result?.temperature}°F</Text>
255
- ));
248
+ ```tsx title="weather-toolkit.tsx"
249
+ import { type Toolkit, useInlineRender } from "@assistant-ui/react-ink";
250
+ import { Text } from "ink";
251
+ import { useMemo } from "react";
256
252
 
257
- useAssistantToolUI({ toolName: "get_weather", render });
253
+ export function useWeatherToolkit() {
254
+ const render = useInlineRender(({ args, result }) => (
255
+ <Text>{args.city}: {result?.temperature}°F</Text>
256
+ ));
257
+
258
+ return useMemo(
259
+ () =>
260
+ ({
261
+ get_weather: {
262
+ type: "backend",
263
+ render,
264
+ },
265
+ }) satisfies Toolkit,
266
+ [render],
267
+ );
268
+ }
258
269
  ```
259
270
 
271
+ Import the toolkit hook, pass its result to `useAui({ tools: Tools({ toolkit }) })`, and provide the returned `aui` with `AuiProvider`, as shown in the [Tools](#tools) section above.
272
+
260
273
  ## Runtime Providers
261
274
 
262
275
  ### AssistantRuntimeProvider
@@ -1,6 +1,6 @@
1
1
  ---
2
- title: Getting Started
3
- description: Build AI chat interfaces for the terminal with @assistant-ui/react-ink.
2
+ title: Terminal AI Chat with Ink
3
+ description: Build AI chat interfaces for the terminal in TypeScript with @assistant-ui/react-ink — streaming, tool calls, and keyboard navigation in CLI apps.
4
4
  ---
5
5
 
6
6
  ## Quick Start
@@ -129,6 +129,7 @@ import { Box, Text } from "ink";
129
129
  import {
130
130
  ThreadPrimitive,
131
131
  ComposerPrimitive,
132
+ LoadingPrimitive,
132
133
  useAuiState,
133
134
  } from "@assistant-ui/react-ink";
134
135
  import { MarkdownText } from "@assistant-ui/react-ink-markdown";
@@ -158,15 +159,13 @@ const Message = () => {
158
159
  );
159
160
  };
160
161
 
161
- const StatusIndicator = () => {
162
- const isRunning = useAuiState((s) => s.thread.isRunning);
163
- if (!isRunning) return null;
164
- return (
165
- <Box marginBottom={1}>
166
- <Text color="yellow">Thinking...</Text>
167
- </Box>
168
- );
169
- };
162
+ const StatusIndicator = () => (
163
+ <LoadingPrimitive.Root marginBottom={1} gap={1}>
164
+ <LoadingPrimitive.Spinner variant="bar" />
165
+ <LoadingPrimitive.Text />
166
+ <LoadingPrimitive.ElapsedTime />
167
+ </LoadingPrimitive.Root>
168
+ );
170
169
 
171
170
  export const Thread = () => {
172
171
  return (
@@ -9,7 +9,7 @@ If you already have an assistant-ui web app, most of your code transfers directl
9
9
 
10
10
  - **Runtime setup** — `useLocalRuntime`, `ChatModelAdapter`, and all runtime options work identically.
11
11
  - **AI SDK integration** — `@assistant-ui/react-ai-sdk` works with React Ink. Your runtime setup transfers directly.
12
- - **Tool definitions** — `useAssistantTool`, `makeAssistantTool`, and tool UI renderers use the same API.
12
+ - **Tool definitions** — `Tools({ toolkit })` and toolkit renderers use the same API.
13
13
  - **State hooks** — `useAuiState`, `useAui`, and selector patterns are the same.
14
14
  - **Backend code** — Your API routes, streaming endpoints, and server-side logic need zero changes.
15
15