@assistant-ui/mcp-docs-server 0.2.3 → 0.3.1
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/README.md +16 -43
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -91
- package/dist/index.js.map +1 -1
- package/dist/proxy.d.ts +9 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +91 -0
- package/dist/proxy.js.map +1 -0
- package/package.json +8 -12
- package/src/index.ts +3 -115
- package/src/proxy.test.ts +385 -0
- package/src/proxy.ts +126 -0
- package/.docs/organized/code-examples/waterfall.md +0 -807
- package/.docs/organized/code-examples/with-a2a.md +0 -675
- package/.docs/organized/code-examples/with-ag-ui.md +0 -553
- package/.docs/organized/code-examples/with-ai-sdk-v7.md +0 -466
- package/.docs/organized/code-examples/with-artifacts.md +0 -815
- package/.docs/organized/code-examples/with-assistant-transport.md +0 -576
- package/.docs/organized/code-examples/with-browser-extension.md +0 -371
- package/.docs/organized/code-examples/with-chain-of-thought.md +0 -962
- package/.docs/organized/code-examples/with-cloud-standalone.md +0 -681
- package/.docs/organized/code-examples/with-cloud.md +0 -439
- package/.docs/organized/code-examples/with-custom-thread-list.md +0 -569
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +0 -527
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +0 -697
- package/.docs/organized/code-examples/with-eve.md +0 -405
- package/.docs/organized/code-examples/with-expo.md +0 -2246
- package/.docs/organized/code-examples/with-external-store.md +0 -421
- package/.docs/organized/code-examples/with-ffmpeg.md +0 -829
- package/.docs/organized/code-examples/with-generative-ui.md +0 -1810
- package/.docs/organized/code-examples/with-google-adk.md +0 -368
- package/.docs/organized/code-examples/with-heat-graph.md +0 -304
- package/.docs/organized/code-examples/with-image-generation.md +0 -463
- package/.docs/organized/code-examples/with-interactables.md +0 -733
- package/.docs/organized/code-examples/with-langchain.md +0 -446
- package/.docs/organized/code-examples/with-langgraph.md +0 -855
- package/.docs/organized/code-examples/with-livekit.md +0 -643
- package/.docs/organized/code-examples/with-mcp.md +0 -782
- package/.docs/organized/code-examples/with-nuxt.md +0 -2428
- package/.docs/organized/code-examples/with-opencode.md +0 -1974
- package/.docs/organized/code-examples/with-openui.md +0 -450
- package/.docs/organized/code-examples/with-pi.md +0 -2084
- package/.docs/organized/code-examples/with-react-hook-form.md +0 -727
- package/.docs/organized/code-examples/with-react-ink-web.md +0 -740
- package/.docs/organized/code-examples/with-react-ink.md +0 -473
- package/.docs/organized/code-examples/with-react-router.md +0 -936
- package/.docs/organized/code-examples/with-resumable-stream.md +0 -668
- package/.docs/organized/code-examples/with-store.md +0 -679
- package/.docs/organized/code-examples/with-svelte.md +0 -415
- package/.docs/organized/code-examples/with-sveltekit.md +0 -1061
- package/.docs/organized/code-examples/with-tanstack.md +0 -812
- package/.docs/organized/code-examples/with-tap-runtime.md +0 -813
- package/.docs/organized/code-examples/with-virtualized-thread.md +0 -681
- package/.docs/organized/code-examples/with-vue.md +0 -408
- package/.docs/raw/docs/(getting-started)/architecture.mdx +0 -146
- package/.docs/raw/docs/(getting-started)/base-ui.mdx +0 -39
- package/.docs/raw/docs/(getting-started)/cli.mdx +0 -542
- package/.docs/raw/docs/(getting-started)/devtools.mdx +0 -79
- package/.docs/raw/docs/(getting-started)/index.mdx +0 -23
- package/.docs/raw/docs/(getting-started)/installation.mdx +0 -483
- package/.docs/raw/docs/(getting-started)/llm.mdx +0 -211
- package/.docs/raw/docs/(getting-started)/rtl.mdx +0 -78
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +0 -36
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +0 -34
- package/.docs/raw/docs/(reference)/api-reference/adapters/model.mdx +0 -44
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +0 -59
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/adapters/suggestions.mdx +0 -26
- package/.docs/raw/docs/(reference)/api-reference/context-providers/assistant-runtime-provider.mdx +0 -84
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/context-providers/scoped-providers.mdx +0 -64
- package/.docs/raw/docs/(reference)/api-reference/external-store/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +0 -57
- package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +0 -49
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/a2ui.mdx +0 -40
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/actions.mdx +0 -56
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/components.mdx +0 -86
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +0 -39
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/json-generative-ui.mdx +0 -42
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +0 -84
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/slack.mdx +0 -85
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +0 -45
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/teams.mdx +0 -93
- package/.docs/raw/docs/(reference)/api-reference/generative-ui/tokens.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +0 -129
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +0 -31
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +0 -34
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +0 -350
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +0 -28
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +0 -97
- package/.docs/raw/docs/(reference)/api-reference/integrations/ai-sdk.mdx +0 -200
- package/.docs/raw/docs/(reference)/api-reference/integrations/cloud-ai-sdk.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +0 -118
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +0 -28
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +0 -37
- package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +0 -50
- package/.docs/raw/docs/(reference)/api-reference/model-context/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/model-context/registry.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +0 -566
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +0 -152
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +0 -239
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +0 -208
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +0 -108
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +0 -99
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +0 -145
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +0 -82
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +0 -637
- package/.docs/raw/docs/(reference)/api-reference/primitives/composition.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/primitives/error.mdx +0 -65
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +0 -73
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +0 -117
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +0 -339
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +0 -77
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +0 -88
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +0 -81
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item-more.mdx +0 -129
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +0 -138
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +0 -122
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +0 -289
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +0 -32
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +0 -43
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +0 -43
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/queue-state.mdx +0 -20
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +0 -24
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +0 -36
- package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +0 -85
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +0 -45
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +0 -55
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +0 -151
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +0 -106
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +0 -178
- package/.docs/raw/docs/(reference)/api-reference/transport/assistant-transport.mdx +0 -48
- package/.docs/raw/docs/(reference)/api-reference/transport/frame.mdx +0 -62
- package/.docs/raw/docs/(reference)/api-reference/transport/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/utilities/index.mdx +0 -19
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +0 -152
- package/.docs/raw/docs/(reference)/api-reference/voice/index.mdx +0 -22
- package/.docs/raw/docs/(reference)/api-reference/voice/session.mdx +0 -54
- package/.docs/raw/docs/(reference)/api-reference/voice/speech-dictation.mdx +0 -36
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +0 -527
- package/.docs/raw/docs/cloud/ai-sdk.mdx +0 -604
- package/.docs/raw/docs/cloud/authorization.mdx +0 -252
- package/.docs/raw/docs/cloud/index.mdx +0 -46
- package/.docs/raw/docs/cloud/langgraph.mdx +0 -554
- package/.docs/raw/docs/copilots/assistant-frame.mdx +0 -411
- package/.docs/raw/docs/copilots/make-assistant-visible.mdx +0 -82
- package/.docs/raw/docs/copilots/model-context.mdx +0 -156
- package/.docs/raw/docs/copilots/motivation.mdx +0 -202
- package/.docs/raw/docs/copilots/use-assistant-instructions.mdx +0 -64
- package/.docs/raw/docs/guides/attachments.mdx +0 -619
- package/.docs/raw/docs/guides/branching.mdx +0 -76
- package/.docs/raw/docs/guides/chain-of-thought.mdx +0 -164
- package/.docs/raw/docs/guides/chatgpt-subscription.mdx +0 -108
- package/.docs/raw/docs/guides/context-api.mdx +0 -619
- package/.docs/raw/docs/guides/dictation.mdx +0 -298
- package/.docs/raw/docs/guides/editing.mdx +0 -102
- package/.docs/raw/docs/guides/electron.mdx +0 -369
- package/.docs/raw/docs/guides/headless-composer-input.mdx +0 -113
- package/.docs/raw/docs/guides/image-generation.mdx +0 -74
- package/.docs/raw/docs/guides/index.mdx +0 -117
- package/.docs/raw/docs/guides/input-history.mdx +0 -55
- package/.docs/raw/docs/guides/latex.mdx +0 -158
- package/.docs/raw/docs/guides/mentions.mdx +0 -575
- package/.docs/raw/docs/guides/message-timing.mdx +0 -215
- package/.docs/raw/docs/guides/quoting.mdx +0 -169
- package/.docs/raw/docs/guides/resumable-stream-deployment.mdx +0 -212
- package/.docs/raw/docs/guides/resumable-stream-stores.mdx +0 -152
- package/.docs/raw/docs/guides/resumable-streams.mdx +0 -292
- package/.docs/raw/docs/guides/slash-commands.mdx +0 -358
- package/.docs/raw/docs/guides/speech.mdx +0 -172
- package/.docs/raw/docs/guides/suggestions.mdx +0 -384
- package/.docs/raw/docs/guides/virtualization.mdx +0 -133
- package/.docs/raw/docs/guides/voice.mdx +0 -310
- package/.docs/raw/docs/ink/adapters.mdx +0 -99
- package/.docs/raw/docs/ink/custom-backend.mdx +0 -254
- package/.docs/raw/docs/ink/hooks.mdx +0 -469
- package/.docs/raw/docs/ink/index.mdx +0 -237
- package/.docs/raw/docs/ink/migration.mdx +0 -138
- package/.docs/raw/docs/ink/primitives.mdx +0 -1259
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +0 -528
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +0 -188
- package/.docs/raw/docs/integrations/auth/clerk.mdx +0 -166
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +0 -191
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +0 -88
- package/.docs/raw/docs/integrations/frameworks/cloudflare-agents.mdx +0 -283
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +0 -188
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +0 -57
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +0 -201
- package/.docs/raw/docs/integrations/gateways/index.mdx +0 -162
- package/.docs/raw/docs/integrations/index.mdx +0 -178
- package/.docs/raw/docs/integrations/observability/helicone.mdx +0 -129
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +0 -161
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +0 -151
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +0 -773
- package/.docs/raw/docs/migrations/deprecation-policy.mdx +0 -42
- package/.docs/raw/docs/migrations/index.mdx +0 -50
- package/.docs/raw/docs/migrations/react-compatibility.mdx +0 -74
- package/.docs/raw/docs/migrations/react-langgraph-v0-7.mdx +0 -328
- package/.docs/raw/docs/migrations/toolkit-tools.mdx +0 -236
- package/.docs/raw/docs/migrations/v0-11.mdx +0 -172
- package/.docs/raw/docs/migrations/v0-12.mdx +0 -302
- package/.docs/raw/docs/migrations/v0-14.mdx +0 -297
- package/.docs/raw/docs/migrations/v0-15.mdx +0 -270
- package/.docs/raw/docs/primitives/action-bar.mdx +0 -352
- package/.docs/raw/docs/primitives/assistant-modal.mdx +0 -216
- package/.docs/raw/docs/primitives/attachment.mdx +0 -217
- package/.docs/raw/docs/primitives/branch-picker.mdx +0 -222
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +0 -315
- package/.docs/raw/docs/primitives/composer.mdx +0 -659
- package/.docs/raw/docs/primitives/error.mdx +0 -142
- package/.docs/raw/docs/primitives/index.mdx +0 -99
- package/.docs/raw/docs/primitives/message.mdx +0 -618
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +0 -191
- package/.docs/raw/docs/primitives/suggestion.mdx +0 -254
- package/.docs/raw/docs/primitives/thread-list.mdx +0 -467
- package/.docs/raw/docs/primitives/thread.mdx +0 -509
- package/.docs/raw/docs/react-native/adapters.mdx +0 -94
- package/.docs/raw/docs/react-native/custom-backend.mdx +0 -207
- package/.docs/raw/docs/react-native/hooks.mdx +0 -339
- package/.docs/raw/docs/react-native/index.mdx +0 -289
- package/.docs/raw/docs/react-native/migration.mdx +0 -142
- package/.docs/raw/docs/react-native/primitives.mdx +0 -976
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +0 -399
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +0 -60
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +0 -216
- package/.docs/raw/docs/runtimes/ag-ui/agent-state.mdx +0 -124
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +0 -70
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +0 -243
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +0 -267
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +0 -61
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +0 -122
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +0 -135
- package/.docs/raw/docs/runtimes/ai-sdk/v6-legacy.mdx +0 -636
- package/.docs/raw/docs/runtimes/ai-sdk/v7.mdx +0 -731
- package/.docs/raw/docs/runtimes/claude-managed-agents.mdx +0 -118
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +0 -265
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +0 -167
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +0 -68
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +0 -513
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +0 -763
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +0 -339
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +0 -957
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +0 -902
- package/.docs/raw/docs/runtimes/custom/overview.mdx +0 -71
- package/.docs/raw/docs/runtimes/eve/overview.mdx +0 -151
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +0 -192
- package/.docs/raw/docs/runtimes/google-adk/api.mdx +0 -256
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +0 -784
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +0 -69
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +0 -229
- package/.docs/raw/docs/runtimes/langchain.mdx +0 -901
- package/.docs/raw/docs/runtimes/langgraph/agent-state.mdx +0 -181
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +0 -305
- package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +0 -104
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +0 -84
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +0 -496
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +0 -144
- package/.docs/raw/docs/runtimes/langgraph/threads.mdx +0 -113
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +0 -29
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -93
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +0 -347
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +0 -393
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +0 -194
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +0 -58
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +0 -119
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +0 -133
- package/.docs/raw/docs/tools/a2ui.mdx +0 -107
- package/.docs/raw/docs/tools/backend.mdx +0 -147
- package/.docs/raw/docs/tools/defining-tools.mdx +0 -574
- package/.docs/raw/docs/tools/dynamic-tools.mdx +0 -112
- package/.docs/raw/docs/tools/generative-ui-primitive.mdx +0 -180
- package/.docs/raw/docs/tools/generative-ui-slack.mdx +0 -167
- package/.docs/raw/docs/tools/generative-ui-teams.mdx +0 -160
- package/.docs/raw/docs/tools/generative-ui.mdx +0 -322
- package/.docs/raw/docs/tools/index.mdx +0 -72
- package/.docs/raw/docs/tools/interactables.mdx +0 -1084
- package/.docs/raw/docs/tools/mcp-apps.mdx +0 -363
- package/.docs/raw/docs/tools/mcp.mdx +0 -466
- package/.docs/raw/docs/tools/multi-agent.mdx +0 -237
- package/.docs/raw/docs/tools/openui.mdx +0 -175
- package/.docs/raw/docs/tools/tool-ui.mdx +0 -1020
- package/.docs/raw/docs/tools/user-managed-mcp.mdx +0 -428
- package/.docs/raw/docs/ui/assistant-modal.mdx +0 -166
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +0 -89
- package/.docs/raw/docs/ui/attachment.mdx +0 -279
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +0 -247
- package/.docs/raw/docs/ui/context-display.mdx +0 -148
- package/.docs/raw/docs/ui/directive-text.mdx +0 -114
- package/.docs/raw/docs/ui/file.mdx +0 -159
- package/.docs/raw/docs/ui/follow-up-suggestions.mdx +0 -82
- package/.docs/raw/docs/ui/image.mdx +0 -102
- package/.docs/raw/docs/ui/markdown.mdx +0 -103
- package/.docs/raw/docs/ui/mcp-config.mdx +0 -107
- package/.docs/raw/docs/ui/mermaid.mdx +0 -92
- package/.docs/raw/docs/ui/message-timing.mdx +0 -93
- package/.docs/raw/docs/ui/model-selector.mdx +0 -455
- package/.docs/raw/docs/ui/part-grouping.mdx +0 -614
- package/.docs/raw/docs/ui/quote.mdx +0 -211
- package/.docs/raw/docs/ui/reasoning.mdx +0 -214
- package/.docs/raw/docs/ui/scrollbar.mdx +0 -77
- package/.docs/raw/docs/ui/sources.mdx +0 -186
- package/.docs/raw/docs/ui/streamdown.mdx +0 -392
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +0 -205
- package/.docs/raw/docs/ui/thread-list.mdx +0 -411
- package/.docs/raw/docs/ui/thread.mdx +0 -559
- package/.docs/raw/docs/ui/tool-fallback.mdx +0 -141
- package/.docs/raw/docs/ui/tool-group.mdx +0 -240
- package/.docs/raw/docs/ui/voice.mdx +0 -173
- package/.docs/raw/docs/utilities/heat-graph.mdx +0 -237
- package/.docs/raw/docs/utilities/react-o11y.mdx +0 -362
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +0 -212
- package/dist/constants.d.ts +0 -14
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -19
- package/dist/constants.js.map +0 -1
- package/dist/prepare-docs/code-examples.d.ts +0 -5
- package/dist/prepare-docs/code-examples.d.ts.map +0 -1
- package/dist/prepare-docs/code-examples.js +0 -117
- package/dist/prepare-docs/code-examples.js.map +0 -1
- package/dist/prepare-docs/copy-raw.d.ts +0 -5
- package/dist/prepare-docs/copy-raw.d.ts.map +0 -1
- package/dist/prepare-docs/copy-raw.js +0 -49
- package/dist/prepare-docs/copy-raw.js.map +0 -1
- package/dist/prepare-docs/prepare.d.ts +0 -1
- package/dist/prepare-docs/prepare.js +0 -22
- package/dist/prepare-docs/prepare.js.map +0 -1
- package/dist/prompts/xulux-playground.d.ts +0 -12
- package/dist/prompts/xulux-playground.d.ts.map +0 -1
- package/dist/prompts/xulux-playground.js +0 -33
- package/dist/prompts/xulux-playground.js.map +0 -1
- package/dist/tools/docs.d.ts +0 -22
- package/dist/tools/docs.d.ts.map +0 -1
- package/dist/tools/docs.js +0 -177
- package/dist/tools/docs.js.map +0 -1
- package/dist/tools/examples.d.ts +0 -24
- package/dist/tools/examples.d.ts.map +0 -1
- package/dist/tools/examples.js +0 -87
- package/dist/tools/examples.js.map +0 -1
- package/dist/tools/resources.d.ts +0 -6
- package/dist/tools/resources.d.ts.map +0 -1
- package/dist/tools/resources.js +0 -75
- package/dist/tools/resources.js.map +0 -1
- package/dist/tools/search.d.ts +0 -24
- package/dist/tools/search.d.ts.map +0 -1
- package/dist/tools/search.js +0 -39
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/tests/mcp-test-client.d.ts +0 -15
- package/dist/tools/tests/mcp-test-client.d.ts.map +0 -1
- package/dist/tools/tests/mcp-test-client.js +0 -68
- package/dist/tools/tests/mcp-test-client.js.map +0 -1
- package/dist/tools/tests/test-setup.d.ts +0 -7
- package/dist/tools/tests/test-setup.d.ts.map +0 -1
- package/dist/tools/tests/test-setup.js +0 -36
- package/dist/tools/tests/test-setup.js.map +0 -1
- package/dist/tools/xulux-templates.d.ts +0 -58
- package/dist/tools/xulux-templates.d.ts.map +0 -1
- package/dist/tools/xulux-templates.js +0 -84
- package/dist/tools/xulux-templates.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -5
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -18
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -10
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -20
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/mcp-format.d.ts +0 -11
- package/dist/utils/mcp-format.d.ts.map +0 -1
- package/dist/utils/mcp-format.js +0 -14
- package/dist/utils/mcp-format.js.map +0 -1
- package/dist/utils/mdx.d.ts +0 -12
- package/dist/utils/mdx.d.ts.map +0 -1
- package/dist/utils/mdx.js +0 -45
- package/dist/utils/mdx.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -12
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -93
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/search.d.ts +0 -10
- package/dist/utils/search.d.ts.map +0 -1
- package/dist/utils/search.js +0 -97
- package/dist/utils/search.js.map +0 -1
- package/dist/utils/security.d.ts +0 -5
- package/dist/utils/security.d.ts.map +0 -1
- package/dist/utils/security.js +0 -22
- package/dist/utils/security.js.map +0 -1
- package/dist/xulux/catalog-client.d.ts +0 -14
- package/dist/xulux/catalog-client.d.ts.map +0 -1
- package/dist/xulux/catalog-client.js +0 -112
- package/dist/xulux/catalog-client.js.map +0 -1
- package/dist/xulux/fallback-catalog.d.ts +0 -7
- package/dist/xulux/fallback-catalog.d.ts.map +0 -1
- package/dist/xulux/fallback-catalog.js +0 -47
- package/dist/xulux/fallback-catalog.js.map +0 -1
- package/dist/xulux/fetch-sandbox.d.ts +0 -5
- package/dist/xulux/fetch-sandbox.d.ts.map +0 -1
- package/dist/xulux/fetch-sandbox.js +0 -40
- package/dist/xulux/fetch-sandbox.js.map +0 -1
- package/dist/xulux/template-service.d.ts +0 -84
- package/dist/xulux/template-service.d.ts.map +0 -1
- package/dist/xulux/template-service.js +0 -223
- package/dist/xulux/template-service.js.map +0 -1
- package/dist/xulux/types.d.ts +0 -55
- package/dist/xulux/types.d.ts.map +0 -1
- package/dist/xulux/types.js +0 -6
- package/dist/xulux/types.js.map +0 -1
- package/src/constants.ts +0 -24
- package/src/prepare-docs/code-examples.ts +0 -158
- package/src/prepare-docs/copy-raw.ts +0 -50
- package/src/prepare-docs/prepare.ts +0 -24
- package/src/prompts/xulux-playground.ts +0 -36
- package/src/tools/docs.ts +0 -255
- package/src/tools/examples.ts +0 -114
- package/src/tools/resources.ts +0 -111
- package/src/tools/search.ts +0 -46
- package/src/tools/tests/completions.test.ts +0 -60
- package/src/tools/tests/directory-size-cap.test.ts +0 -50
- package/src/tools/tests/docs.test.ts +0 -147
- package/src/tools/tests/examples.test.ts +0 -94
- package/src/tools/tests/integration.test.ts +0 -45
- package/src/tools/tests/json-parsing.test.ts +0 -23
- package/src/tools/tests/listings-cache.test.ts +0 -19
- package/src/tools/tests/mcp-protocol.test.ts +0 -216
- package/src/tools/tests/mcp-test-client.ts +0 -111
- package/src/tools/tests/path-traversal.test.ts +0 -84
- package/src/tools/tests/resources.test.ts +0 -133
- package/src/tools/tests/search.test.ts +0 -37
- package/src/tools/tests/test-setup.ts +0 -50
- package/src/tools/tests/xulux-templates.test.ts +0 -325
- package/src/tools/xulux-templates.ts +0 -141
- package/src/utils/cache.ts +0 -20
- package/src/utils/logger.ts +0 -20
- package/src/utils/mcp-format.ts +0 -14
- package/src/utils/mdx.ts +0 -59
- package/src/utils/paths.ts +0 -139
- package/src/utils/search.ts +0 -131
- package/src/utils/security.ts +0 -52
- package/src/utils/tests/cache.test.ts +0 -51
- package/src/utils/tests/mcp-format.test.ts +0 -22
- package/src/utils/tests/security.test.ts +0 -119
- package/src/xulux/catalog-client.ts +0 -150
- package/src/xulux/fallback-catalog.ts +0 -63
- package/src/xulux/fetch-sandbox.ts +0 -56
- package/src/xulux/template-service.ts +0 -406
- package/src/xulux/types.ts +0 -64
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Agent state
|
|
3
|
-
description: Read and optimistically update graph state with useLangGraphState and useLangGraphSetState in LangGraph.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`useLangGraphState` mirrors the graph's values object that LangGraph streams to the client. It updates live while the agent runs (when the `values` stream mode is enabled). `useLangGraphSetState` lets you apply optimistic local updates that ride the next send.
|
|
7
|
-
|
|
8
|
-
## Enable the `values` stream mode
|
|
9
|
-
|
|
10
|
-
<Callout type="warn">
|
|
11
|
-
The default stream setup does **not** include the `values` stream mode. Without it, `useLangGraphState` never receives live graph state.
|
|
12
|
-
</Callout>
|
|
13
|
-
|
|
14
|
-
When you call `client.runs.stream` yourself, request `values` alongside the modes you already use:
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
client.runs.stream(threadId, assistantId, {
|
|
18
|
-
input,
|
|
19
|
-
streamMode: ["messages", "updates", "custom", "values"],
|
|
20
|
-
});
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
If you use `unstable_createLangGraphStream`, its default stream modes do **not** include `values` either. Pass the option explicitly:
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
const stream = unstable_createLangGraphStream({
|
|
27
|
-
client,
|
|
28
|
-
assistantId: ASSISTANT_ID,
|
|
29
|
-
streamMode: ["messages", "updates", "custom", "values"],
|
|
30
|
-
});
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Basic usage
|
|
34
|
-
|
|
35
|
-
```tsx
|
|
36
|
-
import {
|
|
37
|
-
useLangGraphState,
|
|
38
|
-
useLangGraphSetState,
|
|
39
|
-
} from "@assistant-ui/react-langgraph";
|
|
40
|
-
import { useAuiState } from "@assistant-ui/react";
|
|
41
|
-
|
|
42
|
-
type GraphState = {
|
|
43
|
-
messages: unknown[];
|
|
44
|
-
filters: { region: string; maxResults: number };
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const state = useLangGraphState<GraphState>();
|
|
48
|
-
// state: GraphState | undefined (latest agent state; updates live while the agent runs)
|
|
49
|
-
|
|
50
|
-
const setState = useLangGraphSetState<GraphState>();
|
|
51
|
-
// setState(next | (prev) => next) (optimistic local update; sent with the NEXT run)
|
|
52
|
-
|
|
53
|
-
const isRunning = useAuiState((s) => s.thread.isRunning);
|
|
54
|
-
// isRunning: boolean (whether the thread is currently running)
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
## Example
|
|
58
|
-
|
|
59
|
-
Render graph state beside the chat and stage an optimistic filter update:
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
"use client";
|
|
63
|
-
|
|
64
|
-
import {
|
|
65
|
-
useLangGraphState,
|
|
66
|
-
useLangGraphSetState,
|
|
67
|
-
} from "@assistant-ui/react-langgraph";
|
|
68
|
-
import { useAuiState } from "@assistant-ui/react";
|
|
69
|
-
import { Thread } from "@/components/assistant-ui/thread";
|
|
70
|
-
|
|
71
|
-
type GraphState = {
|
|
72
|
-
filters: { region: string; maxResults: number };
|
|
73
|
-
lastQuery?: string;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export function CatalogAssistant() {
|
|
77
|
-
const state = useLangGraphState<GraphState>();
|
|
78
|
-
const setState = useLangGraphSetState<GraphState>();
|
|
79
|
-
const isRunning = useAuiState((s) => s.thread.isRunning);
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div className="flex h-full">
|
|
83
|
-
<aside className="w-72 border-r p-4">
|
|
84
|
-
<h2>Graph state</h2>
|
|
85
|
-
{state ? (
|
|
86
|
-
<ul>
|
|
87
|
-
<li>Region: {state.filters.region}</li>
|
|
88
|
-
<li>Max results: {state.filters.maxResults}</li>
|
|
89
|
-
{state.lastQuery && <li>Last query: {state.lastQuery}</li>}
|
|
90
|
-
</ul>
|
|
91
|
-
) : (
|
|
92
|
-
<p>No graph state yet. Ensure streamMode includes "values".</p>
|
|
93
|
-
)}
|
|
94
|
-
<button
|
|
95
|
-
type="button"
|
|
96
|
-
disabled={isRunning}
|
|
97
|
-
onClick={() =>
|
|
98
|
-
setState((prev) => ({
|
|
99
|
-
...prev,
|
|
100
|
-
filters: {
|
|
101
|
-
region: "eu",
|
|
102
|
-
maxResults: prev?.filters.maxResults ?? 10,
|
|
103
|
-
},
|
|
104
|
-
}))
|
|
105
|
-
}
|
|
106
|
-
>
|
|
107
|
-
Prefer EU region
|
|
108
|
-
</button>
|
|
109
|
-
{isRunning && <p>Agent is running…</p>}
|
|
110
|
-
</aside>
|
|
111
|
-
<main className="flex-1">
|
|
112
|
-
<Thread />
|
|
113
|
-
</main>
|
|
114
|
-
</div>
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
The panel tracks the latest `values` events from the graph. The button updates the local overlay immediately; that update object is merged into the run `input` on the next send so LangGraph applies it through the graph's state reducers and input schema.
|
|
120
|
-
|
|
121
|
-
## How state is synced
|
|
122
|
-
|
|
123
|
-
LangGraph state is the graph's values object. When `streamMode` includes `"values"`, each `values` event updates the client-side snapshot that `useLangGraphState` exposes.
|
|
124
|
-
|
|
125
|
-
The setter from `useLangGraphSetState` overlays that snapshot locally. On the next send, the runtime merges the update object into the run `input`, so LangGraph reduces it through the graph's state reducers and input schema.
|
|
126
|
-
|
|
127
|
-
If you supply a custom `stream` callback, the staged update is available as `config.state`. Forward it into your run input yourself:
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
const runtime = useLangGraphRuntime({
|
|
131
|
-
stream: async (messages, { initialize, ...config }) => {
|
|
132
|
-
const { externalId } = await initialize();
|
|
133
|
-
if (!externalId) throw new Error("Thread not found");
|
|
134
|
-
|
|
135
|
-
const client = createClient();
|
|
136
|
-
return client.runs.stream(externalId, ASSISTANT_ID, {
|
|
137
|
-
input: {
|
|
138
|
-
...(config.state ?? {}),
|
|
139
|
-
messages,
|
|
140
|
-
},
|
|
141
|
-
streamMode: ["messages", "updates", "custom", "values"],
|
|
142
|
-
});
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
The built-in path that uses the package helpers performs this merge for you. Custom `stream` callbacks must do it explicitly.
|
|
148
|
-
|
|
149
|
-
## Write-back timing
|
|
150
|
-
|
|
151
|
-
`useLangGraphSetState` is optimistic and local first. The value reaches the agent only when the next run starts. It is not a live channel into a run that is already in progress. Stage filters, preferences, or other graph fields that the next turn should apply through reducers; do not expect an in-flight run to observe mid-run setter calls.
|
|
152
|
-
|
|
153
|
-
## Relationship to other state
|
|
154
|
-
|
|
155
|
-
Keep the three state layers distinct:
|
|
156
|
-
|
|
157
|
-
- **Your app state** stays yours (React state, URL, a store). assistant-ui does not own it.
|
|
158
|
-
- **`useAuiState`** reads assistant-ui's client state (messages, composer, thread status).
|
|
159
|
-
- **`useLangGraphState` / `useLangGraphSetState`** mirror state the **agent** (your LangGraph graph) owns, synced over the wire via `values` events.
|
|
160
|
-
|
|
161
|
-
Use `useLangGraphState` and `useLangGraphSetState` for fields that live in the graph state schema. Use `useAuiState` for UI that depends on the chat thread itself. Use your own state for everything else.
|
|
162
|
-
|
|
163
|
-
## Next
|
|
164
|
-
|
|
165
|
-
<Cards>
|
|
166
|
-
<Card
|
|
167
|
-
title="Streaming"
|
|
168
|
-
description="Event handlers, message metadata, generative UI."
|
|
169
|
-
href="/docs/runtimes/langgraph/streaming"
|
|
170
|
-
/>
|
|
171
|
-
<Card
|
|
172
|
-
title="Quickstart"
|
|
173
|
-
description="From-template and manual setup paths."
|
|
174
|
-
href="/docs/runtimes/langgraph/quickstart"
|
|
175
|
-
/>
|
|
176
|
-
<Card
|
|
177
|
-
title="Generative UI"
|
|
178
|
-
description="Structured UI components emitted by your graph."
|
|
179
|
-
href="/docs/runtimes/langgraph/generative-ui"
|
|
180
|
-
/>
|
|
181
|
-
</Cards>
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: LangGraph Generative UI
|
|
3
|
-
description: Render structured UI components emitted by LangGraph alongside assistant messages.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
LangGraph's [Generative UI](https://docs.langchain.com/langsmith/generative-ui-react) lets your graph emit structured UI components alongside assistant messages via `push_ui_message` (Python) or `typedUi().push()` (TypeScript). The assistant-ui adapter translates these into [`DataMessagePart`s](/docs/tools/tool-ui) on the associated assistant message, which you render with the existing `makeAssistantDataUI` API.
|
|
7
|
-
|
|
8
|
-
## Enable the `custom` stream mode
|
|
9
|
-
|
|
10
|
-
UI messages are emitted through LangGraph's `custom` stream channel. Make sure your `sendMessage` helper includes `"custom"` in `streamMode`:
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
streamMode: ["messages", "updates", "custom"];
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
If your graph accumulates UI messages in state under the `ui` key (the default for `typedUi`), `"values"` also works; the adapter reads both paths.
|
|
17
|
-
|
|
18
|
-
## Custom state key
|
|
19
|
-
|
|
20
|
-
If your graph uses a non-default `stateKey` with `typedUi(config, { stateKey: "my_ui" })` on the server, pass the matching `uiStateKey` option to `useLangGraphRuntime`:
|
|
21
|
-
|
|
22
|
-
```ts
|
|
23
|
-
const runtime = useLangGraphRuntime({
|
|
24
|
-
stream: async function* (messages, { initialize }) {
|
|
25
|
-
/* ... */
|
|
26
|
-
},
|
|
27
|
-
uiStateKey: "my_ui",
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This only affects the `values` stream path; the `custom` channel carries each UI event individually and does not rely on the state key.
|
|
32
|
-
|
|
33
|
-
## Emit a UI message from your graph
|
|
34
|
-
|
|
35
|
-
<Tabs items={["Python", "TypeScript"]}>
|
|
36
|
-
<Tab value="Python">
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
from langgraph.graph.ui import push_ui_message
|
|
40
|
-
from langchain_core.messages import AIMessage
|
|
41
|
-
|
|
42
|
-
async def chart_node(state, config):
|
|
43
|
-
message = AIMessage(id="msg-1", content="Here's your chart.")
|
|
44
|
-
push_ui_message(
|
|
45
|
-
"chart",
|
|
46
|
-
{"series": [1, 2, 3], "title": "Sales"},
|
|
47
|
-
message=message, # Links the UI to this AI message
|
|
48
|
-
)
|
|
49
|
-
return {"messages": [message]}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
</Tab>
|
|
53
|
-
<Tab value="TypeScript">
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
import { typedUi } from "@langchain/langgraph-sdk/react-ui/server";
|
|
57
|
-
import type { ComponentRegistry } from "./components";
|
|
58
|
-
|
|
59
|
-
export async function chartNode(state, config) {
|
|
60
|
-
const ui = typedUi<ComponentRegistry>(config);
|
|
61
|
-
const message = { id: "msg-1", type: "ai", content: "Here's your chart." };
|
|
62
|
-
ui.push(
|
|
63
|
-
{ name: "chart", props: { series: [1, 2, 3], title: "Sales" } },
|
|
64
|
-
{ message },
|
|
65
|
-
);
|
|
66
|
-
return { messages: [message] };
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
</Tab>
|
|
71
|
-
</Tabs>
|
|
72
|
-
|
|
73
|
-
Passing `message` (Python) or `{ message }` (TypeScript) is what links the UI component to a specific assistant message. The adapter reads `metadata.message_id` to attach the generated `DataMessagePart` to the correct message in the thread.
|
|
74
|
-
|
|
75
|
-
## Register a renderer on the client
|
|
76
|
-
|
|
77
|
-
<PlatformTabs>
|
|
78
|
-
<Tab value="React">
|
|
79
|
-
|
|
80
|
-
```tsx title="@/components/ChartUI.tsx"
|
|
81
|
-
import { makeAssistantDataUI } from "@assistant-ui/react";
|
|
82
|
-
|
|
83
|
-
type ChartProps = {
|
|
84
|
-
series: number[];
|
|
85
|
-
title: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const ChartUI = makeAssistantDataUI<ChartProps>({
|
|
89
|
-
name: "chart",
|
|
90
|
-
render: ({ data }) => (
|
|
91
|
-
<div>
|
|
92
|
-
<h3>{data.title}</h3>
|
|
93
|
-
<Chart series={data.series} />
|
|
94
|
-
</div>
|
|
95
|
-
),
|
|
96
|
-
});
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
</Tab>
|
|
100
|
-
<Tab value="React Native">
|
|
101
|
-
|
|
102
|
-
```tsx title="components/ChartUI.tsx"
|
|
103
|
-
import { makeAssistantDataUI } from "@assistant-ui/react-native";
|
|
104
|
-
import { Text, View } from "react-native";
|
|
105
|
-
|
|
106
|
-
type ChartProps = {
|
|
107
|
-
series: number[];
|
|
108
|
-
title: string;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const ChartUI = makeAssistantDataUI<ChartProps>({
|
|
112
|
-
name: "chart",
|
|
113
|
-
render: ({ data }) => (
|
|
114
|
-
<View>
|
|
115
|
-
<Text>{data.title}</Text>
|
|
116
|
-
<Chart series={data.series} />
|
|
117
|
-
</View>
|
|
118
|
-
),
|
|
119
|
-
});
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
</Tab>
|
|
123
|
-
<Tab value="React Ink">
|
|
124
|
-
|
|
125
|
-
```tsx title="components/chart-ui.tsx"
|
|
126
|
-
import { makeAssistantDataUI } from "@assistant-ui/react-ink";
|
|
127
|
-
import { Box, Text } from "ink";
|
|
128
|
-
|
|
129
|
-
type ChartProps = {
|
|
130
|
-
series: number[];
|
|
131
|
-
title: string;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export const ChartUI = makeAssistantDataUI<ChartProps>({
|
|
135
|
-
name: "chart",
|
|
136
|
-
render: ({ data }) => (
|
|
137
|
-
<Box flexDirection="column">
|
|
138
|
-
<Text bold>{data.title}</Text>
|
|
139
|
-
<Chart series={data.series} />
|
|
140
|
-
</Box>
|
|
141
|
-
),
|
|
142
|
-
});
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
</Tab>
|
|
146
|
-
</PlatformTabs>
|
|
147
|
-
|
|
148
|
-
Mount the component once somewhere inside the `AssistantRuntimeProvider` tree. It renders nothing itself; it only registers the renderer:
|
|
149
|
-
|
|
150
|
-
<PlatformTabs>
|
|
151
|
-
<Tab value="React">
|
|
152
|
-
|
|
153
|
-
```tsx title="@/components/MyAssistant.tsx"
|
|
154
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
155
|
-
<ChartUI />
|
|
156
|
-
<Thread />
|
|
157
|
-
</AssistantRuntimeProvider>
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
</Tab>
|
|
161
|
-
<Tab value="React Native">
|
|
162
|
-
|
|
163
|
-
```tsx title="components/MyAssistant.tsx"
|
|
164
|
-
import { View } from "react-native";
|
|
165
|
-
import { Thread } from "@/components/assistant-ui/thread";
|
|
166
|
-
|
|
167
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
168
|
-
<ChartUI />
|
|
169
|
-
<View style={{ flex: 1 }}>
|
|
170
|
-
<Thread />
|
|
171
|
-
</View>
|
|
172
|
-
</AssistantRuntimeProvider>;
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
</Tab>
|
|
176
|
-
<Tab value="React Ink">
|
|
177
|
-
|
|
178
|
-
```tsx title="components/my-assistant.tsx"
|
|
179
|
-
import { Box } from "ink";
|
|
180
|
-
import { Thread } from "./thread.js";
|
|
181
|
-
|
|
182
|
-
<AssistantRuntimeProvider runtime={runtime}>
|
|
183
|
-
<ChartUI />
|
|
184
|
-
<Box flexDirection="column">
|
|
185
|
-
<Thread />
|
|
186
|
-
</Box>
|
|
187
|
-
</AssistantRuntimeProvider>;
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
</Tab>
|
|
191
|
-
</PlatformTabs>
|
|
192
|
-
|
|
193
|
-
When a matching UI message arrives, the adapter appends a `{ type: "data", name: "chart", data: { series, title } }` part to the parent assistant message and the registered component renders inline.
|
|
194
|
-
|
|
195
|
-
## Register renderers via `uiComponents`
|
|
196
|
-
|
|
197
|
-
Instead of mounting separate `makeAssistantDataUI` components, register renderers directly on the runtime hook:
|
|
198
|
-
|
|
199
|
-
```tsx
|
|
200
|
-
const runtime = useLangGraphRuntime({
|
|
201
|
-
stream: async function* (messages, { initialize }) {
|
|
202
|
-
/* ... */
|
|
203
|
-
},
|
|
204
|
-
uiComponents: {
|
|
205
|
-
renderers: {
|
|
206
|
-
chart: ({ data }) => <Chart series={data.series} title={data.title} />,
|
|
207
|
-
table: ({ data }) => <DataTable rows={data.rows} />,
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
});
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Static `renderers` are matched by `ui_message` name. If no match is found, the part renders nothing unless a `fallback` is provided.
|
|
214
|
-
|
|
215
|
-
## Dynamic loading with `fallback`
|
|
216
|
-
|
|
217
|
-
LangSmith's [Generative UI](https://docs.langchain.com/langsmith/generative-ui-react) supports colocating UI code with your graph and loading it at runtime via `LoadExternalComponent`. The `fallback` option handles any `ui_message` name that has no static renderer:
|
|
218
|
-
|
|
219
|
-
```tsx
|
|
220
|
-
import { LoadExternalComponent } from "@langchain/langgraph-sdk/react-ui";
|
|
221
|
-
|
|
222
|
-
const runtime = useLangGraphRuntime({
|
|
223
|
-
stream: async function* (messages, { initialize }) {
|
|
224
|
-
/* ... */
|
|
225
|
-
},
|
|
226
|
-
uiComponents: {
|
|
227
|
-
fallback: ({ name, data }) => (
|
|
228
|
-
<LoadExternalComponent name={name} props={data} />
|
|
229
|
-
),
|
|
230
|
-
renderers: {
|
|
231
|
-
chart: ({ data }) => <Chart {...data} />,
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
});
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
With this setup:
|
|
238
|
-
|
|
239
|
-
- A `ui_message` with `name: "chart"` renders the static `Chart` component.
|
|
240
|
-
- Any other name (e.g. `"dashboard"`, `"form"`) is handled by `fallback`, which fetches the component from LangSmith at runtime.
|
|
241
|
-
|
|
242
|
-
`fallback` receives the same props as any data renderer: `name`, `data`, and part state metadata.
|
|
243
|
-
|
|
244
|
-
## Semantics
|
|
245
|
-
|
|
246
|
-
The adapter mirrors the reducer in `@langchain/langgraph-sdk/react-ui` exactly:
|
|
247
|
-
|
|
248
|
-
- UI messages are keyed by their own `id`. Pushing the same id again **replaces** the existing entry.
|
|
249
|
-
- Passing `metadata: { merge: true }` shallow-merges `props` onto the previous entry.
|
|
250
|
-
- Emitting `{ type: "remove-ui", id }` (via `delete_ui_message` or `ui.delete(id)`) removes the entry.
|
|
251
|
-
- UI messages without `metadata.message_id` are held in the runtime but not injected into any message; use `useLangGraphUIMessages()` to access the raw list if needed.
|
|
252
|
-
|
|
253
|
-
## Restore persisted UI messages on thread switch
|
|
254
|
-
|
|
255
|
-
If your graph persists UI messages in state via `typedUi`, return them from the `load` callback so they are restored when the user switches threads or refreshes the page:
|
|
256
|
-
|
|
257
|
-
```tsx
|
|
258
|
-
const runtime = useLangGraphRuntime({
|
|
259
|
-
stream: async function* (messages, { initialize }) {
|
|
260
|
-
/* ... */
|
|
261
|
-
},
|
|
262
|
-
load: async (externalId) => {
|
|
263
|
-
const state = await getThreadState(externalId);
|
|
264
|
-
return {
|
|
265
|
-
messages: state.values.messages,
|
|
266
|
-
uiMessages: state.values.ui,
|
|
267
|
-
interrupts: state.tasks[0]?.interrupts,
|
|
268
|
-
};
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
Without this, each reload starts with an empty UI list even though the messages themselves are loaded.
|
|
274
|
-
|
|
275
|
-
## Escape hatch: `useLangGraphUIMessages`
|
|
276
|
-
|
|
277
|
-
```tsx
|
|
278
|
-
import { useLangGraphUIMessages } from "@assistant-ui/react-langgraph";
|
|
279
|
-
|
|
280
|
-
function Sidebar() {
|
|
281
|
-
const uiMessages = useLangGraphUIMessages();
|
|
282
|
-
// Filter, group, or render UI messages outside the thread
|
|
283
|
-
return <>{uiMessages.map(/* ... */)}</>;
|
|
284
|
-
}
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
## Related
|
|
288
|
-
|
|
289
|
-
<Cards>
|
|
290
|
-
<Card
|
|
291
|
-
title="Streaming"
|
|
292
|
-
description="Event handlers, message accumulator, conversion, metadata."
|
|
293
|
-
href="/docs/runtimes/langgraph/streaming"
|
|
294
|
-
/>
|
|
295
|
-
<Card
|
|
296
|
-
title="Interrupts"
|
|
297
|
-
description="Interrupt persistence and checkpoint-based message editing."
|
|
298
|
-
href="/docs/runtimes/langgraph/interrupts"
|
|
299
|
-
/>
|
|
300
|
-
<Card
|
|
301
|
-
title="Threads"
|
|
302
|
-
description="Basic thread support, AssistantCloud, custom thread list adapter."
|
|
303
|
-
href="/docs/runtimes/langgraph/threads"
|
|
304
|
-
/>
|
|
305
|
-
</Cards>
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Interrupts and message editing
|
|
3
|
-
description: Interrupt persistence and checkpoint-based message editing.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Both interrupt persistence and message editing rely on LangGraph's server-side checkpoints. Once you have one wired up, the other is mostly free.
|
|
7
|
-
|
|
8
|
-
## Interrupt persistence
|
|
9
|
-
|
|
10
|
-
LangGraph supports interrupting the execution flow to request user input or handle specific interactions. These interrupts can be persisted and restored when switching between threads:
|
|
11
|
-
|
|
12
|
-
1. Make sure your thread state type includes the `interrupts` field.
|
|
13
|
-
2. Return the interrupts from the `load` function along with the messages.
|
|
14
|
-
3. The runtime automatically restores the interrupt state when switching threads.
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
const runtime = useLangGraphRuntime({
|
|
18
|
-
stream: async (messages, { initialize, ...config }) => {
|
|
19
|
-
/* ... */
|
|
20
|
-
},
|
|
21
|
-
load: async (externalId) => {
|
|
22
|
-
const state = await getThreadState(externalId);
|
|
23
|
-
return {
|
|
24
|
-
messages: state.values.messages,
|
|
25
|
-
interrupts: state.tasks[0]?.interrupts,
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
This is particularly useful for applications that require user approval flows, multi-step forms, or other interactive elements that span multiple thread switches.
|
|
32
|
-
|
|
33
|
-
## Message editing and regeneration
|
|
34
|
-
|
|
35
|
-
LangGraph uses server-side checkpoints for state management. To support message editing (branching) and regeneration, provide a `getCheckpointId` callback that resolves the appropriate checkpoint for server-side forking.
|
|
36
|
-
|
|
37
|
-
```ts
|
|
38
|
-
const runtime = useLangGraphRuntime({
|
|
39
|
-
stream: async (messages, { initialize, ...config }) => {
|
|
40
|
-
const { externalId } = await initialize();
|
|
41
|
-
if (!externalId) throw new Error("Thread not found");
|
|
42
|
-
return sendMessage({ threadId: externalId, messages, config });
|
|
43
|
-
},
|
|
44
|
-
create: async () => {
|
|
45
|
-
const { thread_id } = await createThread();
|
|
46
|
-
return { externalId: thread_id };
|
|
47
|
-
},
|
|
48
|
-
load: async (externalId) => {
|
|
49
|
-
const state = await getThreadState(externalId);
|
|
50
|
-
return {
|
|
51
|
-
messages: state.values.messages,
|
|
52
|
-
interrupts: state.tasks[0]?.interrupts,
|
|
53
|
-
};
|
|
54
|
-
},
|
|
55
|
-
getCheckpointId: async (threadId, parentMessages) => {
|
|
56
|
-
const client = createClient();
|
|
57
|
-
const history = await client.threads.getHistory(threadId);
|
|
58
|
-
for (const state of history) {
|
|
59
|
-
const stateMessages = state.values.messages;
|
|
60
|
-
if (!stateMessages || stateMessages.length !== parentMessages.length) {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
const hasStableIds =
|
|
64
|
-
parentMessages.every((m) => typeof m.id === "string") &&
|
|
65
|
-
stateMessages.every((m) => typeof m.id === "string");
|
|
66
|
-
if (!hasStableIds) continue;
|
|
67
|
-
|
|
68
|
-
const isMatch = parentMessages.every(
|
|
69
|
-
(m, i) => m.id === stateMessages[i]?.id,
|
|
70
|
-
);
|
|
71
|
-
if (isMatch) {
|
|
72
|
-
return state.checkpoint.checkpoint_id ?? null;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return null;
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
When `getCheckpointId` is provided:
|
|
81
|
-
|
|
82
|
-
- **Edit buttons** appear on user messages, allowing users to edit and resend from that point.
|
|
83
|
-
- **Regenerate buttons** appear on assistant messages, allowing users to regenerate the response.
|
|
84
|
-
|
|
85
|
-
The resolved `checkpointId` is passed to your `stream` callback via `config.checkpointId`. Your `sendMessage` helper should map it to the LangGraph SDK's `checkpoint_id` parameter (see [quickstart](/docs/runtimes/langgraph/quickstart) for the helper).
|
|
86
|
-
|
|
87
|
-
<Callout type="info">
|
|
88
|
-
Without `getCheckpointId`, edit and regenerate buttons will not appear. This is intentional; truncating client-side messages without forking from the correct server-side checkpoint would produce incorrect state.
|
|
89
|
-
</Callout>
|
|
90
|
-
|
|
91
|
-
## Next
|
|
92
|
-
|
|
93
|
-
<Cards>
|
|
94
|
-
<Card
|
|
95
|
-
title="Threads"
|
|
96
|
-
description="Basic thread support, AssistantCloud, custom thread list adapter."
|
|
97
|
-
href="/docs/runtimes/langgraph/threads"
|
|
98
|
-
/>
|
|
99
|
-
<Card
|
|
100
|
-
title="Streaming"
|
|
101
|
-
description="Event handlers, message metadata, generative UI."
|
|
102
|
-
href="/docs/runtimes/langgraph/streaming"
|
|
103
|
-
/>
|
|
104
|
-
</Cards>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: LangGraph UI Runtime
|
|
3
|
-
description: Build a chat UI for LangGraph agents in React with assistant-ui — streaming, subgraph events, UI messages, interrupts, and end-to-end cancellation supported.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`@assistant-ui/react-langgraph` integrates with [`@langchain/langgraph-sdk`](https://docs.langchain.com/oss/javascript/langgraph-sdk) directly, exposing the full LangGraph Cloud feature set in assistant-ui: streaming, subgraph events, UI messages, message metadata, interrupts, and end-to-end cancellation.
|
|
7
|
-
|
|
8
|
-
<Callout type="info">
|
|
9
|
-
**Migrating from LangServe?** LangChain has deprecated `RemoteRunnable` upstream and consolidated the chain and agent execution stories under LangGraph. Rebuild your chain as a LangGraph graph (LangChain's [LangServe → LangGraph migration guide](https://github.com/langchain-ai/langserve/blob/main/MIGRATION.md) covers the shape change), deploy via LangGraph Cloud or self-host LangGraph Studio, and use this runtime on the frontend. The runtime ships streaming, interrupts, generative UI, message metadata, and end-to-end cancellation out of the box.
|
|
10
|
-
</Callout>
|
|
11
|
-
|
|
12
|
-
## When to use it
|
|
13
|
-
|
|
14
|
-
Pick the LangGraph runtime when:
|
|
15
|
-
|
|
16
|
-
- You have (or want) a LangGraph Cloud server, locally via [LangGraph Studio](https://docs.langchain.com/langsmith/quick-start-studio) or hosted via [LangSmith](https://www.langchain.com/langsmith).
|
|
17
|
-
- Your graph state has a `messages` key with LangChain-alike messages.
|
|
18
|
-
- You want generative UI (`ui_message`), per-message metadata, subgraph events, or checkpoint-based message editing.
|
|
19
|
-
|
|
20
|
-
<Callout type="info">
|
|
21
|
-
If you are already using `@langchain/react`'s `useStream` hook, the alternative [`@assistant-ui/react-langchain`](/docs/runtimes/langchain) adapter may fit better. It delegates the stream plumbing to the upstream hook; the feature surface differs, see [LangChain useStream](/docs/runtimes/langchain) for the comparison table.
|
|
22
|
-
</Callout>
|
|
23
|
-
|
|
24
|
-
## Architecture
|
|
25
|
-
|
|
26
|
-
`@assistant-ui/react-langgraph` is layered on `ExternalStoreRuntime` (see [architecture](/docs/runtimes/concepts/architecture)). Graph state is the source of truth; the runtime renders messages from `state.values.messages` and submits user input back to the graph.
|
|
27
|
-
|
|
28
|
-
Shared adapters (attachments, speech, feedback, history) work the same way described in [adapters](/docs/runtimes/concepts/adapters).
|
|
29
|
-
|
|
30
|
-
## Requirements
|
|
31
|
-
|
|
32
|
-
- A LangGraph Cloud API server.
|
|
33
|
-
- React 18 or 19.
|
|
34
|
-
- The graph state must include a `messages` key with LangChain-alike messages.
|
|
35
|
-
|
|
36
|
-
## Install
|
|
37
|
-
|
|
38
|
-
<PlatformTabs>
|
|
39
|
-
<Tab value="React">
|
|
40
|
-
|
|
41
|
-
<InstallCommand npm={["@assistant-ui/react", "@assistant-ui/react-langgraph", "@langchain/langgraph-sdk"]} />
|
|
42
|
-
|
|
43
|
-
</Tab>
|
|
44
|
-
<Tab value="React Native">
|
|
45
|
-
|
|
46
|
-
<InstallCommand expo={["@assistant-ui/react-native", "@assistant-ui/react-langgraph", "@langchain/langgraph-sdk"]} />
|
|
47
|
-
|
|
48
|
-
</Tab>
|
|
49
|
-
<Tab value="React Ink">
|
|
50
|
-
|
|
51
|
-
<InstallCommand npm={["@assistant-ui/react-ink", "@assistant-ui/react-langgraph", "@langchain/langgraph-sdk", "ink", "react"]} />
|
|
52
|
-
|
|
53
|
-
</Tab>
|
|
54
|
-
</PlatformTabs>
|
|
55
|
-
|
|
56
|
-
## Next
|
|
57
|
-
|
|
58
|
-
<Cards>
|
|
59
|
-
<Card
|
|
60
|
-
title="Quickstart"
|
|
61
|
-
description="From-template and manual setup paths to a working LangGraph chat."
|
|
62
|
-
href="/docs/runtimes/langgraph/quickstart"
|
|
63
|
-
/>
|
|
64
|
-
<Card
|
|
65
|
-
title="Streaming"
|
|
66
|
-
description="Event handlers, message metadata, generative UI."
|
|
67
|
-
href="/docs/runtimes/langgraph/streaming"
|
|
68
|
-
/>
|
|
69
|
-
<Card
|
|
70
|
-
title="Interrupts"
|
|
71
|
-
description="Interrupt persistence and checkpoint-based message editing."
|
|
72
|
-
href="/docs/runtimes/langgraph/interrupts"
|
|
73
|
-
/>
|
|
74
|
-
<Card
|
|
75
|
-
title="Threads"
|
|
76
|
-
description="Basic thread support, AssistantCloud, custom thread list adapter."
|
|
77
|
-
href="/docs/runtimes/langgraph/threads"
|
|
78
|
-
/>
|
|
79
|
-
<Card
|
|
80
|
-
title="Tutorial: Stockbroker"
|
|
81
|
-
description="End-to-end stockbroker assistant with generative UI and approval flows."
|
|
82
|
-
href="/docs/runtimes/langgraph/tutorial/introduction"
|
|
83
|
-
/>
|
|
84
|
-
</Cards>
|