@assistant-ui/mcp-docs-server 0.1.9 → 0.1.10

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.
@@ -1042,36 +1042,36 @@ export default nextConfig;
1042
1042
  "version": "0.0.0",
1043
1043
  "type": "module",
1044
1044
  "dependencies": {
1045
- "@ai-sdk/openai": "^2.0.38",
1046
- "@ai-sdk/react": "^2.0.56",
1045
+ "@ai-sdk/openai": "^2.0.42",
1046
+ "@ai-sdk/react": "^2.0.59",
1047
1047
  "@assistant-ui/react": "workspace:^",
1048
1048
  "@assistant-ui/react-ai-sdk": "workspace:*",
1049
1049
  "@assistant-ui/react-markdown": "workspace:^",
1050
1050
  "@radix-ui/react-slot": "^1.2.3",
1051
1051
  "@radix-ui/react-tooltip": "^1.2.8",
1052
- "@tailwindcss/postcss": "^4.1.13",
1053
- "ai": "^5.0.56",
1052
+ "@tailwindcss/postcss": "^4.1.14",
1053
+ "ai": "^5.0.59",
1054
1054
  "class-variance-authority": "^0.7.1",
1055
1055
  "clsx": "^2.1.1",
1056
1056
  "lucide-react": "^0.544.0",
1057
1057
  "next": "15.5.4",
1058
1058
  "postcss": "^8.5.6",
1059
- "react": "19.1.1",
1060
- "react-dom": "19.1.1",
1059
+ "react": "19.2.0",
1060
+ "react-dom": "19.2.0",
1061
1061
  "remark-gfm": "^4.0.1",
1062
1062
  "tailwind-merge": "^3.3.1",
1063
- "tailwindcss": "^4.1.13",
1063
+ "tailwindcss": "^4.1.14",
1064
1064
  "zod": "^4.1.11"
1065
1065
  },
1066
1066
  "devDependencies": {
1067
1067
  "@assistant-ui/x-buildutils": "workspace:*",
1068
- "@types/node": "^24.5.2",
1069
- "@types/react": "^19.1.15",
1070
- "@types/react-dom": "^19.1.9",
1068
+ "@types/node": "^24.6.2",
1069
+ "@types/react": "^19.2.0",
1070
+ "@types/react-dom": "^19.2.0",
1071
1071
  "eslint": "^9",
1072
1072
  "eslint-config-next": "15.5.4",
1073
1073
  "tw-animate-css": "^1.4.0",
1074
- "typescript": "^5.9.2"
1074
+ "typescript": "^5.9.3"
1075
1075
  },
1076
1076
  "scripts": {
1077
1077
  "dev": "next dev",
@@ -1270,31 +1270,31 @@ export default nextConfig;
1270
1270
  "@assistant-ui/react-markdown": "workspace:^",
1271
1271
  "@radix-ui/react-slot": "^1.2.3",
1272
1272
  "@radix-ui/react-tooltip": "^1.2.8",
1273
- "@tailwindcss/postcss": "^4.1.13",
1274
- "assistant-stream": "^0.2.30",
1273
+ "@tailwindcss/postcss": "^4.1.14",
1274
+ "assistant-stream": "^0.2.34",
1275
1275
  "class-variance-authority": "^0.7.1",
1276
1276
  "clsx": "^2.1.1",
1277
1277
  "framer-motion": "^12.23.22",
1278
1278
  "lucide-react": "^0.544.0",
1279
1279
  "next": "15.5.4",
1280
1280
  "postcss": "^8.5.6",
1281
- "react": "19.1.1",
1282
- "react-dom": "19.1.1",
1281
+ "react": "19.2.0",
1282
+ "react-dom": "19.2.0",
1283
1283
  "remark-gfm": "^4.0.1",
1284
1284
  "tailwind-merge": "^3.3.1",
1285
- "tailwindcss": "^4.1.13",
1285
+ "tailwindcss": "^4.1.14",
1286
1286
  "tailwindcss-animate": "^1.0.7",
1287
1287
  "zod": "^4.1.11"
1288
1288
  },
