@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.
- package/.docs/organized/code-examples/waterfall.md +23 -25
- package/.docs/organized/code-examples/with-a2a.md +28 -28
- package/.docs/organized/code-examples/with-ag-ui.md +35 -30
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +16 -14
- package/.docs/organized/code-examples/with-artifacts.md +44 -38
- package/.docs/organized/code-examples/with-assistant-transport.md +68 -56
- package/.docs/organized/code-examples/with-browser-extension.md +357 -0
- package/.docs/organized/code-examples/with-chain-of-thought.md +425 -90
- package/.docs/organized/code-examples/with-cloud-standalone.md +30 -29
- package/.docs/organized/code-examples/with-cloud.md +16 -14
- package/.docs/organized/code-examples/with-custom-thread-list.md +19 -17
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +29 -26
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +20 -18
- package/.docs/organized/code-examples/with-expo.md +37 -31
- package/.docs/organized/code-examples/with-external-store.md +13 -11
- package/.docs/organized/code-examples/with-ffmpeg.md +327 -290
- package/.docs/organized/code-examples/with-generative-ui.md +1195 -194
- package/.docs/organized/code-examples/with-google-adk.md +13 -11
- package/.docs/organized/code-examples/with-heat-graph.md +16 -14
- package/.docs/organized/code-examples/with-image-generation.md +456 -0
- package/.docs/organized/code-examples/with-interactables.md +322 -244
- package/.docs/organized/code-examples/with-langchain.md +18 -16
- package/.docs/organized/code-examples/with-langgraph.md +95 -88
- package/.docs/organized/code-examples/with-livekit.md +30 -27
- package/.docs/organized/code-examples/with-mcp.md +754 -0
- package/.docs/organized/code-examples/with-opencode.md +70 -70
- package/.docs/organized/code-examples/with-react-hook-form.md +24 -22
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +20 -18
- package/.docs/organized/code-examples/with-resumable-stream.md +661 -0
- package/.docs/organized/code-examples/with-store.md +22 -20
- package/.docs/organized/code-examples/with-tanstack.md +18 -19
- package/.docs/organized/code-examples/with-tap-runtime.md +31 -28
- package/.docs/raw/docs/(docs)/architecture.mdx +43 -2
- package/.docs/raw/docs/(docs)/cli.mdx +2 -2
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +34 -26
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +32 -26
- package/.docs/raw/docs/(docs)/index.mdx +2 -2
- package/.docs/raw/docs/(docs)/installation.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +26 -24
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +20 -12
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +44 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +41 -16
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +12 -23
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +37 -8
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +11 -9
- package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +64 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +52 -0
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +46 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +18 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +33 -0
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +45 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +98 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +18 -13
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +31 -52
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +640 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +15 -28
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +64 -18
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +434 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +24 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +11 -12
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +109 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +58 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +109 -132
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +78 -221
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +127 -242
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +39 -20
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +66 -87
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +50 -58
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +80 -48
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +67 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +323 -461
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +36 -43
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +29 -24
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +63 -245
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +202 -588
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +65 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +35 -22
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +57 -140
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +70 -161
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +84 -108
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +77 -96
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +173 -349
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +9 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +10 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +15 -70
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +18 -13
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +25 -28
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +11 -63
- package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +11 -48
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +10 -47
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +18 -30
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +85 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +127 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +91 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +48 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +62 -0
- package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +19 -0
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +143 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +54 -0
- package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +36 -0
- package/.docs/raw/docs/cloud/ai-sdk.mdx +1 -3
- package/.docs/raw/docs/cloud/index.mdx +2 -2
- package/.docs/raw/docs/guides/attachments.mdx +4 -4
- package/.docs/raw/docs/guides/branching.mdx +1 -1
- package/.docs/raw/docs/guides/chain-of-thought.mdx +12 -14
- package/.docs/raw/docs/guides/context-api.mdx +6 -5
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/editing.mdx +1 -1
- package/.docs/raw/docs/guides/image-generation.mdx +74 -0
- package/.docs/raw/docs/guides/index.mdx +5 -14
- package/.docs/raw/docs/guides/latex.mdx +2 -2
- package/.docs/raw/docs/guides/mentions.mdx +6 -6
- package/.docs/raw/docs/guides/message-timing.mdx +38 -5
- package/.docs/raw/docs/guides/quoting.mdx +1 -1
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +212 -0
- package/.docs/raw/docs/guides/resumable-stream-stores.mdx +152 -0
- package/.docs/raw/docs/guides/resumable-streams.mdx +210 -0
- package/.docs/raw/docs/guides/slash-commands.mdx +2 -2
- package/.docs/raw/docs/guides/speech.mdx +2 -2
- package/.docs/raw/docs/guides/suggestions.mdx +89 -5
- package/.docs/raw/docs/guides/voice.mdx +2 -2
- package/.docs/raw/docs/ink/adapters.mdx +37 -1
- package/.docs/raw/docs/ink/custom-backend.mdx +59 -8
- package/.docs/raw/docs/ink/hooks.mdx +98 -85
- package/.docs/raw/docs/ink/index.mdx +10 -11
- package/.docs/raw/docs/ink/migration.mdx +1 -1
- package/.docs/raw/docs/ink/primitives.mdx +350 -9
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/clerk.mdx +1 -1
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +1 -1
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +3 -3
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents/overview.mdx +282 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +2 -2
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +1 -1
- package/.docs/raw/docs/integrations/gateways/index.mdx +9 -4
- package/.docs/raw/docs/integrations/index.mdx +17 -5
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +8 -1
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +8 -4
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +17 -2
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +226 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +10 -16
- package/.docs/raw/docs/primitives/composer.mdx +53 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -2
- package/.docs/raw/docs/primitives/message.mdx +9 -10
- package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
- package/.docs/raw/docs/react-native/hooks.mdx +57 -82
- package/.docs/raw/docs/react-native/index.mdx +4 -4
- package/.docs/raw/docs/react-native/migration.mdx +1 -1
- package/.docs/raw/docs/react-native/primitives.mdx +2 -2
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +7 -4
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +32 -1
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +7 -2
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +129 -1
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +7 -1
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +27 -2
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +9 -1
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +18 -7
- package/.docs/raw/docs/runtimes/custom/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +108 -38
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/langchain.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +64 -50
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +98 -86
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +2 -2
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +12 -5
- package/.docs/raw/docs/tools/backend.mdx +136 -0
- package/.docs/raw/docs/tools/defining-tools.mdx +413 -0
- package/.docs/raw/docs/tools/dynamic-tools.mdx +110 -0
- package/.docs/raw/docs/tools/generative-ui.mdx +214 -0
- package/.docs/raw/docs/tools/index.mdx +76 -0
- package/.docs/raw/docs/{guides → tools}/interactables.mdx +3 -3
- package/.docs/raw/docs/tools/mcp-apps.mdx +231 -0
- package/.docs/raw/docs/{integrations/tools → tools}/mcp.mdx +77 -50
- package/.docs/raw/docs/{guides → tools}/multi-agent.mdx +19 -21
- package/.docs/raw/docs/tools/tool-ui.mdx +967 -0
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +337 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +11 -1
- package/.docs/raw/docs/ui/directive-text.mdx +3 -3
- package/.docs/raw/docs/ui/mcp-config.mdx +102 -0
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +84 -50
- package/.docs/raw/docs/ui/reasoning.mdx +4 -5
- package/.docs/raw/docs/ui/sources.mdx +17 -0
- package/.docs/raw/docs/ui/streamdown.mdx +34 -2
- package/.docs/raw/docs/ui/thread-list.mdx +2 -2
- package/.docs/raw/docs/ui/thread.mdx +2 -2
- package/.docs/raw/docs/ui/tool-group.mdx +5 -6
- package/.docs/raw/docs/utilities/heat-graph.mdx +1 -1
- package/README.md +14 -72
- package/dist/constants.d.ts +12 -9
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +13 -9
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -24
- package/dist/index.js.map +1 -1
- package/dist/prepare-docs/code-examples.d.ts +4 -1
- package/dist/prepare-docs/code-examples.d.ts.map +1 -1
- package/dist/prepare-docs/code-examples.js +109 -121
- package/dist/prepare-docs/code-examples.js.map +1 -1
- package/dist/prepare-docs/copy-raw.d.ts +4 -1
- package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
- package/dist/prepare-docs/copy-raw.js +45 -42
- package/dist/prepare-docs/copy-raw.js.map +1 -1
- package/dist/prepare-docs/prepare.d.ts +1 -2
- package/dist/prepare-docs/prepare.js +17 -17
- package/dist/prepare-docs/prepare.js.map +1 -1
- package/dist/stdio.d.ts +1 -3
- package/dist/stdio.js +6 -3
- package/dist/stdio.js.map +1 -1
- package/dist/tools/docs.d.ts +20 -15
- package/dist/tools/docs.d.ts.map +1 -1
- package/dist/tools/docs.js +140 -161
- package/dist/tools/docs.js.map +1 -1
- package/dist/tools/examples.d.ts +20 -15
- package/dist/tools/examples.d.ts.map +1 -1
- package/dist/tools/examples.js +74 -86
- package/dist/tools/examples.js.map +1 -1
- package/dist/tools/tests/test-setup.d.ts +5 -2
- package/dist/tools/tests/test-setup.d.ts.map +1 -1
- package/dist/tools/tests/test-setup.js +21 -28
- package/dist/tools/tests/test-setup.js.map +1 -1
- package/dist/utils/logger.d.ts +8 -5
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +17 -17
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/mcp-format.d.ts +8 -5
- package/dist/utils/mcp-format.d.ts.map +1 -1
- package/dist/utils/mcp-format.js +9 -9
- package/dist/utils/mcp-format.js.map +1 -1
- package/dist/utils/mdx.d.ts +8 -6
- package/dist/utils/mdx.d.ts.map +1 -1
- package/dist/utils/mdx.js +22 -22
- package/dist/utils/mdx.js.map +1 -1
- package/dist/utils/paths.d.ts +9 -6
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +66 -76
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/security.d.ts +4 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +19 -40
- package/dist/utils/security.js.map +1 -1
- package/package.json +5 -5
- package/.docs/organized/code-examples/with-parent-id-grouping.md +0 -596
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -151
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -230
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +0 -41
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +0 -40
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -260
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +0 -103
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +0 -254
- package/.docs/raw/docs/guides/tool-ui.mdx +0 -858
- package/.docs/raw/docs/guides/tools.mdx +0 -675
- package/dist/prepare-docs/prepare.d.ts.map +0 -1
- package/dist/stdio.d.ts.map +0 -1
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/deprecation-policy.mdx +0 -0
- /package/.docs/raw/docs/{(reference) → migrations}/react-compatibility.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/react-langgraph-v0-7.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-11.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-12.mdx +0 -0
- /package/.docs/raw/docs/{(reference)/migrations → migrations}/v0-14.mdx +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: Display suggested prompts to
|
|
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
|
-
##
|
|
139
|
+
## Runtime driven suggestions
|
|
140
140
|
|
|
141
|
-
|
|
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/
|
|
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:
|
|
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:
|
|
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 |
|
|
201
|
-
| **Cross-session persistence** | No | Yes |
|
|
202
|
-
| **
|
|
203
|
-
| **
|
|
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
|
-
###
|
|
156
|
+
### Tools
|
|
112
157
|
|
|
113
|
-
Register
|
|
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 {
|
|
160
|
+
```tsx title="weather-toolkit.tsx"
|
|
161
|
+
import type { Toolkit } from "@assistant-ui/react-ink";
|
|
117
162
|
import { Text } from "ink";
|
|
118
163
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
<Text>{args.city}: {result?.temperature}°F</Text>
|
|
135
|
-
),
|
|
136
|
-
});
|
|
183
|
+
} satisfies Toolkit;
|
|
137
184
|
```
|
|
138
185
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
<
|
|
166
|
-
|
|
167
|
-
|
|
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** — `
|
|
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
|
|