@assistant-ui/mcp-docs-server 0.1.29 → 0.1.31
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 +15 -7
- package/.docs/organized/code-examples/with-a2a.md +9 -21
- package/.docs/organized/code-examples/with-ag-ui.md +11 -8
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +10 -10
- package/.docs/organized/code-examples/with-artifacts.md +12 -10
- package/.docs/organized/code-examples/with-assistant-transport.md +11 -12
- package/.docs/organized/code-examples/with-chain-of-thought.md +83 -54
- package/.docs/organized/code-examples/with-cloud-standalone.md +14 -11
- package/.docs/organized/code-examples/with-cloud.md +9 -10
- package/.docs/organized/code-examples/with-custom-thread-list.md +61 -16
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +17 -12
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +13 -13
- package/.docs/organized/code-examples/with-expo.md +25 -21
- package/.docs/organized/code-examples/with-external-store.md +8 -8
- package/.docs/organized/code-examples/with-ffmpeg.md +17 -12
- package/.docs/organized/code-examples/with-generative-ui.md +9 -9
- package/.docs/organized/code-examples/with-google-adk.md +8 -8
- package/.docs/organized/code-examples/with-heat-graph.md +5 -5
- package/.docs/organized/code-examples/with-interactables.md +10 -25
- package/.docs/organized/code-examples/with-langchain.md +437 -0
- package/.docs/organized/code-examples/with-langgraph.md +16 -16
- package/.docs/organized/code-examples/with-livekit.md +18 -13
- package/.docs/organized/code-examples/with-opencode.md +105 -62
- package/.docs/organized/code-examples/with-parent-id-grouping.md +10 -10
- package/.docs/organized/code-examples/with-react-hook-form.md +220 -148
- package/.docs/organized/code-examples/with-react-ink.md +2 -2
- package/.docs/organized/code-examples/with-react-router.md +12 -12
- package/.docs/organized/code-examples/with-store.md +8 -5
- package/.docs/organized/code-examples/with-tanstack.md +10 -10
- package/.docs/organized/code-examples/with-tap-runtime.md +10 -6
- package/.docs/raw/docs/(docs)/cli.mdx +2 -1
- package/.docs/raw/docs/(docs)/copilots/assistant-frame.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +10 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-visible.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +1 -0
- package/.docs/raw/docs/(docs)/copilots/use-assistant-instructions.mdx +1 -0
- package/.docs/raw/docs/(docs)/devtools.mdx +1 -0
- package/.docs/raw/docs/(docs)/index.mdx +1 -0
- package/.docs/raw/docs/(docs)/installation.mdx +1 -0
- package/.docs/raw/docs/(docs)/rtl.mdx +80 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/attachments.mdx +34 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/feedback-speech.mdx +41 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/index.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +34 -0
- package/.docs/raw/docs/(reference)/api-reference/adapters/runtime.mdx +31 -0
- package/.docs/raw/docs/(reference)/api-reference/context-providers/index.mdx +20 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/index.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +72 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/runtimes.mdx +41 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/state.mdx +48 -0
- package/.docs/raw/docs/(reference)/api-reference/hooks/utilities.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +23 -0
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +21 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +7 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +149 -40
- package/.docs/raw/docs/(reference)/api-reference/primitives/index.mdx +65 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +2 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +50 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +15 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +36 -1
- package/.docs/raw/docs/(reference)/api-reference/runtimes/index.mdx +38 -0
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +9 -0
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +144 -6
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +231 -3
- package/.docs/raw/docs/cloud/ai-sdk.mdx +221 -3
- package/.docs/raw/docs/cloud/langgraph.mdx +274 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/attachments.mdx +41 -36
- package/.docs/raw/docs/guides/branching.mdx +76 -0
- package/.docs/raw/docs/guides/chain-of-thought.mdx +166 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/context-api.mdx +50 -22
- package/.docs/raw/docs/{(docs)/guides → guides}/dictation.mdx +2 -0
- package/.docs/raw/docs/guides/editing.mdx +102 -0
- package/.docs/raw/docs/guides/index.mdx +103 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/interactables.mdx +49 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/latex.mdx +51 -8
- package/.docs/raw/docs/guides/mentions.mdx +520 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/message-timing.mdx +8 -2
- package/.docs/raw/docs/{(docs)/guides → guides}/multi-agent.mdx +64 -4
- package/.docs/raw/docs/{(docs)/guides → guides}/quoting.mdx +10 -17
- package/.docs/raw/docs/guides/slash-commands.mdx +361 -0
- package/.docs/raw/docs/guides/speech.mdx +156 -0
- package/.docs/raw/docs/{(docs)/guides → guides}/suggestions.mdx +21 -83
- package/.docs/raw/docs/{(docs)/guides → guides}/tool-ui.mdx +108 -36
- package/.docs/raw/docs/{(docs)/guides → guides}/tools.mdx +131 -35
- package/.docs/raw/docs/{(docs)/guides → guides}/voice.mdx +39 -0
- package/.docs/raw/docs/ink/index.mdx +1 -3
- package/.docs/raw/docs/ink/migration.mdx +1 -3
- package/.docs/raw/docs/ink/primitives.mdx +37 -1
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +520 -0
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +191 -0
- package/.docs/raw/docs/integrations/auth/clerk.mdx +172 -0
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +196 -0
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +79 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/full-stack.mdx +188 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/overview.mdx +57 -0
- package/.docs/raw/docs/integrations/frameworks/mastra/separate-server.mdx +201 -0
- package/.docs/raw/docs/integrations/gateways/index.mdx +157 -0
- package/.docs/raw/docs/integrations/index.mdx +173 -0
- package/.docs/raw/docs/integrations/observability/helicone.mdx +130 -0
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +156 -0
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +146 -0
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +712 -0
- package/.docs/raw/docs/integrations/tools/mcp.mdx +267 -0
- package/.docs/raw/docs/primitives/action-bar.mdx +1 -0
- package/.docs/raw/docs/primitives/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/primitives/attachment.mdx +1 -0
- package/.docs/raw/docs/primitives/branch-picker.mdx +1 -0
- package/.docs/raw/docs/primitives/chain-of-thought.mdx +90 -85
- package/.docs/raw/docs/primitives/composer.mdx +96 -63
- package/.docs/raw/docs/primitives/error.mdx +1 -0
- package/.docs/raw/docs/primitives/index.mdx +2 -1
- package/.docs/raw/docs/primitives/message.mdx +68 -5
- package/.docs/raw/docs/primitives/selection-toolbar.mdx +1 -0
- package/.docs/raw/docs/primitives/suggestion.mdx +1 -0
- package/.docs/raw/docs/primitives/thread-list.mdx +39 -0
- package/.docs/raw/docs/primitives/thread.mdx +16 -13
- package/.docs/raw/docs/react-native/index.mdx +1 -3
- package/.docs/raw/docs/react-native/migration.mdx +1 -3
- package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +396 -0
- package/.docs/raw/docs/runtimes/a2a/overview.mdx +60 -0
- package/.docs/raw/docs/runtimes/a2a/quickstart.mdx +216 -0
- package/.docs/raw/docs/runtimes/ag-ui/overview.mdx +70 -0
- package/.docs/raw/docs/runtimes/ag-ui/quickstart.mdx +243 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +123 -0
- package/.docs/raw/docs/runtimes/ai-sdk/overview.mdx +52 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +71 -131
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +69 -63
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +365 -101
- package/.docs/raw/docs/runtimes/concepts/adapters.mdx +265 -0
- package/.docs/raw/docs/runtimes/concepts/architecture.mdx +125 -0
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +67 -0
- package/.docs/raw/docs/runtimes/concepts/threads.mdx +428 -0
- package/.docs/raw/docs/runtimes/custom/assistant-transport.mdx +703 -0
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +323 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +253 -1236
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +746 -0
- package/.docs/raw/docs/runtimes/custom/overview.mdx +71 -0
- package/.docs/raw/docs/runtimes/google-adk/api.mdx +256 -0
- package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +717 -0
- package/.docs/raw/docs/runtimes/google-adk/overview.mdx +69 -0
- package/.docs/raw/docs/runtimes/google-adk/quickstart.mdx +229 -0
- package/.docs/raw/docs/runtimes/langchain.mdx +533 -0
- package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +305 -0
- package/.docs/raw/docs/runtimes/langgraph/interrupts.mdx +104 -0
- package/.docs/raw/docs/runtimes/langgraph/overview.mdx +84 -0
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +496 -0
- package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +127 -0
- package/.docs/raw/docs/runtimes/langgraph/threads.mdx +113 -0
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +0 -23
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
- package/.docs/raw/docs/runtimes/opencode/hooks.mdx +191 -0
- package/.docs/raw/docs/runtimes/opencode/overview.mdx +48 -0
- package/.docs/raw/docs/runtimes/opencode/quickstart.mdx +119 -0
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +74 -198
- package/.docs/raw/docs/ui/accordion.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-modal.mdx +1 -0
- package/.docs/raw/docs/ui/assistant-sidebar.mdx +1 -0
- package/.docs/raw/docs/ui/attachment.mdx +1 -0
- package/.docs/raw/docs/ui/badge.mdx +1 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +200 -0
- package/.docs/raw/docs/ui/context-display.mdx +1 -0
- package/.docs/raw/docs/ui/diff-viewer.mdx +1 -0
- package/.docs/raw/docs/ui/directive-text.mdx +114 -0
- package/.docs/raw/docs/ui/file.mdx +1 -0
- package/.docs/raw/docs/ui/image.mdx +1 -0
- package/.docs/raw/docs/ui/markdown.mdx +2 -14
- package/.docs/raw/docs/ui/mermaid.mdx +1 -0
- package/.docs/raw/docs/ui/message-timing.mdx +3 -2
- package/.docs/raw/docs/ui/model-selector.mdx +1 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +325 -313
- package/.docs/raw/docs/ui/quote.mdx +1 -0
- package/.docs/raw/docs/ui/reasoning.mdx +69 -32
- package/.docs/raw/docs/ui/scrollbar.mdx +1 -0
- package/.docs/raw/docs/ui/select.mdx +1 -0
- package/.docs/raw/docs/ui/sources.mdx +1 -0
- package/.docs/raw/docs/ui/streamdown.mdx +1 -0
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -0
- package/.docs/raw/docs/ui/tabs.mdx +1 -0
- package/.docs/raw/docs/ui/thread-list.mdx +17 -0
- package/.docs/raw/docs/ui/thread.mdx +56 -1
- package/.docs/raw/docs/ui/tool-fallback.mdx +1 -0
- package/.docs/raw/docs/ui/tool-group.mdx +39 -11
- package/.docs/raw/docs/ui/voice.mdx +1 -0
- package/.docs/raw/docs/utilities/heat-graph.mdx +1 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +278 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +1 -0
- package/dist/utils/logger.js +1 -1
- package/dist/utils/logger.js.map +1 -1
- package/package.json +4 -4
- package/src/tools/tests/path-traversal.test.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/.docs/raw/docs/(docs)/guides/branching.mdx +0 -65
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +0 -164
- package/.docs/raw/docs/(docs)/guides/editing.mdx +0 -66
- package/.docs/raw/docs/(docs)/guides/mentions.mdx +0 -406
- package/.docs/raw/docs/(docs)/guides/slash-commands.mdx +0 -275
- package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -38
- package/.docs/raw/docs/runtimes/a2a/index.mdx +0 -298
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +0 -1033
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +0 -268
- package/.docs/raw/docs/runtimes/custom/local.mdx +0 -1464
- package/.docs/raw/docs/runtimes/data-stream.mdx +0 -422
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +0 -686
- package/.docs/raw/docs/runtimes/helicone.mdx +0 -61
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +0 -607
- package/.docs/raw/docs/runtimes/langgraph/tutorial/index.mdx +0 -12
- package/.docs/raw/docs/runtimes/langserve.mdx +0 -116
- package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +0 -218
- package/.docs/raw/docs/runtimes/mastra/overview.mdx +0 -18
- package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +0 -217
- package/.docs/raw/docs/ui/mention.mdx +0 -168
|
@@ -304,26 +304,26 @@ export default nextConfig;
|
|
|
304
304
|
"@assistant-ui/react-google-adk": "workspace:*",
|
|
305
305
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
306
306
|
"@assistant-ui/ui": "workspace:*",
|
|
307
|
-
"@google/adk": "^
|
|
307
|
+
"@google/adk": "^1.1.0",
|
|
308
308
|
"class-variance-authority": "^0.7.1",
|
|
309
309
|
"clsx": "^2.1.1",
|
|
310
|
-
"lucide-react": "^1.
|
|
311
|
-
"next": "^16.2.
|
|
310
|
+
"lucide-react": "^1.14.0",
|
|
311
|
+
"next": "^16.2.4",
|
|
312
312
|
"react": "^19.2.5",
|
|
313
313
|
"react-dom": "^19.2.5",
|
|
314
314
|
"tailwind-merge": "^3.5.0",
|
|
315
|
-
"zod": "^4.3
|
|
315
|
+
"zod": "^4.4.3"
|
|
316
316
|
},
|
|
317
317
|
"devDependencies": {
|
|
318
318
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
319
|
-
"@tailwindcss/postcss": "^4.2.
|
|
319
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
320
320
|
"@types/node": "^25.6.0",
|
|
321
321
|
"@types/react": "^19.2.14",
|
|
322
322
|
"@types/react-dom": "^19.2.3",
|
|
323
|
-
"postcss": "^8.5.
|
|
324
|
-
"tailwindcss": "^4.2.
|
|
323
|
+
"postcss": "^8.5.14",
|
|
324
|
+
"tailwindcss": "^4.2.4",
|
|
325
325
|
"tw-animate-css": "^1.4.0",
|
|
326
|
-
"typescript": "^6.0.
|
|
326
|
+
"typescript": "^6.0.3"
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
|
|
@@ -270,19 +270,19 @@ export default nextConfig;
|
|
|
270
270
|
},
|
|
271
271
|
"dependencies": {
|
|
272
272
|
"heat-graph": "workspace:*",
|
|
273
|
-
"next": "^16.2.
|
|
273
|
+
"next": "^16.2.4",
|
|
274
274
|
"react": "^19.2.5",
|
|
275
275
|
"react-dom": "^19.2.5"
|
|
276
276
|
},
|
|
277
277
|
"devDependencies": {
|
|
278
278
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
279
|
-
"@tailwindcss/postcss": "^4.2.
|
|
279
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
280
280
|
"@types/node": "^25.6.0",
|
|
281
281
|
"@types/react": "^19.2.14",
|
|
282
282
|
"@types/react-dom": "^19.2.3",
|
|
283
|
-
"postcss": "^8.5.
|
|
284
|
-
"tailwindcss": "^4.2.
|
|
285
|
-
"typescript": "^6.0.
|
|
283
|
+
"postcss": "^8.5.14",
|
|
284
|
+
"tailwindcss": "^4.2.4",
|
|
285
|
+
"typescript": "^6.0.3"
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
@@ -238,10 +238,6 @@ import {
|
|
|
238
238
|
PlusIcon,
|
|
239
239
|
} from "lucide-react";
|
|
240
240
|
|
|
241
|
-
// ===========================================================================
|
|
242
|
-
// 1. Task Board — single-instance interactable + custom tool
|
|
243
|
-
// ===========================================================================
|
|
244
|
-
|
|
245
241
|
type Task = { id: string; title: string; done: boolean };
|
|
246
242
|
type TaskBoardState = { tasks: Task[] };
|
|
247
243
|
|
|
@@ -392,10 +388,6 @@ function TaskBoard() {
|
|
|
392
388
|
);
|
|
393
389
|
}
|
|
394
390
|
|
|
395
|
-
// ===========================================================================
|
|
396
|
-
// 2. Sticky Notes — multi-instance interactable + selection + partial updates
|
|
397
|
-
// ===========================================================================
|
|
398
|
-
|
|
399
391
|
type NoteState = { title: string; content: string; color: string };
|
|
400
392
|
|
|
401
393
|
const noteSchema = z.object({
|
|
@@ -428,9 +420,6 @@ function NoteCard({
|
|
|
428
420
|
onSelect: (id: string) => void;
|
|
429
421
|
onRemove: (id: string) => void;
|
|
430
422
|
}) {
|
|
431
|
-
// Multi-instance: each NoteCard has a unique `id`, all share name "note"
|
|
432
|
-
// Partial updates: AI can send { color: "blue" } without resending title/content
|
|
433
|
-
// Selection: clicking a note calls setSelected(true)
|
|
434
423
|
useAssistantInteractable("note", {
|
|
435
424
|
id: noteId,
|
|
436
425
|
description:
|
|
@@ -452,6 +441,7 @@ function NoteCard({
|
|
|
452
441
|
};
|
|
453
442
|
|
|
454
443
|
return (
|
|
444
|
+
// biome-ignore lint/a11y/useSemanticElements: styled interactive card
|
|
455
445
|
<div
|
|
456
446
|
role="button"
|
|
457
447
|
tabIndex={0}
|
|
@@ -517,7 +507,6 @@ function NotesPanel() {
|
|
|
517
507
|
const setSelectedIdRef = useRef(setSelectedId);
|
|
518
508
|
setSelectedIdRef.current = setSelectedId;
|
|
519
509
|
|
|
520
|
-
// Tool to add/remove notes (manages the list, not the note content)
|
|
521
510
|
useAssistantTool({
|
|
522
511
|
toolName: "manage_notes",
|
|
523
512
|
description:
|
|
@@ -603,10 +592,6 @@ function NotesPanel() {
|
|
|
603
592
|
);
|
|
604
593
|
}
|
|
605
594
|
|
|
606
|
-
// ===========================================================================
|
|
607
|
-
// App
|
|
608
|
-
// ===========================================================================
|
|
609
|
-
|
|
610
595
|
const STORAGE_KEY = "interactables-example";
|
|
611
596
|
|
|
612
597
|
function useInteractablePersistence(aui: ReturnType<typeof useAui>) {
|
|
@@ -735,30 +720,30 @@ export default nextConfig;
|
|
|
735
720
|
"start": "next start"
|
|
736
721
|
},
|
|
737
722
|
"dependencies": {
|
|
738
|
-
"@ai-sdk/openai": "^3.0.
|
|
723
|
+
"@ai-sdk/openai": "^3.0.61",
|
|
739
724
|
"@assistant-ui/react": "workspace:*",
|
|
740
725
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
741
726
|
"@assistant-ui/ui": "workspace:*",
|
|
742
|
-
"ai": "^6.0.
|
|
727
|
+
"ai": "^6.0.175",
|
|
743
728
|
"class-variance-authority": "^0.7.1",
|
|
744
729
|
"clsx": "^2.1.1",
|
|
745
|
-
"lucide-react": "^1.
|
|
746
|
-
"next": "^16.2.
|
|
730
|
+
"lucide-react": "^1.14.0",
|
|
731
|
+
"next": "^16.2.4",
|
|
747
732
|
"react": "^19.2.5",
|
|
748
733
|
"react-dom": "^19.2.5",
|
|
749
734
|
"tailwind-merge": "^3.5.0",
|
|
750
|
-
"zod": "^4.3
|
|
735
|
+
"zod": "^4.4.3"
|
|
751
736
|
},
|
|
752
737
|
"devDependencies": {
|
|
753
738
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
754
|
-
"@tailwindcss/postcss": "^4.2.
|
|
739
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
755
740
|
"@types/node": "^25.6.0",
|
|
756
741
|
"@types/react": "^19.2.14",
|
|
757
742
|
"@types/react-dom": "^19.2.3",
|
|
758
|
-
"postcss": "^8.5.
|
|
759
|
-
"tailwindcss": "^4.2.
|
|
743
|
+
"postcss": "^8.5.14",
|
|
744
|
+
"tailwindcss": "^4.2.4",
|
|
760
745
|
"tw-animate-css": "^1.4.0",
|
|
761
|
-
"typescript": "^6.0.
|
|
746
|
+
"typescript": "^6.0.3"
|
|
762
747
|
}
|
|
763
748
|
}
|
|
764
749
|
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
# Example: with-langchain
|
|
2
|
+
|
|
3
|
+
## app/globals.css
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import "tailwindcss";
|
|
7
|
+
@import "tw-animate-css";
|
|
8
|
+
|
|
9
|
+
@source "../../../packages/ui/src";
|
|
10
|
+
|
|
11
|
+
@custom-variant dark (&:is(.dark *));
|
|
12
|
+
|
|
13
|
+
@theme inline {
|
|
14
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
15
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
16
|
+
--radius-lg: var(--radius);
|
|
17
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
18
|
+
--color-background: var(--background);
|
|
19
|
+
--color-foreground: var(--foreground);
|
|
20
|
+
--color-card: var(--card);
|
|
21
|
+
--color-card-foreground: var(--card-foreground);
|
|
22
|
+
--color-popover: var(--popover);
|
|
23
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
24
|
+
--color-primary: var(--primary);
|
|
25
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
26
|
+
--color-secondary: var(--secondary);
|
|
27
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
28
|
+
--color-muted: var(--muted);
|
|
29
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
30
|
+
--color-accent: var(--accent);
|
|
31
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
32
|
+
--color-destructive: var(--destructive);
|
|
33
|
+
--color-border: var(--border);
|
|
34
|
+
--color-input: var(--input);
|
|
35
|
+
--color-ring: var(--ring);
|
|
36
|
+
--color-chart-1: var(--chart-1);
|
|
37
|
+
--color-chart-2: var(--chart-2);
|
|
38
|
+
--color-chart-3: var(--chart-3);
|
|
39
|
+
--color-chart-4: var(--chart-4);
|
|
40
|
+
--color-chart-5: var(--chart-5);
|
|
41
|
+
--color-sidebar: var(--sidebar);
|
|
42
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
43
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
44
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
45
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
46
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
47
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
48
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:root {
|
|
52
|
+
--radius: 0.625rem;
|
|
53
|
+
--background: oklch(1 0 0);
|
|
54
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
55
|
+
--card: oklch(1 0 0);
|
|
56
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
57
|
+
--popover: oklch(1 0 0);
|
|
58
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
59
|
+
--primary: oklch(0.21 0.006 285.885);
|
|
60
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
61
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
62
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
63
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
64
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
65
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
66
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
67
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
68
|
+
--border: oklch(0.92 0.004 286.32);
|
|
69
|
+
--input: oklch(0.92 0.004 286.32);
|
|
70
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
71
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
72
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
73
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
74
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
75
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
76
|
+
--sidebar: oklch(0.985 0 0);
|
|
77
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
78
|
+
--sidebar-primary: oklch(0.21 0.006 285.885);
|
|
79
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
80
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
81
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
82
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
83
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.dark {
|
|
87
|
+
--background: oklch(0.141 0.005 285.823);
|
|
88
|
+
--foreground: oklch(0.985 0 0);
|
|
89
|
+
--card: oklch(0.21 0.006 285.885);
|
|
90
|
+
--card-foreground: oklch(0.985 0 0);
|
|
91
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
92
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
93
|
+
--primary: oklch(0.92 0.004 286.32);
|
|
94
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
95
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
96
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
97
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
98
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
99
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
100
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
101
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
102
|
+
--border: oklch(1 0 0 / 10%);
|
|
103
|
+
--input: oklch(1 0 0 / 15%);
|
|
104
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
105
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
106
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
107
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
108
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
109
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
110
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
111
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
112
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
113
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
114
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
115
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
116
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
117
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@layer base {
|
|
121
|
+
* {
|
|
122
|
+
@apply border-border outline-ring/50;
|
|
123
|
+
}
|
|
124
|
+
body {
|
|
125
|
+
@apply bg-background text-foreground;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## app/layout.tsx
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import type { Metadata } from "next";
|
|
135
|
+
import "./globals.css";
|
|
136
|
+
import { MyRuntimeProvider } from "./MyRuntimeProvider";
|
|
137
|
+
|
|
138
|
+
export const metadata: Metadata = {
|
|
139
|
+
title: "LangChain useStream Example",
|
|
140
|
+
description:
|
|
141
|
+
"Example using @assistant-ui/react-langchain with LangChain's useStream hook.",
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default function RootLayout({
|
|
145
|
+
children,
|
|
146
|
+
}: Readonly<{
|
|
147
|
+
children: React.ReactNode;
|
|
148
|
+
}>) {
|
|
149
|
+
return (
|
|
150
|
+
<MyRuntimeProvider>
|
|
151
|
+
<html lang="en">
|
|
152
|
+
<body className="h-dvh">{children}</body>
|
|
153
|
+
</html>
|
|
154
|
+
</MyRuntimeProvider>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## app/MyRuntimeProvider.tsx
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
"use client";
|
|
164
|
+
|
|
165
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
166
|
+
import { useStreamRuntime } from "@assistant-ui/react-langchain";
|
|
167
|
+
|
|
168
|
+
export function MyRuntimeProvider({
|
|
169
|
+
children,
|
|
170
|
+
}: Readonly<{
|
|
171
|
+
children: React.ReactNode;
|
|
172
|
+
}>) {
|
|
173
|
+
const runtime = useStreamRuntime({
|
|
174
|
+
assistantId: process.env.NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID!,
|
|
175
|
+
apiUrl: process.env.NEXT_PUBLIC_LANGGRAPH_API_URL,
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
180
|
+
{children}
|
|
181
|
+
</AssistantRuntimeProvider>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## app/page.tsx
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
"use client";
|
|
191
|
+
|
|
192
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
193
|
+
import { TodosPanel } from "@/components/TodosPanel";
|
|
194
|
+
|
|
195
|
+
export default function Home() {
|
|
196
|
+
return (
|
|
197
|
+
<div className="flex h-dvh">
|
|
198
|
+
<div className="flex-grow">
|
|
199
|
+
<Thread />
|
|
200
|
+
</div>
|
|
201
|
+
<aside className="w-80 overflow-y-auto border-l p-4">
|
|
202
|
+
<TodosPanel />
|
|
203
|
+
</aside>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## components.json
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
215
|
+
"style": "new-york",
|
|
216
|
+
"rsc": true,
|
|
217
|
+
"tsx": true,
|
|
218
|
+
"tailwind": {
|
|
219
|
+
"config": "",
|
|
220
|
+
"css": "app/globals.css",
|
|
221
|
+
"baseColor": "zinc",
|
|
222
|
+
"cssVariables": true,
|
|
223
|
+
"prefix": ""
|
|
224
|
+
},
|
|
225
|
+
"aliases": {
|
|
226
|
+
"components": "@/components",
|
|
227
|
+
"utils": "@/lib/utils",
|
|
228
|
+
"ui": "@/components/ui",
|
|
229
|
+
"lib": "@/lib",
|
|
230
|
+
"hooks": "@/hooks"
|
|
231
|
+
},
|
|
232
|
+
"iconLibrary": "lucide",
|
|
233
|
+
"registries": {
|
|
234
|
+
"@assistant-ui": "https://r.assistant-ui.com/{name}.json"
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## components/TodosPanel.tsx
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
"use client";
|
|
244
|
+
|
|
245
|
+
import { useLangChainState } from "@assistant-ui/react-langchain";
|
|
246
|
+
|
|
247
|
+
type Todo = {
|
|
248
|
+
id?: string;
|
|
249
|
+
content: string;
|
|
250
|
+
status?: "pending" | "in_progress" | "completed";
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
const statusIcon = (status: Todo["status"]) => {
|
|
254
|
+
switch (status) {
|
|
255
|
+
case "completed":
|
|
256
|
+
return "✓";
|
|
257
|
+
case "in_progress":
|
|
258
|
+
return "◐";
|
|
259
|
+
default:
|
|
260
|
+
return "○";
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export function TodosPanel() {
|
|
265
|
+
const todos = useLangChainState<Todo[]>("todos", []);
|
|
266
|
+
|
|
267
|
+
if (todos.length === 0) {
|
|
268
|
+
return (
|
|
269
|
+
<div className="text-muted-foreground text-sm">
|
|
270
|
+
Todos from the agent will appear here. This panel reads{" "}
|
|
271
|
+
<code className="rounded bg-muted px-1">state.todos</code> via{" "}
|
|
272
|
+
<code className="rounded bg-muted px-1">useLangChainState</code>.
|
|
273
|
+
</div>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return (
|
|
278
|
+
<div className="space-y-2">
|
|
279
|
+
<h2 className="font-semibold text-muted-foreground text-sm uppercase tracking-wide">
|
|
280
|
+
Agent todos
|
|
281
|
+
</h2>
|
|
282
|
+
<ul className="space-y-1">
|
|
283
|
+
{todos.map((todo, i) => (
|
|
284
|
+
<li
|
|
285
|
+
key={todo.id ?? i}
|
|
286
|
+
className="flex items-start gap-2 text-sm leading-relaxed"
|
|
287
|
+
>
|
|
288
|
+
<span aria-hidden>{statusIcon(todo.status)}</span>
|
|
289
|
+
<span
|
|
290
|
+
className={
|
|
291
|
+
todo.status === "completed"
|
|
292
|
+
? "text-muted-foreground line-through"
|
|
293
|
+
: undefined
|
|
294
|
+
}
|
|
295
|
+
>
|
|
296
|
+
{todo.content}
|
|
297
|
+
</span>
|
|
298
|
+
</li>
|
|
299
|
+
))}
|
|
300
|
+
</ul>
|
|
301
|
+
</div>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## next.config.ts
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
import type { NextConfig } from "next";
|
|
311
|
+
|
|
312
|
+
const nextConfig: NextConfig = {
|
|
313
|
+
transpilePackages: ["@assistant-ui/react", "@assistant-ui/react-langchain"],
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
export default nextConfig;
|
|
317
|
+
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## package.json
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"name": "with-langchain",
|
|
325
|
+
"version": "0.0.0",
|
|
326
|
+
"private": true,
|
|
327
|
+
"type": "module",
|
|
328
|
+
"scripts": {
|
|
329
|
+
"dev": "next dev",
|
|
330
|
+
"build": "next build",
|
|
331
|
+
"start": "next start"
|
|
332
|
+
},
|
|
333
|
+
"dependencies": {
|
|
334
|
+
"@assistant-ui/react": "workspace:*",
|
|
335
|
+
"@assistant-ui/react-langchain": "workspace:*",
|
|
336
|
+
"@assistant-ui/react-markdown": "workspace:*",
|
|
337
|
+
"@assistant-ui/ui": "workspace:*",
|
|
338
|
+
"@langchain/langgraph-sdk": "^1.9.1",
|
|
339
|
+
"@langchain/react": "^0.3.3",
|
|
340
|
+
"class-variance-authority": "^0.7.1",
|
|
341
|
+
"clsx": "^2.1.1",
|
|
342
|
+
"lucide-react": "^1.14.0",
|
|
343
|
+
"next": "^16.2.4",
|
|
344
|
+
"react": "^19.2.5",
|
|
345
|
+
"react-dom": "^19.2.5",
|
|
346
|
+
"tailwind-merge": "^3.5.0"
|
|
347
|
+
},
|
|
348
|
+
"devDependencies": {
|
|
349
|
+
"@assistant-ui/x-buildutils": "workspace:*",
|
|
350
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
351
|
+
"@types/node": "^25.6.0",
|
|
352
|
+
"@types/react": "^19.2.14",
|
|
353
|
+
"@types/react-dom": "^19.2.3",
|
|
354
|
+
"postcss": "^8.5.14",
|
|
355
|
+
"tailwindcss": "^4.2.4",
|
|
356
|
+
"tw-animate-css": "^1.4.0",
|
|
357
|
+
"typescript": "^6.0.3"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
## README.md
|
|
364
|
+
|
|
365
|
+
```markdown
|
|
366
|
+
# LangChain `useStream` Example
|
|
367
|
+
|
|
368
|
+
Demonstrates `@assistant-ui/react-langchain`, which wraps `useStream` from `@langchain/react` and exposes it as an assistant-ui runtime.
|
|
369
|
+
|
|
370
|
+
> assistant-ui also ships `@assistant-ui/react-langgraph`, which integrates with `@langchain/langgraph-sdk` directly and currently has a broader feature set. Pick the adapter that matches your upstream choice. See [the comparison](https://www.assistant-ui.com/docs/runtimes/langchain/comparison).
|
|
371
|
+
|
|
372
|
+
## Quick Start
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
pnpm install
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Environment Variables
|
|
379
|
+
|
|
380
|
+
Create `.env.local`:
|
|
381
|
+
|
|
382
|
+
```sh
|
|
383
|
+
NEXT_PUBLIC_LANGGRAPH_API_URL=http://localhost:2024
|
|
384
|
+
NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID=your_graph_id
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
Start a local LangGraph server via [LangGraph Studio](https://github.com/langchain-ai/langgraph-studio) pointing at your graph, or use [LangSmith](https://www.langchain.com/langsmith) for a hosted deployment.
|
|
388
|
+
|
|
389
|
+
### Run
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
pnpm dev
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Open [http://localhost:3000](http://localhost:3000).
|
|
396
|
+
|
|
397
|
+
## Key Features
|
|
398
|
+
|
|
399
|
+
- `useStreamRuntime` — thin wrapper around `useStream` from `@langchain/react`.
|
|
400
|
+
- `useLangChainState<T>(key)` — reads arbitrary custom state keys (demo uses `state.todos` in `TodosPanel`).
|
|
401
|
+
- No hand-written stream generator, no `create` / `load` / `getCheckpointId` glue.
|
|
402
|
+
|
|
403
|
+
## Files of interest
|
|
404
|
+
|
|
405
|
+
- `app/MyRuntimeProvider.tsx` — entire runtime setup in ~15 lines.
|
|
406
|
+
- `components/TodosPanel.tsx` — demonstrates `useLangChainState<Todo[]>("todos", [])`.
|
|
407
|
+
|
|
408
|
+
## Related Documentation
|
|
409
|
+
|
|
410
|
+
- [assistant-ui Documentation](https://www.assistant-ui.com/docs)
|
|
411
|
+
- [LangChain useStream Integration](https://www.assistant-ui.com/docs/runtimes/langchain)
|
|
412
|
+
- [react-langgraph vs react-langchain](https://www.assistant-ui.com/docs/runtimes/langchain/comparison)
|
|
413
|
+
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
## tsconfig.json
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"extends": "@assistant-ui/x-buildutils/ts/next",
|
|
421
|
+
"compilerOptions": {
|
|
422
|
+
"paths": {
|
|
423
|
+
"@/*": ["./*"],
|
|
424
|
+
"@/components/assistant-ui/*": [
|
|
425
|
+
"../../packages/ui/src/components/assistant-ui/*"
|
|
426
|
+
],
|
|
427
|
+
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
428
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
429
|
+
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
433
|
+
"exclude": ["node_modules"]
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
```
|
|
437
|
+
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## app/api/[..._path]/route.ts
|
|
4
4
|
|
|
5
5
|
```typescript
|
|
6
|
-
import { NextRequest, NextResponse } from "next/server";
|
|
6
|
+
import { type NextRequest, NextResponse } from "next/server";
|
|
7
7
|
|
|
8
8
|
function getCorsHeaders() {
|
|
9
9
|
return {
|
|
@@ -27,7 +27,7 @@ async function handleRequest(req: NextRequest, method: string) {
|
|
|
27
27
|
const options: RequestInit = {
|
|
28
28
|
method,
|
|
29
29
|
headers: {
|
|
30
|
-
"x-api-key": process.env
|
|
30
|
+
"x-api-key": process.env.LANGCHAIN_API_KEY || "",
|
|
31
31
|
},
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -36,7 +36,7 @@ async function handleRequest(req: NextRequest, method: string) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const res = await fetch(
|
|
39
|
-
`${process.env
|
|
39
|
+
`${process.env.LANGGRAPH_API_URL}/${path}${queryString}`,
|
|
40
40
|
options,
|
|
41
41
|
);
|
|
42
42
|
|
|
@@ -250,7 +250,7 @@ import {
|
|
|
250
250
|
getCheckpointId,
|
|
251
251
|
sendMessage,
|
|
252
252
|
} from "@/lib/chatApi";
|
|
253
|
-
import { LangChainMessage } from "@assistant-ui/react-langgraph";
|
|
253
|
+
import type { LangChainMessage } from "@assistant-ui/react-langgraph";
|
|
254
254
|
|
|
255
255
|
export function MyRuntimeProvider({
|
|
256
256
|
children,
|
|
@@ -672,7 +672,7 @@ export function TransactionConfirmationPending(props: TransactionConfirmation) {
|
|
|
672
672
|
## components/tools/ToolFallback.tsx
|
|
673
673
|
|
|
674
674
|
```tsx
|
|
675
|
-
import { ToolCallMessagePartComponent } from "@assistant-ui/react";
|
|
675
|
+
import type { ToolCallMessagePartComponent } from "@assistant-ui/react";
|
|
676
676
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
677
677
|
import { useState } from "react";
|
|
678
678
|
import { Button } from "@/components/ui/button";
|
|
@@ -721,8 +721,8 @@ export const ToolFallback: ToolCallMessagePartComponent = ({
|
|
|
721
721
|
## lib/chatApi.ts
|
|
722
722
|
|
|
723
723
|
```typescript
|
|
724
|
-
import { ThreadState, Client } from "@langchain/langgraph-sdk";
|
|
725
|
-
import {
|
|
724
|
+
import { type ThreadState, Client } from "@langchain/langgraph-sdk";
|
|
725
|
+
import type {
|
|
726
726
|
LangChainMessage,
|
|
727
727
|
LangGraphMessagesEvent,
|
|
728
728
|
LangGraphSendMessageConfig,
|
|
@@ -730,7 +730,7 @@ import {
|
|
|
730
730
|
|
|
731
731
|
const createClient = () => {
|
|
732
732
|
const apiUrl =
|
|
733
|
-
process.env
|
|
733
|
+
process.env.NEXT_PUBLIC_LANGGRAPH_API_URL ||
|
|
734
734
|
new URL("/api", window.location.href).href;
|
|
735
735
|
return new Client({
|
|
736
736
|
apiUrl,
|
|
@@ -816,7 +816,7 @@ export const sendMessage = (params: {
|
|
|
816
816
|
|
|
817
817
|
return client.runs.stream(
|
|
818
818
|
params.threadId,
|
|
819
|
-
process.env
|
|
819
|
+
process.env.NEXT_PUBLIC_LANGGRAPH_ASSISTANT_ID!,
|
|
820
820
|
{
|
|
821
821
|
input: params.messages.length > 0 ? { messages: params.messages } : null,
|
|
822
822
|
config: {
|
|
@@ -871,25 +871,25 @@ export default nextConfig;
|
|
|
871
871
|
"@assistant-ui/react-langgraph": "workspace:*",
|
|
872
872
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
873
873
|
"@assistant-ui/ui": "workspace:*",
|
|
874
|
-
"@langchain/langgraph-sdk": "^1.
|
|
874
|
+
"@langchain/langgraph-sdk": "^1.9.1",
|
|
875
875
|
"class-variance-authority": "^0.7.1",
|
|
876
876
|
"clsx": "^2.1.1",
|
|
877
|
-
"lucide-react": "^1.
|
|
878
|
-
"next": "^16.2.
|
|
877
|
+
"lucide-react": "^1.14.0",
|
|
878
|
+
"next": "^16.2.4",
|
|
879
879
|
"react": "^19.2.5",
|
|
880
880
|
"react-dom": "^19.2.5",
|
|
881
881
|
"tailwind-merge": "^3.5.0"
|
|
882
882
|
},
|
|
883
883
|
"devDependencies": {
|
|
884
884
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
885
|
-
"@tailwindcss/postcss": "^4.2.
|
|
885
|
+
"@tailwindcss/postcss": "^4.2.4",
|
|
886
886
|
"@types/node": "^25.6.0",
|
|
887
887
|
"@types/react": "^19.2.14",
|
|
888
888
|
"@types/react-dom": "^19.2.3",
|
|
889
|
-
"postcss": "^8.5.
|
|
890
|
-
"tailwindcss": "^4.2.
|
|
889
|
+
"postcss": "^8.5.14",
|
|
890
|
+
"tailwindcss": "^4.2.4",
|
|
891
891
|
"tw-animate-css": "^1.4.0",
|
|
892
|
-
"typescript": "^6.0.
|
|
892
|
+
"typescript": "^6.0.3"
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
895
|
|