1289
1289
  "devDependencies": {
1290
1290
  "@assistant-ui/x-buildutils": "workspace:*",
1291
- "@types/node": "^24.5.2",
1292
- "@types/react": "^19.1.15",
1293
- "@types/react-dom": "^19.1.9",
1291
+ "@types/node": "^24.6.2",
1292
+ "@types/react": "^19.2.0",
1293
+ "@types/react-dom": "^19.2.0",
1294
1294
  "eslint": "^9",
1295
1295
  "eslint-config-next": "15.5.4",
1296
1296
  "tw-animate-css": "^1.4.0",
1297
- "typescript": "^5.9.2"
1297
+ "typescript": "^5.9.3"
1298
1298
  },
1299
1299
  "scripts": {
1300
1300
  "dev": "next dev",
@@ -1090,21 +1090,21 @@ export default nextConfig;
1090
1090
  "lint": "eslint ."
1091
1091
  },
1092
1092
  "dependencies": {
1093
- "@ai-sdk/openai": "^2.0.38",
1093
+ "@ai-sdk/openai": "^2.0.42",
1094
1094
  "@assistant-ui/react": "workspace:*",
1095
1095
  "@assistant-ui/react-ai-sdk": "workspace:*",
1096
1096
  "@assistant-ui/react-markdown": "workspace:*",
1097
1097
  "@radix-ui/react-slot": "^1.2.3",
1098
1098
  "@radix-ui/react-tooltip": "^1.2.8",
1099
- "ai": "^5.0.56",
1099
+ "ai": "^5.0.59",
1100
1100
  "class-variance-authority": "^0.7.1",
1101
1101
  "clsx": "^2.1.1",
1102
1102
  "jsonwebtoken": "^9.0.2",
1103
1103
  "lucide-react": "^0.544.0",
1104
1104
  "nanoid": "5.1.6",
1105
1105
  "next": "15.5.4",
1106
- "react": "19.1.1",
1107
- "react-dom": "19.1.1",
1106
+ "react": "19.2.0",
1107
+ "react-dom": "19.2.0",
1108
1108
  "remark-gfm": "^4.0.1",
1109
1109
  "tailwind-merge": "^3.3.1",
1110
1110
  "tw-animate-css": "^1.4.0"
@@ -1118,7 +1118,7 @@ export default nextConfig;
1118
1118
  "eslint": "^9",
1119
1119
  "eslint-config-next": "15.5.4",
1120
1120
  "postcss": "^8",
1121
- "tailwindcss": "^4.1.13",
1121
+ "tailwindcss": "^4.1.14",
1122
1122
  "typescript": "^5"
1123
1123
  }
1124
1124
  }
@@ -1002,7 +1002,7 @@ export default nextConfig;
1002
1002
  "lint": "eslint ."
1003
1003
  },
1004
1004
  "dependencies": {
1005
- "@ai-sdk/openai": "^2.0.38",
1005
+ "@ai-sdk/openai": "^2.0.42",
1006
1006
  "@assistant-ui/react": "workspace:*",
1007
1007
  "@assistant-ui/react-markdown": "workspace:*",
1008
1008
  "@radix-ui/react-slot": "^1.2.3",
@@ -1011,8 +1011,8 @@ export default nextConfig;
1011
1011
  "clsx": "^2.1.1",
1012
1012
  "lucide-react": "^0.544.0",
1013
1013
  "next": "15.5.4",
1014
- "react": "19.1.1",
1015
- "react-dom": "19.1.1",
1014
+ "react": "19.2.0",
1015
+ "react-dom": "19.2.0",
1016
1016
  "remark-gfm": "^4.0.1",
1017
1017
  "tailwind-merge": "^3.3.1",
1018
1018
  "tw-animate-css": "^1.4.0"
@@ -1025,7 +1025,7 @@ export default nextConfig;
1025
1025
  "eslint": "^9",
1026
1026
  "eslint-config-next": "15.5.4",
1027
1027
  "postcss": "^8",
1028
- "tailwindcss": "^4.1.13",
1028
+ "tailwindcss": "^4.1.14",
1029
1029
  "typescript": "^5"
1030
1030
  }
