@assistant-ui/mcp-docs-server 0.1.35 → 0.1.36
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 +1 -1
- package/.docs/organized/code-examples/with-a2a.md +2 -2
- package/.docs/organized/code-examples/with-ag-ui.md +2 -2
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +4 -4
- package/.docs/organized/code-examples/with-artifacts.md +4 -4
- package/.docs/organized/code-examples/with-assistant-transport.md +70 -54
- package/.docs/organized/code-examples/with-browser-extension.md +4 -4
- package/.docs/organized/code-examples/with-chain-of-thought.md +40 -89
- package/.docs/organized/code-examples/with-cloud-standalone.md +4 -4
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +4 -4
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +6 -6
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +6 -6
- package/.docs/organized/code-examples/with-eve.md +343 -0
- package/.docs/organized/code-examples/with-expo.md +909 -932
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -8
- package/.docs/organized/code-examples/with-generative-ui.md +5 -5
- package/.docs/organized/code-examples/with-google-adk.md +2 -2
- package/.docs/organized/code-examples/with-heat-graph.md +1 -1
- package/.docs/organized/code-examples/with-image-generation.md +4 -4
- package/.docs/organized/code-examples/with-interactables.md +166 -338
- package/.docs/organized/code-examples/with-langchain.md +4 -4
- package/.docs/organized/code-examples/with-langgraph.md +20 -157
- package/.docs/organized/code-examples/with-livekit.md +6 -6
- package/.docs/organized/code-examples/with-mcp.md +4 -4
- package/.docs/organized/code-examples/with-opencode.md +3 -3
- package/.docs/organized/code-examples/with-pi.md +9 -7
- package/.docs/organized/code-examples/with-react-hook-form.md +13 -6
- package/.docs/organized/code-examples/with-react-ink-web.md +5 -5
- package/.docs/organized/code-examples/with-react-ink.md +1 -1
- package/.docs/organized/code-examples/with-react-router.md +10 -10
- package/.docs/organized/code-examples/with-resumable-stream.md +5 -5
- package/.docs/organized/code-examples/with-store.md +1 -1
- package/.docs/organized/code-examples/with-tanstack.md +5 -5
- package/.docs/organized/code-examples/with-tap-runtime.md +2 -2
- package/.docs/organized/code-examples/with-virtualized-thread.md +44 -24
- package/.docs/raw/docs/(docs)/cli.mdx +4 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +25 -2
- package/.docs/raw/docs/(docs)/index.mdx +5 -2
- package/.docs/raw/docs/(docs)/installation.mdx +5 -2
- package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +16 -16
- package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +73 -42
- package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +3 -20
- package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +234 -166
- package/.docs/raw/docs/(reference)/api-reference/integrations/eve.mdx +51 -0
- package/.docs/raw/docs/(reference)/api-reference/integrations/index.mdx +4 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +70 -38
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +30 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +7 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +26 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/chain-of-thought.mdx +15 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +103 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +16 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +56 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/queue-item.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +12 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +14 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +57 -1
- package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +6 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables-legacy.mdx +55 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/interactables.mdx +151 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +15 -15
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +20 -20
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +25 -9
- package/.docs/raw/docs/guides/headless-composer-input.mdx +113 -0
- package/.docs/raw/docs/guides/latex.mdx +28 -22
- package/.docs/raw/docs/guides/mentions.mdx +32 -7
- package/.docs/raw/docs/guides/slash-commands.mdx +3 -6
- package/.docs/raw/docs/guides/speech.mdx +5 -7
- package/.docs/raw/docs/guides/virtualization.mdx +77 -7
- package/.docs/raw/docs/guides/voice.mdx +3 -2
- package/.docs/raw/docs/integrations/attachments/custom-adapter.mdx +4 -12
- package/.docs/raw/docs/integrations/auth/better-auth.mdx +7 -10
- package/.docs/raw/docs/integrations/auth/clerk.mdx +3 -9
- package/.docs/raw/docs/integrations/auth/next-auth.mdx +3 -8
- package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +8 -5
- package/.docs/raw/docs/integrations/index.mdx +5 -12
- package/.docs/raw/docs/integrations/observability/helicone.mdx +3 -4
- package/.docs/raw/docs/integrations/observability/langfuse.mdx +3 -5
- package/.docs/raw/docs/integrations/observability/langsmith.mdx +3 -2
- package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +4 -3
- package/.docs/raw/docs/primitives/composer.mdx +8 -0
- package/.docs/raw/docs/primitives/thread.mdx +24 -0
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +21 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +54 -0
- package/.docs/raw/docs/runtimes/eve/overview.mdx +100 -0
- package/.docs/raw/docs/runtimes/eve/quickstart.mdx +143 -0
- package/.docs/raw/docs/runtimes/langchain.mdx +386 -18
- package/.docs/raw/docs/runtimes/langgraph/quickstart.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +1 -1
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +6 -0
- package/.docs/raw/docs/tools/defining-tools.mdx +4 -0
- package/.docs/raw/docs/tools/interactables-legacy.mdx +410 -0
- package/.docs/raw/docs/tools/interactables.mdx +892 -223
- package/.docs/raw/docs/tools/mcp.mdx +4 -4
- package/.docs/raw/docs/tools/multi-agent.mdx +5 -0
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +2 -0
- package/.docs/raw/docs/ui/file.mdx +1 -1
- package/.docs/raw/docs/ui/part-grouping.mdx +38 -0
- package/.docs/raw/docs/utilities/react-o11y.mdx +92 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +14 -6
- package/src/tools/tests/mcp-protocol.test.ts +9 -0
|
@@ -782,7 +782,7 @@ export default withAui(nextConfig);
|
|
|
782
782
|
"@assistant-ui/next": "workspace:*",
|
|
783
783
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
784
784
|
"@tailwindcss/postcss": "^4.3.1",
|
|
785
|
-
"@types/node": "^
|
|
785
|
+
"@types/node": "^26.0.0",
|
|
786
786
|
"@types/react": "^19.2.17",
|
|
787
787
|
"@types/react-dom": "^19.2.3",
|
|
788
788
|
"postcss": "^8.5.15",
|
|
@@ -555,7 +555,7 @@ export default withAui(nextConfig);
|
|
|
555
555
|
"@assistant-ui/ui": "workspace:*",
|
|
556
556
|
"class-variance-authority": "^0.7.1",
|
|
557
557
|
"clsx": "^2.1.1",
|
|
558
|
-
"lucide-react": "^1.
|
|
558
|
+
"lucide-react": "^1.21.0",
|
|
559
559
|
"next": "^16.2.9",
|
|
560
560
|
"react": "^19.2.7",
|
|
561
561
|
"react-dom": "^19.2.7",
|
|
@@ -565,7 +565,7 @@ export default withAui(nextConfig);
|
|
|
565
565
|
"@assistant-ui/next": "workspace:*",
|
|
566
566
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
567
567
|
"@tailwindcss/postcss": "^4.3.1",
|
|
568
|
-
"@types/node": "^
|
|
568
|
+
"@types/node": "^26.0.0",
|
|
569
569
|
"@types/react": "^19.2.17",
|
|
570
570
|
"@types/react-dom": "^19.2.3",
|
|
571
571
|
"postcss": "^8.5.15",
|
|
@@ -427,7 +427,7 @@ export default withAui(nextConfig);
|
|
|
427
427
|
"@assistant-ui/ui": "workspace:*",
|
|
428
428
|
"class-variance-authority": "^0.7.1",
|
|
429
429
|
"clsx": "^2.1.1",
|
|
430
|
-
"lucide-react": "^1.
|
|
430
|
+
"lucide-react": "^1.21.0",
|
|
431
431
|
"next": "^16.2.9",
|
|
432
432
|
"react": "^19.2.7",
|
|
433
433
|
"react-dom": "^19.2.7",
|
|
@@ -437,7 +437,7 @@ export default withAui(nextConfig);
|
|
|
437
437
|
"@assistant-ui/next": "workspace:*",
|
|
438
438
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
439
439
|
"@tailwindcss/postcss": "^4.3.1",
|
|
440
|
-
"@types/node": "^
|
|
440
|
+
"@types/node": "^26.0.0",
|
|
441
441
|
"@types/react": "^19.2.17",
|
|
442
442
|
"@types/react-dom": "^19.2.3",
|
|
443
443
|
"postcss": "^8.5.15",
|
|
@@ -316,15 +316,15 @@ export default withAui(nextConfig);
|
|
|
316
316
|
"start": "next start"
|
|
317
317
|
},
|
|
318
318
|
"dependencies": {
|
|
319
|
-
"@ai-sdk/openai": "^3.0.
|
|
319
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
320
320
|
"@assistant-ui/react": "workspace:*",
|
|
321
321
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
322
322
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
323
323
|
"@assistant-ui/ui": "workspace:*",
|
|
324
|
-
"ai": "^6.0.
|
|
324
|
+
"ai": "^6.0.208",
|
|
325
325
|
"class-variance-authority": "^0.7.1",
|
|
326
326
|
"clsx": "^2.1.1",
|
|
327
|
-
"lucide-react": "^1.
|
|
327
|
+
"lucide-react": "^1.21.0",
|
|
328
328
|
"next": "^16.2.9",
|
|
329
329
|
"react": "^19.2.7",
|
|
330
330
|
"react-dom": "^19.2.7",
|
|
@@ -335,7 +335,7 @@ export default withAui(nextConfig);
|
|
|
335
335
|
"@assistant-ui/next": "workspace:*",
|
|
336
336
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
337
337
|
"@tailwindcss/postcss": "^4.3.1",
|
|
338
|
-
"@types/node": "^
|
|
338
|
+
"@types/node": "^26.0.0",
|
|
339
339
|
"@types/react": "^19.2.17",
|
|
340
340
|
"@types/react-dom": "^19.2.3",
|
|
341
341
|
"postcss": "^8.5.15",
|
|
@@ -426,15 +426,15 @@ export default withAui(nextConfig);
|
|
|
426
426
|
"start": "next start"
|
|
427
427
|
},
|
|
428
428
|
"dependencies": {
|
|
429
|
-
"@ai-sdk/openai": "^3.0.
|
|
429
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
430
430
|
"@assistant-ui/react": "workspace:*",
|
|
431
431
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
432
432
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
433
433
|
"@assistant-ui/ui": "workspace:*",
|
|
434
|
-
"ai": "^6.0.
|
|
434
|
+
"ai": "^6.0.208",
|
|
435
435
|
"class-variance-authority": "^0.7.1",
|
|
436
436
|
"clsx": "^2.1.1",
|
|
437
|
-
"lucide-react": "^1.
|
|
437
|
+
"lucide-react": "^1.21.0",
|
|
438
438
|
"next": "^16.2.9",
|
|
439
439
|
"react": "^19.2.7",
|
|
440
440
|
"react-dom": "^19.2.7",
|
|
@@ -445,7 +445,7 @@ export default withAui(nextConfig);
|
|
|
445
445
|
"@assistant-ui/next": "workspace:*",
|
|
446
446
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
447
447
|
"@tailwindcss/postcss": "^4.3.1",
|
|
448
|
-
"@types/node": "^
|
|
448
|
+
"@types/node": "^26.0.0",
|
|
449
449
|
"@types/react": "^19.2.17",
|
|
450
450
|
"@types/react-dom": "^19.2.3",
|
|
451
451
|
"postcss": "^8.5.15",
|
|
@@ -170,7 +170,6 @@ export default function RootLayout({
|
|
|
170
170
|
|
|
171
171
|
import {
|
|
172
172
|
AssistantRuntimeProvider,
|
|
173
|
-
defineToolkit,
|
|
174
173
|
Tools,
|
|
175
174
|
type AssistantTransportConnectionMetadata,
|
|
176
175
|
unstable_createMessageConverter as createMessageConverter,
|
|
@@ -182,57 +181,7 @@ import {
|
|
|
182
181
|
type LangChainMessage,
|
|
183
182
|
} from "@assistant-ui/react-langgraph";
|
|
184
183
|
import type { ReactNode } from "react";
|
|
185
|
-
import
|
|
186
|
-
|
|
187
|
-
const toolkit = defineToolkit({
|
|
188
|
-
get_weather: {
|
|
189
|
-
type: "frontend",
|
|
190
|
-
description: "Get the current weather for a city",
|
|
191
|
-
parameters: z.object({
|
|
192
|
-
location: z.string().describe("The city to get weather for"),
|
|
193
|
-
unit: z
|
|
194
|
-
.enum(["celsius", "fahrenheit"])
|
|
195
|
-
.optional()
|
|
196
|
-
.describe("Temperature unit"),
|
|
197
|
-
}),
|
|
198
|
-
execute: async ({ location, unit = "celsius" }) => {
|
|
199
|
-
console.log(`Getting weather for ${location} in ${unit}`);
|
|
200
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
201
|
-
|
|
202
|
-
const temp = Math.floor(Math.random() * 30) + 10;
|
|
203
|
-
const conditions = ["sunny", "cloudy", "rainy", "partly cloudy"];
|
|
204
|
-
const condition =
|
|
205
|
-
conditions[Math.floor(Math.random() * conditions.length)];
|
|
206
|
-
|
|
207
|
-
return {
|
|
208
|
-
location,
|
|
209
|
-
temperature: temp,
|
|
210
|
-
unit,
|
|
211
|
-
condition,
|
|
212
|
-
humidity: Math.floor(Math.random() * 40) + 40,
|
|
213
|
-
windSpeed: Math.floor(Math.random() * 20) + 5,
|
|
214
|
-
};
|
|
215
|
-
},
|
|
216
|
-
streamCall: async (reader) => {
|
|
217
|
-
console.log("streamCall", reader);
|
|
218
|
-
const city = await reader.args.get("location");
|
|
219
|
-
console.log("location", city);
|
|
220
|
-
|
|
221
|
-
const args = await reader.args.get();
|
|
222
|
-
console.log("args", args);
|
|
223
|
-
|
|
224
|
-
const result = await reader.response.get();
|
|
225
|
-
console.log("result", result);
|
|
226
|
-
},
|
|
227
|
-
renderText: {
|
|
228
|
-
running: ({ args }) => `Getting weather for ${args.location ?? "..."}`,
|
|
229
|
-
complete: ({ args, result }) =>
|
|
230
|
-
result
|
|
231
|
-
? `${args.location}: ${result.temperature}° ${result.unit}, ${result.condition}`
|
|
232
|
-
: "Weather lookup complete",
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
});
|
|
184
|
+
import toolkit from "./toolkit";
|
|
236
185
|
|
|
237
186
|
type MyRuntimeProviderProps = {
|
|
238
187
|
children: ReactNode;
|
|
@@ -291,6 +240,10 @@ export function MyRuntimeProvider({ children }: MyRuntimeProviderProps) {
|
|
|
291
240
|
body: {
|
|
292
241
|
"Test-Body": "test-value",
|
|
293
242
|
},
|
|
243
|
+
prepareSendCommandsRequest: (body) => {
|
|
244
|
+
console.log("Assistant transport request tools:", body.tools);
|
|
245
|
+
return body;
|
|
246
|
+
},
|
|
294
247
|
onResponse: () => {
|
|
295
248
|
console.log("Response received from server");
|
|
296
249
|
},
|
|
@@ -360,6 +313,69 @@ export default function Home() {
|
|
|
360
313
|
|
|
361
314
|
```
|
|
362
315
|
|
|
316
|
+
## app/toolkit.tsx
|
|
317
|
+
|
|
318
|
+
```tsx
|
|
319
|
+
"use generative";
|
|
320
|
+
|
|
321
|
+
import { defineToolkit } from "@assistant-ui/react";
|
|
322
|
+
import { z } from "zod";
|
|
323
|
+
|
|
324
|
+
export default defineToolkit({
|
|
325
|
+
get_weather: {
|
|
326
|
+
description: "Get the current weather for a city",
|
|
327
|
+
parameters: z.object({
|
|
328
|
+
location: z.string().describe("The city to get weather for"),
|
|
329
|
+
unit: z
|
|
330
|
+
.enum(["celsius", "fahrenheit"])
|
|
331
|
+
.optional()
|
|
332
|
+
.describe("Temperature unit"),
|
|
333
|
+
}),
|
|
334
|
+
execute: async ({ location, unit = "celsius" }) => {
|
|
335
|
+
"use client";
|
|
336
|
+
|
|
337
|
+
console.log(`Getting weather for ${location} in ${unit}`);
|
|
338
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
339
|
+
|
|
340
|
+
const temp = Math.floor(Math.random() * 30) + 10;
|
|
341
|
+
const conditions = ["sunny", "cloudy", "rainy", "partly cloudy"];
|
|
342
|
+
const condition =
|
|
343
|
+
conditions[Math.floor(Math.random() * conditions.length)];
|
|
344
|
+
|
|
345
|
+
return {
|
|
346
|
+
location,
|
|
347
|
+
temperature: temp,
|
|
348
|
+
unit,
|
|
349
|
+
condition,
|
|
350
|
+
humidity: Math.floor(Math.random() * 40) + 40,
|
|
351
|
+
windSpeed: Math.floor(Math.random() * 20) + 5,
|
|
352
|
+
};
|
|
353
|
+
},
|
|
354
|
+
streamCall: async (reader) => {
|
|
355
|
+
"use client";
|
|
356
|
+
|
|
357
|
+
console.log("streamCall", reader);
|
|
358
|
+
const city = await reader.args.get("location");
|
|
359
|
+
console.log("location", city);
|
|
360
|
+
|
|
361
|
+
const args = await reader.args.get();
|
|
362
|
+
console.log("args", args);
|
|
363
|
+
|
|
364
|
+
const result = await reader.response.get();
|
|
365
|
+
console.log("result", result);
|
|
366
|
+
},
|
|
367
|
+
renderText: {
|
|
368
|
+
running: ({ args }) => `Getting weather for ${args.location ?? "..."}`,
|
|
369
|
+
complete: ({ args, result }) =>
|
|
370
|
+
result
|
|
371
|
+
? `${args.location}: ${result.temperature}° ${result.unit}, ${result.condition}`
|
|
372
|
+
: "Weather lookup complete",
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
|
|
363
379
|
## components.json
|
|
364
380
|
|
|
365
381
|
```json
|
|
@@ -433,7 +449,7 @@ export default withAui(nextConfig);
|
|
|
433
449
|
"@assistant-ui/ui": "workspace:*",
|
|
434
450
|
"class-variance-authority": "^0.7.1",
|
|
435
451
|
"clsx": "^2.1.1",
|
|
436
|
-
"lucide-react": "^1.
|
|
452
|
+
"lucide-react": "^1.21.0",
|
|
437
453
|
"next": "^16.2.9",
|
|
438
454
|
"react": "^19.2.7",
|
|
439
455
|
"react-dom": "^19.2.7",
|
|
@@ -444,7 +460,7 @@ export default withAui(nextConfig);
|
|
|
444
460
|
"@assistant-ui/next": "workspace:*",
|
|
445
461
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
446
462
|
"@tailwindcss/postcss": "^4.3.1",
|
|
447
|
-
"@types/node": "^
|
|
463
|
+
"@types/node": "^26.0.0",
|
|
448
464
|
"@types/react": "^19.2.17",
|
|
449
465
|
"@types/react-dom": "^19.2.3",
|
|
450
466
|
"postcss": "^8.5.15",
|
|
@@ -229,15 +229,15 @@ export function MyThread() {
|
|
|
229
229
|
"@assistant-ui/ui": "workspace:*",
|
|
230
230
|
"class-variance-authority": "^0.7.1",
|
|
231
231
|
"clsx": "^2.1.1",
|
|
232
|
-
"lucide-react": "^1.
|
|
232
|
+
"lucide-react": "^1.21.0",
|
|
233
233
|
"react": "^19.2.7",
|
|
234
234
|
"react-dom": "^19.2.7",
|
|
235
235
|
"tailwind-merge": "^3.6.0"
|
|
236
236
|
},
|
|
237
237
|
"devDependencies": {
|
|
238
238
|
"@tailwindcss/postcss": "^4.3.1",
|
|
239
|
-
"@types/chrome": "^0.
|
|
240
|
-
"@types/node": "^
|
|
239
|
+
"@types/chrome": "^0.2.0",
|
|
240
|
+
"@types/node": "^26.0.0",
|
|
241
241
|
"@types/react": "^19.2.17",
|
|
242
242
|
"@types/react-dom": "^19.2.3",
|
|
243
243
|
"esbuild": "^0.28.1",
|
|
@@ -245,7 +245,7 @@ export function MyThread() {
|
|
|
245
245
|
"tailwindcss": "^4.3.1",
|
|
246
246
|
"tsx": "^4.22.4",
|
|
247
247
|
"tw-animate-css": "^1.4.0",
|
|
248
|
-
"typescript": "
|
|
248
|
+
"typescript": "^6.0.3"
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
|
|
@@ -405,11 +405,24 @@ export default function RootLayout({
|
|
|
405
405
|
```tsx
|
|
406
406
|
"use client";
|
|
407
407
|
|
|
408
|
-
import { type FC, type PropsWithChildren
|
|
408
|
+
import { type FC, type PropsWithChildren } from "react";
|
|
409
409
|
import { MarkdownText } from "@/components/assistant-ui/markdown-text";
|
|
410
410
|
import { Sources } from "@/components/assistant-ui/sources";
|
|
411
411
|
import { TooltipIconButton } from "@/components/assistant-ui/tooltip-icon-button";
|
|
412
412
|
import { Button } from "@/components/ui/button";
|
|
413
|
+
import {
|
|
414
|
+
Reasoning,
|
|
415
|
+
ReasoningContent,
|
|
416
|
+
ReasoningRoot,
|
|
417
|
+
ReasoningText,
|
|
418
|
+
ReasoningTrigger,
|
|
419
|
+
} from "@/components/assistant-ui/reasoning";
|
|
420
|
+
import { ToolFallback } from "@/components/assistant-ui/tool-fallback";
|
|
421
|
+
import {
|
|
422
|
+
ToolGroupContent,
|
|
423
|
+
ToolGroupRoot,
|
|
424
|
+
ToolGroupTrigger,
|
|
425
|
+
} from "@/components/assistant-ui/tool-group";
|
|
413
426
|
import {
|
|
414
427
|
ComposerPrimitive,
|
|
415
428
|
groupPartByType,
|
|
@@ -418,13 +431,7 @@ import {
|
|
|
418
431
|
ThreadPrimitive,
|
|
419
432
|
useThread,
|
|
420
433
|
} from "@assistant-ui/react";
|
|
421
|
-
import {
|
|
422
|
-
ArrowDownIcon,
|
|
423
|
-
ArrowUpIcon,
|
|
424
|
-
ChevronDownIcon,
|
|
425
|
-
ChevronRightIcon,
|
|
426
|
-
SquareIcon,
|
|
427
|
-
} from "lucide-react";
|
|
434
|
+
import { ArrowDownIcon, ArrowUpIcon, SquareIcon } from "lucide-react";
|
|
428
435
|
|
|
429
436
|
export const MyThread: FC = () => {
|
|
430
437
|
return (
|
|
@@ -522,19 +529,35 @@ const AssistantMessage: FC = () => {
|
|
|
522
529
|
groupBy={groupPartByType({
|
|
523
530
|
reasoning: ["group-chainOfThought", "group-reasoning"],
|
|
524
531
|
"tool-call": ["group-chainOfThought", "group-tool"],
|
|
532
|
+
"standalone-tool-call": [],
|
|
525
533
|
source: ["group-sources"],
|
|
526
534
|
})}
|
|
527
535
|
>
|
|
528
536
|
{({ part, children }) => {
|
|
529
537
|
switch (part.type) {
|
|
530
538
|
case "group-chainOfThought":
|
|
531
|
-
return <
|
|
532
|
-
case "group-reasoning":
|
|
533
|
-
return <PartLayout label="Thinking">{children}</PartLayout>;
|
|
539
|
+
return <div data-slot="aui_chain-of-thought">{children}</div>;
|
|
534
540
|
case "group-tool":
|
|
535
541
|
return (
|
|
536
|
-
<
|
|
542
|
+
<ToolGroupRoot variant="ghost">
|
|
543
|
+
<ToolGroupTrigger
|
|
544
|
+
count={part.indices.length}
|
|
545
|
+
active={part.status.type === "running"}
|
|
546
|
+
/>
|
|
547
|
+
<ToolGroupContent>{children}</ToolGroupContent>
|
|
548
|
+
</ToolGroupRoot>
|
|
549
|
+
);
|
|
550
|
+
case "group-reasoning": {
|
|
551
|
+
const running = part.status.type === "running";
|
|
552
|
+
return (
|
|
553
|
+
<ReasoningRoot streaming={running}>
|
|
554
|
+
<ReasoningTrigger active={running} />
|
|
555
|
+
<ReasoningContent aria-busy={running}>
|
|
556
|
+
<ReasoningText>{children}</ReasoningText>
|
|
557
|
+
</ReasoningContent>
|
|
558
|
+
</ReasoningRoot>
|
|
537
559
|
);
|
|
560
|
+
}
|
|
538
561
|
case "group-sources":
|
|
539
562
|
return <SourcesLayout>{children}</SourcesLayout>;
|
|
540
563
|
case "text":
|
|
@@ -542,7 +565,7 @@ const AssistantMessage: FC = () => {
|
|
|
542
565
|
case "reasoning":
|
|
543
566
|
return <Reasoning {...part} />;
|
|
544
567
|
case "tool-call":
|
|
545
|
-
return <
|
|
568
|
+
return part.toolUI ?? <ToolFallback {...part} />;
|
|
546
569
|
case "source":
|
|
547
570
|
return <Sources {...part} />;
|
|
548
571
|
default:
|
|
@@ -555,28 +578,6 @@ const AssistantMessage: FC = () => {
|
|
|
555
578
|
);
|
|
556
579
|
};
|
|
557
580
|
|
|
558
|
-
const ChainOfThoughtGroup: FC<PropsWithChildren> = ({ children }) => {
|
|
559
|
-
const [open, setOpen] = useState(false);
|
|
560
|
-
|
|
561
|
-
return (
|
|
562
|
-
<div className="my-2 rounded-lg border">
|
|
563
|
-
<button
|
|
564
|
-
type="button"
|
|
565
|
-
className="hover:bg-muted/50 flex w-full cursor-pointer items-center gap-2 px-4 py-2 text-sm font-medium"
|
|
566
|
-
onClick={() => setOpen((o) => !o)}
|
|
567
|
-
>
|
|
568
|
-
{open ? (
|
|
569
|
-
<ChevronDownIcon className="size-4 shrink-0" />
|
|
570
|
-
) : (
|
|
571
|
-
<ChevronRightIcon className="size-4 shrink-0" />
|
|
572
|
-
)}
|
|
573
|
-
Thinking
|
|
574
|
-
</button>
|
|
575
|
-
{open && children}
|
|
576
|
-
</div>
|
|
577
|
-
);
|
|
578
|
-
};
|
|
579
|
-
|
|
580
581
|
const SourcesLayout: FC<PropsWithChildren> = ({ children }) => {
|
|
581
582
|
return (
|
|
582
583
|
<div className="flex flex-wrap items-center gap-1.5">
|
|
@@ -586,56 +587,6 @@ const SourcesLayout: FC<PropsWithChildren> = ({ children }) => {
|
|
|
586
587
|
);
|
|
587
588
|
};
|
|
588
589
|
|
|
589
|
-
const PartLayout: FC<PropsWithChildren<{ label: string }>> = ({
|
|
590
|
-
children,
|
|
591
|
-
label,
|
|
592
|
-
}) => {
|
|
593
|
-
const [open, setOpen] = useState(true);
|
|
594
|
-
|
|
595
|
-
return (
|
|
596
|
-
<div className="border-t">
|
|
597
|
-
<button
|
|
598
|
-
type="button"
|
|
599
|
-
className="text-muted-foreground hover:bg-muted/50 flex w-full cursor-pointer items-center gap-2 px-4 py-1.5 text-xs"
|
|
600
|
-
onClick={() => setOpen((o) => !o)}
|
|
601
|
-
>
|
|
602
|
-
{open ? (
|
|
603
|
-
<ChevronDownIcon className="size-3" />
|
|
604
|
-
) : (
|
|
605
|
-
<ChevronRightIcon className="size-3" />
|
|
606
|
-
)}
|
|
607
|
-
{label}
|
|
608
|
-
</button>
|
|
609
|
-
{open && children}
|
|
610
|
-
</div>
|
|
611
|
-
);
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
const Reasoning: FC<{ text: string }> = ({ text }) => {
|
|
615
|
-
return (
|
|
616
|
-
<p className="text-muted-foreground px-4 py-2 text-sm whitespace-pre-wrap italic">
|
|
617
|
-
{text}
|
|
618
|
-
</p>
|
|
619
|
-
);
|
|
620
|
-
};
|
|
621
|
-
|
|
622
|
-
const ToolCall: FC<{ toolName: string; status: { type: string } }> = ({
|
|
623
|
-
toolName,
|
|
624
|
-
status,
|
|
625
|
-
}) => {
|
|
626
|
-
return (
|
|
627
|
-
<div className="px-4 py-2 text-sm">
|
|
628
|
-
{status.type === "running"
|
|
629
|
-
? `Running ${toolName}...`
|
|
630
|
-
: status.type === "complete"
|
|
631
|
-
? `${toolName} completed`
|
|
632
|
-
: status.type === "incomplete"
|
|
633
|
-
? `${toolName} failed`
|
|
634
|
-
: `${toolName} requires action`}
|
|
635
|
-
</div>
|
|
636
|
-
);
|
|
637
|
-
};
|
|
638
|
-
|
|
639
590
|
const Composer: FC = () => {
|
|
640
591
|
const isRunning = useThread((state) => state.isRunning);
|
|
641
592
|
|
|
@@ -849,15 +800,15 @@ export default withAui(nextConfig);
|
|
|
849
800
|
"start": "next start"
|
|
850
801
|
},
|
|
851
802
|
"dependencies": {
|
|
852
|
-
"@ai-sdk/openai": "^3.0.
|
|
803
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
853
804
|
"@assistant-ui/react": "workspace:*",
|
|
854
805
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
855
806
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
856
807
|
"@assistant-ui/ui": "workspace:*",
|
|
857
|
-
"ai": "^6.0.
|
|
808
|
+
"ai": "^6.0.208",
|
|
858
809
|
"class-variance-authority": "^0.7.1",
|
|
859
810
|
"clsx": "^2.1.1",
|
|
860
|
-
"lucide-react": "^1.
|
|
811
|
+
"lucide-react": "^1.21.0",
|
|
861
812
|
"next": "^16.2.9",
|
|
862
813
|
"react": "^19.2.7",
|
|
863
814
|
"react-dom": "^19.2.7",
|
|
@@ -868,7 +819,7 @@ export default withAui(nextConfig);
|
|
|
868
819
|
"@assistant-ui/next": "workspace:*",
|
|
869
820
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
870
821
|
"@tailwindcss/postcss": "^4.3.1",
|
|
871
|
-
"@types/node": "^
|
|
822
|
+
"@types/node": "^26.0.0",
|
|
872
823
|
"@types/react": "^19.2.17",
|
|
873
824
|
"@types/react-dom": "^19.2.3",
|
|
874
825
|
"postcss": "^8.5.15",
|
|
@@ -568,12 +568,12 @@ export default withAui(nextConfig);
|
|
|
568
568
|
"start": "next start"
|
|
569
569
|
},
|
|
570
570
|
"dependencies": {
|
|
571
|
-
"@ai-sdk/openai": "^3.0.
|
|
571
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
572
572
|
"@assistant-ui/cloud-ai-sdk": "workspace:*",
|
|
573
|
-
"ai": "^6.0.
|
|
573
|
+
"ai": "^6.0.208",
|
|
574
574
|
"class-variance-authority": "^0.7.1",
|
|
575
575
|
"clsx": "^2.1.1",
|
|
576
|
-
"lucide-react": "^1.
|
|
576
|
+
"lucide-react": "^1.21.0",
|
|
577
577
|
"next": "^16.2.9",
|
|
578
578
|
"react": "^19.2.7",
|
|
579
579
|
"react-dom": "^19.2.7",
|
|
@@ -583,7 +583,7 @@ export default withAui(nextConfig);
|
|
|
583
583
|
"@assistant-ui/next": "workspace:*",
|
|
584
584
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
585
585
|
"@tailwindcss/postcss": "^4.3.1",
|
|
586
|
-
"@types/node": "^
|
|
586
|
+
"@types/node": "^26.0.0",
|
|
587
587
|
"@types/react": "^19.2.17",
|
|
588
588
|
"@types/react-dom": "^19.2.3",
|
|
589
589
|
"postcss": "^8.5.15",
|
|
@@ -328,15 +328,15 @@ export default withAui(nextConfig);
|
|
|
328
328
|
"start": "next start"
|
|
329
329
|
},
|
|
330
330
|
"dependencies": {
|
|
331
|
-
"@ai-sdk/openai": "^3.0.
|
|
331
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
332
332
|
"@assistant-ui/react": "workspace:*",
|
|
333
333
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
334
334
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
335
335
|
"@assistant-ui/ui": "workspace:*",
|
|
336
|
-
"ai": "^6.0.
|
|
336
|
+
"ai": "^6.0.208",
|
|
337
337
|
"class-variance-authority": "^0.7.1",
|
|
338
338
|
"clsx": "^2.1.1",
|
|
339
|
-
"lucide-react": "^1.
|
|
339
|
+
"lucide-react": "^1.21.0",
|
|
340
340
|
"next": "^16.2.9",
|
|
341
341
|
"react": "^19.2.7",
|
|
342
342
|
"react-dom": "^19.2.7",
|
|
@@ -346,7 +346,7 @@ export default withAui(nextConfig);
|
|
|
346
346
|
"@assistant-ui/next": "workspace:*",
|
|
347
347
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
348
348
|
"@tailwindcss/postcss": "^4.3.1",
|
|
349
|
-
"@types/node": "^
|
|
349
|
+
"@types/node": "^26.0.0",
|
|
350
350
|
"@types/react": "^19.2.17",
|
|
351
351
|
"@types/react-dom": "^19.2.3",
|
|
352
352
|
"postcss": "^8.5.15",
|
|
@@ -460,16 +460,16 @@ export default withAui(nextConfig);
|
|
|
460
460
|
"start": "next start"
|
|
461
461
|
},
|
|
462
462
|
"dependencies": {
|
|
463
|
-
"@ai-sdk/openai": "^3.0.
|
|
463
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
464
464
|
"@assistant-ui/react": "workspace:*",
|
|
465
465
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
466
466
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
467
467
|
"@assistant-ui/ui": "workspace:*",
|
|
468
|
-
"ai": "^6.0.
|
|
468
|
+
"ai": "^6.0.208",
|
|
469
469
|
"assistant-stream": "workspace:*",
|
|
470
470
|
"class-variance-authority": "^0.7.1",
|
|
471
471
|
"clsx": "^2.1.1",
|
|
472
|
-
"lucide-react": "^1.
|
|
472
|
+
"lucide-react": "^1.21.0",
|
|
473
473
|
"next": "^16.2.9",
|
|
474
474
|
"react": "^19.2.7",
|
|
475
475
|
"react-dom": "^19.2.7",
|
|
@@ -480,7 +480,7 @@ export default withAui(nextConfig);
|
|
|
480
480
|
"@assistant-ui/next": "workspace:*",
|
|
481
481
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
482
482
|
"@tailwindcss/postcss": "^4.3.1",
|
|
483
|
-
"@types/node": "^
|
|
483
|
+
"@types/node": "^26.0.0",
|
|
484
484
|
"@types/react": "^19.2.17",
|
|
485
485
|
"@types/react-dom": "^19.2.3",
|
|
486
486
|
"postcss": "^8.5.15",
|
|
@@ -439,18 +439,18 @@ export default withAui(nextConfig);
|
|
|
439
439
|
"version": "0.0.0",
|
|
440
440
|
"type": "module",
|
|
441
441
|
"dependencies": {
|
|
442
|
-
"@ai-sdk/openai": "^3.0.
|
|
443
|
-
"@ai-sdk/react": "^3.0.
|
|
442
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
443
|
+
"@ai-sdk/react": "^3.0.210",
|
|
444
444
|
"@assistant-ui/react": "workspace:^",
|
|
445
445
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
446
446
|
"@assistant-ui/react-markdown": "workspace:^",
|
|
447
447
|
"@assistant-ui/ui": "workspace:*",
|
|
448
|
-
"@elevenlabs/client": "^1.
|
|
448
|
+
"@elevenlabs/client": "^1.12.0",
|
|
449
449
|
"@tailwindcss/postcss": "^4.3.1",
|
|
450
|
-
"ai": "^6.0.
|
|
450
|
+
"ai": "^6.0.208",
|
|
451
451
|
"class-variance-authority": "^0.7.1",
|
|
452
452
|
"clsx": "^2.1.1",
|
|
453
|
-
"lucide-react": "^1.
|
|
453
|
+
"lucide-react": "^1.21.0",
|
|
454
454
|
"motion": "^12.40.0",
|
|
455
455
|
"next": "^16.2.9",
|
|
456
456
|
"postcss": "^8.5.15",
|
|
@@ -463,7 +463,7 @@ export default withAui(nextConfig);
|
|
|
463
463
|
"devDependencies": {
|
|
464
464
|
"@assistant-ui/next": "workspace:*",
|
|
465
465
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
466
|
-
"@types/node": "^
|
|
466
|
+
"@types/node": "^26.0.0",
|
|
467
467
|
"@types/react": "^19.2.17",
|
|
468
468
|
"@types/react-dom": "^19.2.3",
|
|
469
469
|
"tw-animate-css": "^1.4.0",
|
|
@@ -562,18 +562,18 @@ export default withAui(nextConfig);
|
|
|
562
562
|
"version": "0.0.0",
|
|
563
563
|
"type": "module",
|
|
564
564
|
"dependencies": {
|
|
565
|
-
"@ai-sdk/openai": "^3.0.
|
|
566
|
-
"@ai-sdk/react": "^3.0.
|
|
565
|
+
"@ai-sdk/openai": "^3.0.73",
|
|
566
|
+
"@ai-sdk/react": "^3.0.210",
|
|
567
567
|
"@assistant-ui/react": "workspace:^",
|
|
568
568
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
569
569
|
"@assistant-ui/react-markdown": "workspace:^",
|
|
570
570
|
"@assistant-ui/ui": "workspace:*",
|
|
571
|
-
"@elevenlabs/client": "^1.
|
|
571
|
+
"@elevenlabs/client": "^1.12.0",
|
|
572
572
|
"@tailwindcss/postcss": "^4.3.1",
|
|
573
|
-
"ai": "^6.0.
|
|
573
|
+
"ai": "^6.0.208",
|
|
574
574
|
"class-variance-authority": "^0.7.1",
|
|
575
575
|
"clsx": "^2.1.1",
|
|
576
|
-
"lucide-react": "^1.
|
|
576
|
+
"lucide-react": "^1.21.0",
|
|
577
577
|
"motion": "^12.40.0",
|
|
578
578
|
"next": "^16.2.9",
|
|
579
579
|
"postcss": "^8.5.15",
|
|
@@ -586,7 +586,7 @@ export default withAui(nextConfig);
|
|
|
586
586
|
"devDependencies": {
|
|
587
587
|
"@assistant-ui/next": "workspace:*",
|
|
588
588
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
589
|
-
"@types/node": "^
|
|
589
|
+
"@types/node": "^26.0.0",
|
|
590
590
|
"@types/react": "^19.2.17",
|
|
591
591
|
"@types/react-dom": "^19.2.3",
|
|
592
592
|
"tw-animate-css": "^1.4.0",
|