@assistant-ui/mcp-docs-server 0.1.31 → 0.1.32
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 +8 -8
- package/.docs/organized/code-examples/with-a2a.md +10 -10
- package/.docs/organized/code-examples/with-ag-ui.md +11 -11
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +13 -13
- package/.docs/organized/code-examples/with-artifacts.md +13 -13
- package/.docs/organized/code-examples/with-assistant-transport.md +10 -10
- package/.docs/organized/code-examples/with-browser-extension.md +345 -0
- package/.docs/organized/code-examples/with-chain-of-thought.md +54 -17
- package/.docs/organized/code-examples/with-cloud-standalone.md +13 -13
- package/.docs/organized/code-examples/with-cloud.md +13 -13
- package/.docs/organized/code-examples/with-custom-thread-list.md +13 -13
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -16
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +17 -16
- package/.docs/organized/code-examples/with-expo.md +24 -24
- package/.docs/organized/code-examples/with-external-store.md +10 -10
- package/.docs/organized/code-examples/with-ffmpeg.md +13 -13
- package/.docs/organized/code-examples/with-generative-ui.md +210 -13
- package/.docs/organized/code-examples/with-google-adk.md +10 -10
- package/.docs/organized/code-examples/with-heat-graph.md +8 -8
- package/.docs/organized/code-examples/with-image-generation.md +454 -0
- package/.docs/organized/code-examples/with-interactables.md +13 -13
- package/.docs/organized/code-examples/with-langchain.md +12 -12
- package/.docs/organized/code-examples/with-langgraph.md +15 -12
- package/.docs/organized/code-examples/with-livekit.md +18 -17
- package/.docs/organized/code-examples/with-mcp.md +748 -0
- package/.docs/organized/code-examples/with-opencode.md +11 -11
- package/.docs/organized/code-examples/with-parent-id-grouping.md +11 -11
- package/.docs/organized/code-examples/with-react-hook-form.md +14 -14
- package/.docs/organized/code-examples/with-react-ink.md +4 -4
- package/.docs/organized/code-examples/with-react-router.md +15 -15
- package/.docs/organized/code-examples/with-resumable-stream.md +660 -0
- package/.docs/organized/code-examples/with-store.md +8 -8
- package/.docs/organized/code-examples/with-tanstack.md +14 -14
- package/.docs/organized/code-examples/with-tap-runtime.md +11 -10
- package/.docs/raw/docs/(docs)/cli.mdx +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +2 -2
- package/.docs/raw/docs/(docs)/installation.mdx +1 -1
- 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 +37 -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 +36 -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 +18 -57
- 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 +79 -0
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +52 -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 +110 -131
- 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 +175 -591
- 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 +68 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +39 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +79 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +42 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +92 -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 +131 -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 -1
- 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 +5 -5
- package/.docs/raw/docs/guides/context-api.mdx +4 -4
- package/.docs/raw/docs/guides/dictation.mdx +2 -2
- package/.docs/raw/docs/guides/editing.mdx +1 -1
- package/.docs/raw/docs/guides/generative-ui.mdx +142 -0
- package/.docs/raw/docs/guides/image-generation.mdx +74 -0
- package/.docs/raw/docs/guides/index.mdx +2 -2
- package/.docs/raw/docs/guides/interactables.mdx +2 -2
- package/.docs/raw/docs/guides/latex.mdx +2 -2
- package/.docs/raw/docs/guides/mcp-apps.mdx +231 -0
- package/.docs/raw/docs/guides/mentions.mdx +2 -2
- package/.docs/raw/docs/guides/message-timing.mdx +38 -5
- package/.docs/raw/docs/guides/multi-agent.mdx +2 -2
- 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 +1 -1
- package/.docs/raw/docs/guides/speech.mdx +2 -2
- package/.docs/raw/docs/guides/suggestions.mdx +88 -4
- package/.docs/raw/docs/guides/tool-ui.mdx +2 -2
- package/.docs/raw/docs/guides/tools.mdx +66 -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/index.mdx +10 -11
- package/.docs/raw/docs/ink/primitives.mdx +349 -8
- 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 +2 -2
- 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 +15 -3
- 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/tools/react-mcp.mdx +337 -0
- package/.docs/raw/docs/primitives/composer.mdx +53 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -2
- package/.docs/raw/docs/primitives/suggestion.mdx +9 -0
- package/.docs/raw/docs/react-native/hooks.mdx +2 -2
- package/.docs/raw/docs/react-native/index.mdx +4 -4
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +4 -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 +7 -0
- 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/overview.mdx +2 -2
- 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/overview.mdx +2 -2
- 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/ui/composer-trigger-popover.mdx +11 -1
- 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/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/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/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/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,41 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Runtime Hooks
|
|
3
|
-
description:
|
|
3
|
+
description: Runtime creation hooks for local, remote, cloud, external-store, and AI SDK powered assistant-ui chat experiences.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { useCloudThreadListRuntime, useLocalRuntime, useRemoteThreadListRuntime } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
AssistantRuntimeProvider,
|
|
11
|
-
useLocalRuntime,
|
|
12
|
-
} from "@assistant-ui/react";
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
{/* api-reference:start */}
|
|
12
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
13
|
+
{/* Do not edit this block manually. */}
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
19
|
-
{children}
|
|
20
|
-
</AssistantRuntimeProvider>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
```
|
|
15
|
+
## API Reference
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
### useCloudThreadListRuntime
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
- [`useRemoteThreadListRuntime`](/docs/runtimes/concepts/threads) adds backend-backed thread list management.
|
|
29
|
-
- [`useExternalStoreRuntime`](/docs/runtimes/custom/external-store) adapts an external message store.
|
|
30
|
-
- [`useAssistantTransportRuntime`](/docs/runtimes/custom/assistant-transport) consumes assistant-stream transport events.
|
|
19
|
+
<ParametersTable {...useCloudThreadListRuntime} />
|
|
31
20
|
|
|
32
|
-
|
|
21
|
+
### useLocalRuntime
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
- [`useDataStreamRuntime`](/docs/runtimes/custom/data-stream) adapts assistant-stream data streams.
|
|
36
|
-
- [`useLangGraphRuntime`](/docs/runtimes/langgraph/overview) adapts LangGraph.
|
|
37
|
-
- [`useCloudThreadListRuntime`](/docs/cloud) uses Assistant Cloud for thread persistence.
|
|
23
|
+
<ParametersTable {...useLocalRuntime} />
|
|
38
24
|
|
|
39
|
-
|
|
25
|
+
### useRemoteThreadListRuntime
|
|
40
26
|
|
|
41
|
-
|
|
27
|
+
<ParametersTable {...useRemoteThreadListRuntime} />
|
|
28
|
+
{/* api-reference:end */}
|
|
@@ -1,26 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: State Hooks
|
|
3
|
-
description:
|
|
3
|
+
description: State selector and action hooks for reading assistant-ui runtime state and controlling threads, composers, messages, and attachments.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import { useAuiEvent, useAuiState } from "@/generated/typeDocs";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
{/* AUTO-GENERATED PAGE by scripts/generate-api-reference.mts */}
|
|
9
|
+
{/* Do not edit manually. */}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
{/* api-reference:start */}
|
|
12
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
13
|
+
{/* Do not edit this block manually. */}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
const isRunning = useAuiState((s) => s.thread.isRunning);
|
|
15
|
-
const composerText = useAuiState((s) => s.composer.text);
|
|
16
|
-
```
|
|
15
|
+
## API Reference
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
### useAui
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
Returns the current `AssistantClient` from context.
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
Read the client supplied by the nearest [AuiProvider](/docs/api-reference/context-providers/assistant-runtime-provider#auiprovider) or
|
|
22
|
+
[AssistantRuntimeProvider](/docs/api-reference/context-providers/assistant-runtime-provider#assistantruntimeprovider), then access a scope on it —
|
|
23
|
+
`aui.thread()`, `aui.composer()`, `aui.message()`, and so on. Pair
|
|
24
|
+
with [useAuiState](/docs/api-reference/hooks/state#useauistate) to read reactive state and [useAuiEvent](/docs/api-reference/hooks/state#useauievent)
|
|
25
|
+
to subscribe to events. The returned client also exposes lower-level
|
|
26
|
+
methods such as `aui.on(...)` and `aui.subscribe(...)`; prefer
|
|
27
|
+
`useAuiEvent` for React event subscriptions.
|
|
23
28
|
|
|
29
|
+
Rendered outside a provider, the returned client's scope accessors
|
|
30
|
+
throw a descriptive error whenever they are called.
|
|
31
|
+
|
|
32
|
+
{/* api-example:useAui:start */}
|
|
24
33
|
```tsx
|
|
25
34
|
import { useAui } from "@assistant-ui/react";
|
|
26
35
|
|
|
@@ -30,19 +39,56 @@ aui.composer().setText("Hello");
|
|
|
30
39
|
aui.composer().send();
|
|
31
40
|
aui.thread().cancelRun();
|
|
32
41
|
```
|
|
42
|
+
{/* api-example:useAui:end */}
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
function useAui(): AssistantClient;
|
|
46
|
+
```
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
### useAuiEvent
|
|
35
49
|
|
|
36
|
-
|
|
50
|
+
Subscribes to an assistant event for the lifetime of the component.
|
|
37
51
|
|
|
38
|
-
|
|
52
|
+
The subscription is established on mount and re-established whenever the
|
|
53
|
+
scope or event name changes. The `callback` is wrapped in an effect-event
|
|
54
|
+
shim, so the latest closure is invoked on each emission — you do not
|
|
55
|
+
need to memoize it.
|
|
39
56
|
|
|
57
|
+
{/* api-example:useAuiEvent:start */}
|
|
40
58
|
```tsx
|
|
41
59
|
import { useAuiEvent } from "@assistant-ui/react";
|
|
42
60
|
|
|
43
|
-
useAuiEvent("thread.
|
|
44
|
-
console.log("
|
|
61
|
+
useAuiEvent("thread.modelContextUpdate", ({ threadId }) => {
|
|
62
|
+
console.log("Model context updated", threadId);
|
|
45
63
|
});
|
|
46
64
|
```
|
|
65
|
+
{/* api-example:useAuiEvent:end */}
|
|
66
|
+
|
|
67
|
+
<ParametersTable {...useAuiEvent} />
|
|
68
|
+
|
|
69
|
+
### useAuiState
|
|
70
|
+
|
|
71
|
+
Subscribes to a slice of [AssistantState](/docs/api-reference/primitives/assistant-if#assistantstate) and re-renders the
|
|
72
|
+
component whenever that slice changes.
|
|
73
|
+
|
|
74
|
+
The `selector` is called on every store update; its return value is
|
|
75
|
+
compared by `Object.is`, and the component re-renders only when the
|
|
76
|
+
selected slice changes. Returning the entire state object is not
|
|
77
|
+
supported and throws at runtime — select a specific field instead, or
|
|
78
|
+
compose multiple `useAuiState` calls. Returning a new object or array
|
|
79
|
+
literal, including spreading `s.thread` into a new object, causes a
|
|
80
|
+
re-render on every store update; either select primitives or return a
|
|
81
|
+
memoized reference.
|
|
82
|
+
|
|
83
|
+
{/* api-example:useAuiState:start */}
|
|
84
|
+
```tsx
|
|
85
|
+
import { useAuiState } from "@assistant-ui/react";
|
|
86
|
+
|
|
87
|
+
const messages = useAuiState((s) => s.thread.messages);
|
|
88
|
+
const isRunning = useAuiState((s) => s.thread.isRunning);
|
|
89
|
+
const composerText = useAuiState((s) => s.composer.text);
|
|
90
|
+
```
|
|
91
|
+
{/* api-example:useAuiState:end */}
|
|
47
92
|
|
|
48
|
-
|
|
93
|
+
<ParametersTable {...useAuiState} />
|
|
94
|
+
{/* api-reference:end */}
|
|
@@ -28,3 +28,437 @@ These hooks are intended for custom message part renderers. They read the neares
|
|
|
28
28
|
- `useScrollLock` helps reasoning and grouped-part UIs preserve scroll behavior while content changes.
|
|
29
29
|
|
|
30
30
|
For primitive-specific prop APIs, see [Primitives](/docs/api-reference/primitives).
|
|
31
|
+
|
|
32
|
+
{/* api-reference:start */}
|
|
33
|
+
{/* AUTO-GENERATED by scripts/generate-api-reference.mts */}
|
|
34
|
+
{/* Do not edit this block manually. */}
|
|
35
|
+
|
|
36
|
+
## API Reference
|
|
37
|
+
|
|
38
|
+
Generated reference for Utilities.
|
|
39
|
+
|
|
40
|
+
### unstable_useCloudThreadListAdapter
|
|
41
|
+
|
|
42
|
+
Deprecated: Use `useCloudThreadListAdapter` instead.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { unstable_useCloudThreadListAdapter } from "@assistant-ui/react";
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Source: `packages/core/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx`
|
|
49
|
+
|
|
50
|
+
### unstable_useMentionAdapter
|
|
51
|
+
|
|
52
|
+
Deprecated: Under active development and might change without notice.
|
|
53
|
+
|
|
54
|
+
Creates a spreadable `\{ adapter, directive \}` bundle for `@` mentions.
|
|
55
|
+
Supports tools registered via `useAssistantTool`, explicit items, or both —
|
|
56
|
+
flat or categorized.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { unstable_useMentionAdapter } from "@assistant-ui/react";
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Source: `packages/react/src/unstable/useMentionAdapter.ts`
|
|
63
|
+
|
|
64
|
+
### unstable_useSlashCommandAdapter
|
|
65
|
+
|
|
66
|
+
Deprecated: Under active development and may change without notice.
|
|
67
|
+
|
|
68
|
+
Bundles slash command definitions (with inline `execute` callbacks) into
|
|
69
|
+
`\{adapter, action\}` that plug directly into `ComposerTriggerPopover`.
|
|
70
|
+
`execute` stays in the hook closure and is never attached to the returned
|
|
71
|
+
`TriggerItem`, keeping items serializable.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { unstable_useSlashCommandAdapter } from "@assistant-ui/react";
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Source: `packages/react/src/unstable/useSlashCommandAdapter.ts`
|
|
78
|
+
|
|
79
|
+
### unstable_useTriggerPopoverRootContext
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { unstable_useTriggerPopoverRootContext } from "@assistant-ui/react";
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
|
|
86
|
+
|
|
87
|
+
### unstable_useTriggerPopoverRootContextOptional
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { unstable_useTriggerPopoverRootContextOptional } from "@assistant-ui/react";
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
|
|
94
|
+
|
|
95
|
+
### unstable_useTriggerPopoverScopeContext
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
import { unstable_useTriggerPopoverScopeContext } from "@assistant-ui/react";
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopover.tsx`
|
|
102
|
+
|
|
103
|
+
### unstable_useTriggerPopoverScopeContextOptional
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import { unstable_useTriggerPopoverScopeContextOptional } from "@assistant-ui/react";
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopover.tsx`
|
|
110
|
+
|
|
111
|
+
### unstable_useTriggerPopoverTriggers
|
|
112
|
+
|
|
113
|
+
Live map of registered triggers, re-rendering on change. Prefer
|
|
114
|
+
`subscribeLifecycle` for incremental add/remove handling.
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import { unstable_useTriggerPopoverTriggers } from "@assistant-ui/react";
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
|
|
121
|
+
|
|
122
|
+
### unstable_useTriggerPopoverTriggersOptional
|
|
123
|
+
|
|
124
|
+
Like `useTriggerPopoverTriggers` but returns an empty map outside a root.
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import { unstable_useTriggerPopoverTriggersOptional } from "@assistant-ui/react";
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Source: `packages/react/src/primitives/composer/trigger/TriggerPopoverRootContext.tsx`
|
|
131
|
+
|
|
132
|
+
### useAssistantApi
|
|
133
|
+
|
|
134
|
+
Deprecated: Use `useAui` instead. This alias will be removed in v0.13.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
import { useAssistantApi } from "@assistant-ui/react";
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Source: `packages/store/src/useAui.ts`
|
|
141
|
+
|
|
142
|
+
### useAssistantEvent
|
|
143
|
+
|
|
144
|
+
Deprecated: Use `useAuiEvent` instead. This alias will be removed in v0.13.
|
|
145
|
+
|
|
146
|
+
```tsx
|
|
147
|
+
import { useAssistantEvent } from "@assistant-ui/react";
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Source: `packages/store/src/useAuiEvent.ts`
|
|
151
|
+
|
|
152
|
+
### useAssistantFrameHost
|
|
153
|
+
|
|
154
|
+
React hook that manages the lifecycle of an AssistantFrameHost and its binding to the current AssistantRuntime.
|
|
155
|
+
|
|
156
|
+
Usage example:
|
|
157
|
+
```typescript
|
|
158
|
+
function MyComponent() {
|
|
159
|
+
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
160
|
+
|
|
161
|
+
useAssistantFrameHost({
|
|
162
|
+
iframeRef,
|
|
163
|
+
targetOrigin: "https://trusted-domain.com", // optional
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
return <iframe ref={iframeRef} src="..." />;
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
import { useAssistantFrameHost } from "@assistant-ui/react";
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Source: `packages/react/src/model-context/frame/useAssistantFrameHost.ts`
|
|
175
|
+
|
|
176
|
+
### useAssistantState
|
|
177
|
+
|
|
178
|
+
Deprecated: Use `useAuiState` instead. This alias will be removed in v0.13.
|
|
179
|
+
|
|
180
|
+
Hook to access a slice of the assistant state with automatic subscription
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { useAssistantState } from "@assistant-ui/react";
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Source: `packages/store/src/useAuiState.ts`
|
|
187
|
+
|
|
188
|
+
### useAttachment
|
|
189
|
+
|
|
190
|
+
Deprecated: Use `useAuiState((s) => s.attachment)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { useAttachment } from "@assistant-ui/react";
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
|
|
197
|
+
|
|
198
|
+
### useCloudThreadListAdapter
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
import { useCloudThreadListAdapter } from "@assistant-ui/react";
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Source: `packages/core/src/react/runtimes/cloud/useCloudThreadListAdapter.tsx`
|
|
205
|
+
|
|
206
|
+
### useComposer
|
|
207
|
+
|
|
208
|
+
Deprecated: Use `useAuiState((s) => s.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
209
|
+
|
|
210
|
+
Hook to access the current composer state.
|
|
211
|
+
|
|
212
|
+
This hook provides reactive access to the composer's state, including text content,
|
|
213
|
+
attachments, editing status, and send/cancel capabilities.
|
|
214
|
+
|
|
215
|
+
```tsx
|
|
216
|
+
import { useComposer } from "@assistant-ui/react";
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Source: `packages/react/src/legacy-runtime/hooks/ComposerContext.ts`
|
|
220
|
+
|
|
221
|
+
### useEditComposer
|
|
222
|
+
|
|
223
|
+
Deprecated: Use `useAuiState((s) => s.message.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
import { useEditComposer } from "@assistant-ui/react";
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Source: `packages/react/src/legacy-runtime/hooks/MessageContext.ts`
|
|
230
|
+
|
|
231
|
+
### useEditComposerAttachment
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
import { useEditComposerAttachment } from "@assistant-ui/react";
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
|
|
238
|
+
|
|
239
|
+
### useExternalMessageConverter
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
import { useExternalMessageConverter } from "@assistant-ui/react";
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Source: `packages/core/src/react/runtimes/external-message-converter.ts`
|
|
246
|
+
|
|
247
|
+
### useMessage
|
|
248
|
+
|
|
249
|
+
Deprecated: Use `useAuiState((s) => s.message)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
250
|
+
|
|
251
|
+
Hook to access the current message state.
|
|
252
|
+
|
|
253
|
+
This hook provides reactive access to the message's state, including content,
|
|
254
|
+
role, status, and other message-level properties.
|
|
255
|
+
|
|
256
|
+
```tsx
|
|
257
|
+
import { useMessage } from "@assistant-ui/react";
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Source: `packages/react/src/legacy-runtime/hooks/MessageContext.ts`
|
|
261
|
+
|
|
262
|
+
### useMessageAttachment
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
import { useMessageAttachment } from "@assistant-ui/react";
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
|
|
269
|
+
|
|
270
|
+
### useMessagePart
|
|
271
|
+
|
|
272
|
+
Deprecated: Use `useAuiState((s) => s.part)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
import { useMessagePart } from "@assistant-ui/react";
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Source: `packages/react/src/legacy-runtime/hooks/MessagePartContext.ts`
|
|
279
|
+
|
|
280
|
+
### useMessagePartData
|
|
281
|
+
|
|
282
|
+
```tsx
|
|
283
|
+
import { useMessagePartData } from "@assistant-ui/react";
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartData.ts`
|
|
287
|
+
|
|
288
|
+
### useMessagePartFile
|
|
289
|
+
|
|
290
|
+
```tsx
|
|
291
|
+
import { useMessagePartFile } from "@assistant-ui/react";
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartFile.ts`
|
|
295
|
+
|
|
296
|
+
### useMessagePartImage
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
import { useMessagePartImage } from "@assistant-ui/react";
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartImage.ts`
|
|
303
|
+
|
|
304
|
+
### useMessagePartReasoning
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
import { useMessagePartReasoning } from "@assistant-ui/react";
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartReasoning.ts`
|
|
311
|
+
|
|
312
|
+
### useMessagePartSource
|
|
313
|
+
|
|
314
|
+
```tsx
|
|
315
|
+
import { useMessagePartSource } from "@assistant-ui/react";
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartSource.ts`
|
|
319
|
+
|
|
320
|
+
### useMessagePartText
|
|
321
|
+
|
|
322
|
+
```tsx
|
|
323
|
+
import { useMessagePartText } from "@assistant-ui/react";
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Source: `packages/react/src/primitives/messagePart/useMessagePartText.ts`
|
|
327
|
+
|
|
328
|
+
### useMessageQuote
|
|
329
|
+
|
|
330
|
+
Hook that returns the quote info for the current message, if any.
|
|
331
|
+
|
|
332
|
+
Reads from `message.metadata.custom.quote`.
|
|
333
|
+
|
|
334
|
+
```tsx
|
|
335
|
+
import { useMessageQuote } from "@assistant-ui/react";
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
Source: `packages/react/src/hooks/useMessageQuote.ts`
|
|
339
|
+
|
|
340
|
+
### useMessageTiming
|
|
341
|
+
|
|
342
|
+
Hook that returns timing information for the current assistant message.
|
|
343
|
+
|
|
344
|
+
Reads from `message.metadata.timing`.
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
import { useMessageTiming } from "@assistant-ui/react";
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
Source: `packages/react/src/hooks/useMessageTiming.ts`
|
|
351
|
+
|
|
352
|
+
### useRuntimeAdapters
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
import { useRuntimeAdapters } from "@assistant-ui/react";
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Source: `packages/core/src/react/runtimes/RuntimeAdapterProvider.tsx`
|
|
359
|
+
|
|
360
|
+
### useScrollLock
|
|
361
|
+
|
|
362
|
+
Locks scroll position during collapsible/height animations and hides scrollbar.
|
|
363
|
+
|
|
364
|
+
This utility prevents page jumps when content height changes during animations,
|
|
365
|
+
providing a smooth user experience. It finds the nearest scrollable ancestor and
|
|
366
|
+
temporarily locks its scroll position while the animation completes.
|
|
367
|
+
|
|
368
|
+
- Prevents forced reflows: no layout reads, mutations scoped to scrollable parent only
|
|
369
|
+
- Reactive: only intercepts scroll events when browser actually adjusts
|
|
370
|
+
- Cleans up automatically after animation duration
|
|
371
|
+
|
|
372
|
+
```tsx
|
|
373
|
+
import { useScrollLock } from "@assistant-ui/react";
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Source: `packages/react/src/primitives/reasoning/useScrollLock.ts`
|
|
377
|
+
|
|
378
|
+
### useThread
|
|
379
|
+
|
|
380
|
+
Deprecated: Use `useAuiState((s) => s.thread)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
381
|
+
|
|
382
|
+
Hook to access the current thread state.
|
|
383
|
+
|
|
384
|
+
This hook provides reactive access to the thread's state, including messages,
|
|
385
|
+
running status, capabilities, and other thread-level properties.
|
|
386
|
+
|
|
387
|
+
```tsx
|
|
388
|
+
import { useThread } from "@assistant-ui/react";
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
|
|
392
|
+
|
|
393
|
+
### useThreadComposer
|
|
394
|
+
|
|
395
|
+
Deprecated: Use `useAuiState((s) => s.thread.composer)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
396
|
+
|
|
397
|
+
```tsx
|
|
398
|
+
import { useThreadComposer } from "@assistant-ui/react";
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
|
|
402
|
+
|
|
403
|
+
### useThreadComposerAttachment
|
|
404
|
+
|
|
405
|
+
```tsx
|
|
406
|
+
import { useThreadComposerAttachment } from "@assistant-ui/react";
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Source: `packages/react/src/legacy-runtime/hooks/AttachmentContext.ts`
|
|
410
|
+
|
|
411
|
+
### useThreadList
|
|
412
|
+
|
|
413
|
+
Deprecated: Use `useAuiState((s) => s.threads)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
414
|
+
|
|
415
|
+
```tsx
|
|
416
|
+
import { useThreadList } from "@assistant-ui/react";
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Source: `packages/react/src/legacy-runtime/hooks/AssistantContext.ts`
|
|
420
|
+
|
|
421
|
+
### useThreadListItem
|
|
422
|
+
|
|
423
|
+
Deprecated: Use `useAuiState((s) => s.threadListItem)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
424
|
+
|
|
425
|
+
```tsx
|
|
426
|
+
import { useThreadListItem } from "@assistant-ui/react";
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
Source: `packages/react/src/legacy-runtime/hooks/ThreadListItemContext.ts`
|
|
430
|
+
|
|
431
|
+
### useThreadModelContext
|
|
432
|
+
|
|
433
|
+
Deprecated: Use `useAuiState((s) => s.thread.modelContext)` instead. See migration guide: https://assistant-ui.com/docs/migrations/v0-12
|
|
434
|
+
|
|
435
|
+
```tsx
|
|
436
|
+
import { useThreadModelContext } from "@assistant-ui/react";
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Source: `packages/react/src/legacy-runtime/hooks/ThreadContext.ts`
|
|
440
|
+
|
|
441
|
+
### useThreadViewport
|
|
442
|
+
|
|
443
|
+
```tsx
|
|
444
|
+
import { useThreadViewport } from "@assistant-ui/react";
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
Source: `packages/react/src/context/react/ThreadViewportContext.ts`
|
|
448
|
+
|
|
449
|
+
### useThreadViewportAutoScroll
|
|
450
|
+
|
|
451
|
+
```tsx
|
|
452
|
+
import { useThreadViewportAutoScroll } from "@assistant-ui/react";
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
Source: `packages/react/src/primitives/thread/useThreadViewportAutoScroll.ts`
|
|
456
|
+
|
|
457
|
+
### useThreadViewportStore
|
|
458
|
+
|
|
459
|
+
```tsx
|
|
460
|
+
import { useThreadViewportStore } from "@assistant-ui/react";
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Source: `packages/react/src/context/react/ThreadViewportContext.ts`
|
|
464
|
+
{/* api-reference:end */}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "@assistant-ui/cloud-ai-sdk"
|
|
3
|
+
description: Assistant Cloud AI SDK hooks for connecting cloud-backed threads, persistence, and chat state to assistant-ui React runtimes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import { cloudAiSdk_useCloudChat, cloudAiSdk_useThreads } from "@/generated/integrationTypeDocs";
|
|
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
|
+
### useCloudChat
|
|
18
|
+
|
|
19
|
+
<ParametersTable {...cloudAiSdk_useCloudChat} />
|
|
20
|
+
|
|
21
|
+
### useThreads
|
|
22
|
+
|
|
23
|
+
<ParametersTable {...cloudAiSdk_useThreads} />
|
|
24
|
+
{/* api-reference:end */}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description: Package-level
|
|
2
|
+
title: Integrations API Reference
|
|
3
|
+
description: Package-level APIs for connecting assistant-ui React to the Vercel AI SDK, Assistant Cloud, and adjacent chat ecosystem hooks and runtimes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
{/* AUTO-GENERATED by scripts/generate-api-reference
|
|
7
|
-
{/*
|
|
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
|
-
|
|
9
|
+
{/* api-manual:start */}
|
|
10
|
+
Integration packages connect assistant-ui to adjacent React and AI SDK ecosystems. Use this section when you need the exact hooks, options, and helper exports for a package such as `@assistant-ui/react-ai-sdk` or `@assistant-ui/cloud-ai-sdk`.
|
|
11
|
+
{/* api-manual:end */}
|
|
10
12
|
|
|
11
13
|
## Pages
|
|
12
14
|
|
|
13
15
|
<Cards>
|
|
14
|
-
<Card title={"@assistant-ui/react-ai-sdk"} href={"/docs/api-reference/integrations/
|
|
15
|
-
{"Vercel AI SDK
|
|
16
|
+
<Card title={"@assistant-ui/react-ai-sdk"} href={"/docs/api-reference/integrations/react-ai-sdk"}>
|
|
17
|
+
{"Vercel AI SDK runtime hooks, chat transports, and message conversion utilities for assistant-ui React applications."}
|
|
16
18
|
</Card>
|
|
17
|
-
<Card title={"@assistant-ui/
|
|
18
|
-
{"
|
|
19
|
-
</Card>
|
|
20
|
-
<Card title={"@assistant-ui/react-hook-form"} href={"/docs/api-reference/integrations/react-hook-form"}>
|
|
21
|
-
{"React Hook Form integration for AI-assisted form filling."}
|
|
19
|
+
<Card title={"@assistant-ui/cloud-ai-sdk"} href={"/docs/api-reference/integrations/cloud-ai-sdk"}>
|
|
20
|
+
{"Assistant Cloud AI SDK hooks for connecting cloud-backed threads, persistence, and chat state to assistant-ui React runtimes."}
|
|
22
21
|
</Card>
|
|
23
22
|
</Cards>
|