1031
1031
  }
@@ -1225,7 +1225,7 @@ export default nextConfig;
1225
1225
  "lint": "eslint ."
1226
1226
  },
1227
1227
  "dependencies": {
1228
- "@ai-sdk/openai": "^2.0.38",
1228
+ "@ai-sdk/openai": "^2.0.42",
1229
1229
  "@assistant-ui/react": "workspace:*",
1230
1230
  "@assistant-ui/react-ai-sdk": "workspace:*",
1231
1231
  "@assistant-ui/react-hook-form": "workspace:*",
@@ -1240,14 +1240,14 @@ export default nextConfig;
1240
1240
  "@radix-ui/react-tabs": "^1.1.13",
1241
1241
  "@radix-ui/react-tooltip": "^1.2.8",
1242
1242
  "@react-hook/media-query": "^1.1.1",
1243
- "ai": "^5.0.56",
1243
+ "ai": "^5.0.59",
1244
1244
  "class-variance-authority": "^0.7.1",
1245
1245
  "clsx": "^2.1.1",
1246
1246
  "json-schema-to-zod": "^2.6.1",
1247
1247
  "lucide-react": "^0.544.0",
1248
1248
  "next": "15.5.4",
1249
- "react": "19.1.1",
1250
- "react-dom": "19.1.1",
1249
+ "react": "19.2.0",
1250
+ "react-dom": "19.2.0",
1251
1251
  "react-hook-form": "^7.63.0",
1252
1252
  "react-resizable-panels": "^3.0.6",
1253
1253
  "remark-gfm": "^4.0.1",
@@ -1264,8 +1264,8 @@ export default nextConfig;
1264
1264
  "eslint": "^9",
1265
1265
  "eslint-config-next": "15.5.4",
1266
1266
  "postcss": "^8",
1267
- "tailwindcss": "^4.1.13",
1268
- "typescript": "^5.9.2"
1267
+ "tailwindcss": "^4.1.14",
1268
+ "typescript": "^5.9.3"
1269
1269
  }
1270
1270
  }
1271
1271
 
@@ -77,68 +77,6 @@ export const OPTIONS = () => {
77
77
 
78
78
  ```
79
79
 
80
- ## app/api/assistant-ui-token/route.ts
81
-
82
- ```typescript
83
- import { customAlphabet } from "nanoid";
84
- import { cookies } from "next/headers";
85
- import jwt, { JwtPayload } from "jsonwebtoken";
86
- import { AssistantCloud } from "@assistant-ui/react";
87
-
88
- const generateId = customAlphabet(
89
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
90
- 32,
91
- );
92
- const randomUserId = () => {
93
- const userId = "usr_anon_" + generateId();
94
- return userId;
95
- };
96
-
97
- const getJwtForUser = (userId: string) => {
98
- return jwt.sign(
99
- {
100
- sub: userId,
101
- iat: Math.floor(Date.now() / 1000),
102
- exp: Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 7, // 1 week
103
- },
104
- process.env["JWT_SECRET"]!,
105
- );
106
- };
107
-
108
- const getUserIdFromJwt = (token: string) => {
109
- const decoded = jwt.verify(token, process.env["JWT_SECRET"]!) as JwtPayload;
110
- return decoded.sub!;
111
- };
112
-
113
- export const POST = async () => {
114
- const cookieStore = await cookies();
115
- const jwtCookie = cookieStore.get("jwt");
116
- let userId;
117
- if (!jwtCookie) {
118
- userId = randomUserId();
119
- } else {
120
- userId = getUserIdFromJwt(jwtCookie.value);
121
- }
122
-
123
- cookieStore.set("jwt", getJwtForUser(userId), {
124
- path: "/",
125
- httpOnly: true,
126
- secure: process.env.NODE_ENV === "production",
127
- sameSite: "strict",
128
- maxAge: 60 * 60 * 24 * 7, // 1 week
129
- });
130
-
131
- const client = new AssistantCloud({
132
- apiKey: process.env["ASSISTANT_API_KEY"]!,
133
- userId,
134
- workspaceId: userId,
135
- });
136
- const { token } = await client.auth.tokens.create();
137
- return Response.json({ token });
138
- };
139
-
140
- ```
141
-
142
80
  ## app/globals.css
143
81
 
144
82
  ```css
@@ -302,21 +240,19 @@ export default function RootLayout({
302
240
  ```tsx
303
241
  "use client";
304
242
 
305
- import {
306
- AssistantCloud,
307
- AssistantRuntimeProvider,
308
- useCloudThreadListRuntime,
309
- useThreadListItemRuntime,
310
- } from "@assistant-ui/react";
243
+ import { AssistantRuntimeProvider } from "@assistant-ui/react";
311
244
  import { useLangGraphRuntime } from "@assistant-ui/react-langgraph";
312
245
  import { createThread, getThreadState, sendMessage } from "@/lib/chatApi";
313
246
  import { LangChainMessage } from "@assistant-ui/react-langgraph";
314
247
 
315
- const useMyLangGraphRuntime = () => {
316
- const threadListItemRuntime = useThreadListItemRuntime();
248
+ export function MyRuntimeProvider({
249
+ children,
250
+ }: Readonly<{
251
+ children: React.ReactNode;
252
+ }>) {
317
253
  const runtime = useLangGraphRuntime({
318
- stream: async function* (messages) {
319
- const { externalId } = await threadListItemRuntime.initialize();
254
+ stream: async function* (messages, { initialize }) {
255
+ const { externalId } = await initialize();
320
256
  if (!externalId) throw new Error("Thread not found");
321
257
 
322
258
  const generator = sendMessage({
@@ -326,7 +262,11 @@ const useMyLangGraphRuntime = () => {
326
262
 
327
263
  yield* generator;
328
264
  },
329
- onSwitchToThread: async (externalId) => {
265
+ create: async () => {
266
+ const { thread_id } = await createThread();
267
+ return { externalId: thread_id };
268
+ },
269
+ load: async (externalId) => {
330
270
  const state = await getThreadState(externalId);
331
271
  return {
332
272
  messages:
@@ -336,31 +276,6 @@ const useMyLangGraphRuntime = () => {
336
276
  },
337
277
  });
338
278
 
339
- return runtime;
340
- };
341
-
342
- const cloud = new AssistantCloud({
343
- baseUrl: process.env["NEXT_PUBLIC_ASSISTANT_BASE_URL"]!,
344
- authToken: () =>
345
- fetch("/api/assistant-ui-token", { method: "POST" })
346
- .then((r) => r.json())
347
- .then((r) => r.token),
348
- });
349
-
350
- export function MyRuntimeProvider({
351
- children,
352
- }: Readonly<{
353
- children: React.ReactNode;
354
- }>) {
355
- const runtime = useCloudThreadListRuntime({
356
- cloud,
357
- runtimeHook: useMyLangGraphRuntime,
358
- create: async () => {
359
- const { thread_id } = await createThread();
360
- return { externalId: thread_id };
361
- },
362
- });
363
-
364
279
  return (
365
280
  <AssistantRuntimeProvider runtime={runtime}>
366
281
  {children}
@@ -1760,7 +1675,7 @@ export default nextConfig;
1760
1675
  "@assistant-ui/react": "workspace:*",
1761
1676
  "@assistant-ui/react-langgraph": "workspace:*",
1762
1677
  "@assistant-ui/react-markdown": "workspace:*",
1763
- "@langchain/langgraph-sdk": "^0.1.7",
1678
+ "@langchain/langgraph-sdk": "^0.1.9",
1764
1679
  "@radix-ui/react-slot": "^1.2.3",
1765
1680
  "@radix-ui/react-tooltip": "^1.2.8",
1766
1681
  "class-variance-authority": "^0.7.1",
@@ -1770,8 +1685,8 @@ export default nextConfig;
1770
1685
  "lucide-react": "^0.544.0",
1771
1686
  "nanoid": "5.1.6",
1772
1687
  "next": "15.5.4",
1773
- "react": "19.1.1",
1774
- "react-dom": "19.1.1",
1688
+ "react": "19.2.0",
1689
+ "react-dom": "19.2.0",
1775
1690
  "remark-gfm": "^4.0.1",
1776
1691
  "tailwind-merge": "^3.3.1",
1777
1692
  "tw-animate-css": "^1.4.0"
@@ -1786,8 +1701,8 @@ export default nextConfig;
1786
1701
  "eslint": "^9",
1787
1702
  "eslint-config-next": "15.5.4",
1788
1703
  "postcss": "^8",
1789
- "tailwindcss": "^4.1.13",
1790
- "typescript": "^5.9.2"
1704
+ "tailwindcss": "^4.1.14",
1705
+ "typescript": "^5.9.3"
1791
1706
  }
1792
1707
  }
1793
1708
 
@@ -1248,7 +1248,7 @@ export default nextConfig;
1248
1248
  "lint": "eslint ."
1249
1249
  },
1250
1250
  "dependencies": {
1251
- "@ai-sdk/openai": "^2.0.38",
1251
+ "@ai-sdk/openai": "^2.0.42",
1252
1252
  "@assistant-ui/react": "workspace:*",
1253
1253
  "@assistant-ui/react-markdown": "workspace:*",
1254
1254
  "@radix-ui/react-slot": "^1.2.3",
@@ -1257,8 +1257,8 @@ export default nextConfig;
1257
1257
  "clsx": "^2.1.1",
1258
1258
  "lucide-react": "^0.544.0",
1259
1259
  "next": "15.5.4",
1260
- "react": "19.1.1",
1261
- "react-dom": "19.1.1",
1260
+ "react": "19.2.0",
1261
+ "react-dom": "19.2.0",
1262
1262
  "remark-gfm": "^4.0.1",
1263
1263
  "tailwind-merge": "^3.3.1",
1264
1264
  "tw-animate-css": "^1.4.0"
@@ -1271,7 +1271,7 @@ export default nextConfig;
1271
1271
  "eslint": "^9",
1272
1272
  "eslint-config-next": "15.5.4",
1273
1273
  "postcss": "^8",
1274
- "tailwindcss": "^4.1.13",
1274
+ "tailwindcss": "^4.1.14",
1275
1275
  "typescript": "^5"
1276
1276
  }
1277
1277
  }
@@ -1647,7 +1647,7 @@ export default nextConfig;
1647
1647
  "lint": "eslint ."
1648
1648
  },
1649
1649
  "dependencies": {
1650
- "@ai-sdk/openai": "^2.0.38",
1650
+ "@ai-sdk/openai": "^2.0.42",
1651
1651
  "@assistant-ui/react": "workspace:*",
1652
1652
  "@assistant-ui/react-ai-sdk": "workspace:*",
1653
1653
  "@assistant-ui/react-hook-form": "workspace:*",
@@ -1660,14 +1660,14 @@ export default nextConfig;
1660
1660
  "@radix-ui/react-tabs": "^1.1.13",
1661
1661
  "@radix-ui/react-tooltip": "^1.2.8",
1662
1662
  "@react-hook/media-query": "^1.1.1",
1663
- "ai": "^5.0.56",
1663
+ "ai": "^5.0.59",
1664
1664
  "class-variance-authority": "^0.7.1",
1665
1665
  "clsx": "^2.1.1",
1666
1666
  "json-schema-to-zod": "^2.6.1",
1667
1667
  "lucide-react": "^0.544.0",
1668
1668
  "next": "15.5.4",
1669
- "react": "19.1.1",
1670
- "react-dom": "19.1.1",
1669
+ "react": "19.2.0",
1670
+ "react-dom": "19.2.0",
1671
1671
  "react-hook-form": "^7.63.0",
1672
1672
  "react-resizable-panels": "^3.0.6",
1673
1673
  "remark-gfm": "^4.0.1",
@@ -1684,8 +1684,8 @@ export default nextConfig;
1684
1684
  "eslint": "^9",
1685
1685
  "eslint-config-next": "15.5.4",
1686
1686
  "postcss": "^8",
1687
- "tailwindcss": "^4.1.13",
1688
- "typescript": "^5.9.2"
1687
+ "tailwindcss": "^4.1.14",
1688
+ "typescript": "^5.9.3"
1689
1689
  }
1690
1690
  }
1691
1691
 
@@ -195,8 +195,7 @@ const Suggestion = () => {
195
195
  return (
196
196
  <ThreadPrimitive.Suggestion
197
197
  prompt="I need help with product search"
198
- method="replace"
199
- autoSend
198
+ send
200
199
  />
201
200
  );
202
201
  };
@@ -211,17 +210,29 @@ const Suggestion = () => {
211
210
  description: "The suggestion's prompt.",
212
211
  },
213
212
  {
214
- name: "method",
215
- type: "'replace'",
213
+ name: "send",
214
+ type: "boolean",
216
215
  description:
217
- "How does the suggestion interact with the composer's existing value.",
216
+ "When true, automatically sends the message. When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`",
218
217
  },
219
218
  {
220
- name: "autoSend",
219
+ name: "clearComposer",
221
220
  type: "boolean",
221
+ default: "true",
222
222
  description:
223
- "Whether to automatically send the suggestion when the user clicks on it.",
224
- default: "false",
223
+ "Whether to clear the composer after sending. When send is set to false, determines if composer text is replaced with suggestion (true, default), or if the suggestion's prompt is appended to the composer text (false).",
224
+ },
225
+ {
226
+ name: "autoSend",
227
+ type: "boolean",
228
+ deprecated: true,
229
+ description: "Deprecated. Use 'send' instead.",
230
+ },
231
+ {
232
+ name: "method",
233
+ type: "'replace'",
234
+ deprecated: true,
235
+ description: "Deprecated. This parameter is no longer used.",
225
236
  },
226
237
  ]}
227
238
  />
@@ -243,6 +254,21 @@ Renders children if a condition is met.
243
254
  type: "boolean | undefined",
244
255
  description: "Render children if the thread is running.",
245
256
  },
257
+ {
258
+ name: "disabled",
259
+ type: "boolean | undefined",
260
+ description: "Render children if the thread is disabled.",
261
+ },
262
+ {
263
+ name: "loading",
264
+ type: "boolean | undefined",
265
+ description: "Render children if the thread is loading.",
266
+ },
267
+ {
268
+ name: "new",
269
+ type: "boolean | undefined",
270
+ description: "Render children if the thread is new.",
271
+ },
246
272
  ]}
247
273
  />
248
274
 
@@ -253,4 +279,10 @@ Renders children if a condition is met.
253
279
  <Thread.If empty={false}>
254
280
  {/* rendered if thread is not empty */}
255
281
  </Thread.If>
282
+ <Thread.If loading>
283
+ {/* rendered if thread is loading */}
284
+ </Thread.If>
285
+ <Thread.If new>
286
+ {/* rendered if thread is new */}
287
+ </Thread.If>
256
288
  ```