@assistant-ui/mcp-docs-server 0.1.34 → 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 +4 -4
- package/.docs/organized/code-examples/with-a2a.md +5 -5
- package/.docs/organized/code-examples/with-ag-ui.md +6 -6
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +7 -7
- package/.docs/organized/code-examples/with-artifacts.md +7 -7
- package/.docs/organized/code-examples/with-assistant-transport.md +73 -57
- package/.docs/organized/code-examples/with-browser-extension.md +7 -7
- package/.docs/organized/code-examples/with-chain-of-thought.md +44 -93
- package/.docs/organized/code-examples/with-cloud-standalone.md +7 -7
- package/.docs/organized/code-examples/with-cloud.md +7 -7
- package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-conversational.md +9 -9
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +9 -9
- package/.docs/organized/code-examples/with-eve.md +343 -0
- package/.docs/organized/code-examples/with-expo.md +943 -940
- package/.docs/organized/code-examples/with-external-store.md +5 -5
- package/.docs/organized/code-examples/with-ffmpeg.md +8 -11
- package/.docs/organized/code-examples/with-generative-ui.md +33 -309
- package/.docs/organized/code-examples/with-google-adk.md +5 -5
- package/.docs/organized/code-examples/with-heat-graph.md +4 -4
- package/.docs/organized/code-examples/with-image-generation.md +7 -7
- package/.docs/organized/code-examples/with-interactables.md +169 -341
- package/.docs/organized/code-examples/with-langchain.md +7 -7
- package/.docs/organized/code-examples/with-langgraph.md +23 -160
- package/.docs/organized/code-examples/with-livekit.md +10 -10
- package/.docs/organized/code-examples/with-mcp.md +7 -7
- package/.docs/organized/code-examples/with-opencode.md +106 -580
- package/.docs/organized/code-examples/with-pi.md +2046 -0
- package/.docs/organized/code-examples/with-react-hook-form.md +16 -9
- package/.docs/organized/code-examples/with-react-ink-web.md +691 -0
- package/.docs/organized/code-examples/with-react-ink.md +29 -17
- package/.docs/organized/code-examples/with-react-router.md +12 -12
- package/.docs/organized/code-examples/with-resumable-stream.md +8 -8
- package/.docs/organized/code-examples/with-store.md +14 -10
- package/.docs/organized/code-examples/with-tanstack.md +21 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +5 -5
- package/.docs/organized/code-examples/with-virtualized-thread.md +676 -0
- package/.docs/raw/docs/(docs)/architecture.mdx +13 -12
- 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 -123
- 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/model-context/context.mdx +1 -1
- 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 +17 -38
- package/.docs/raw/docs/(reference)/api-reference/tools/status.mdx +22 -0
- package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +20 -27
- package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +40 -25
- package/.docs/raw/docs/guides/chain-of-thought.mdx +1 -1
- package/.docs/raw/docs/guides/headless-composer-input.mdx +113 -0
- package/.docs/raw/docs/guides/index.mdx +3 -0
- package/.docs/raw/docs/guides/input-history.mdx +55 -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 +133 -0
- package/.docs/raw/docs/guides/voice.mdx +3 -2
- package/.docs/raw/docs/ink/hooks.mdx +2 -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/react-native/hooks.mdx +1 -1
- package/.docs/raw/docs/runtimes/ag-ui/runtime-options.mdx +22 -3
- package/.docs/raw/docs/runtimes/concepts/stability.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/data-stream.mdx +1 -1
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +54 -0
- package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +108 -4
- 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 +12 -6
- 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/tools/tool-ui.mdx +37 -1
- package/.docs/raw/docs/ui/composer-trigger-popover.mdx +2 -0
- package/.docs/raw/docs/ui/dot-matrix.mdx +133 -0
- package/.docs/raw/docs/ui/file.mdx +1 -1
- package/.docs/raw/docs/ui/model-selector.mdx +219 -52
- package/.docs/raw/docs/ui/number-roll.mdx +154 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +38 -0
- package/.docs/raw/docs/ui/reasoning.mdx +3 -3
- package/.docs/raw/docs/ui/streamdown.mdx +2 -0
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +1 -1
- package/.docs/raw/docs/ui/thread.mdx +52 -0
- package/.docs/raw/docs/ui/tool-fallback.mdx +2 -2
- 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
|
@@ -774,19 +774,19 @@ export default withAui(nextConfig);
|
|
|
774
774
|
"@assistant-ui/react-o11y": "workspace:*",
|
|
775
775
|
"@assistant-ui/store": "workspace:*",
|
|
776
776
|
"@assistant-ui/tap": "workspace:*",
|
|
777
|
-
"next": "^16.2.
|
|
777
|
+
"next": "^16.2.9",
|
|
778
778
|
"react": "^19.2.7",
|
|
779
779
|
"react-dom": "^19.2.7"
|
|
780
780
|
},
|
|
781
781
|
"devDependencies": {
|
|
782
782
|
"@assistant-ui/next": "workspace:*",
|
|
783
783
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
784
|
-
"@tailwindcss/postcss": "^4.3.
|
|
785
|
-
"@types/node": "^
|
|
784
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
789
|
-
"tailwindcss": "^4.3.
|
|
789
|
+
"tailwindcss": "^4.3.1",
|
|
790
790
|
"typescript": "^6.0.3"
|
|
791
791
|
}
|
|
792
792
|
}
|
|
@@ -555,8 +555,8 @@ 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.
|
|
559
|
-
"next": "^16.2.
|
|
558
|
+
"lucide-react": "^1.21.0",
|
|
559
|
+
"next": "^16.2.9",
|
|
560
560
|
"react": "^19.2.7",
|
|
561
561
|
"react-dom": "^19.2.7",
|
|
562
562
|
"tailwind-merge": "^3.6.0"
|
|
@@ -564,12 +564,12 @@ export default withAui(nextConfig);
|
|
|
564
564
|
"devDependencies": {
|
|
565
565
|
"@assistant-ui/next": "workspace:*",
|
|
566
566
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
567
|
-
"@tailwindcss/postcss": "^4.3.
|
|
568
|
-
"@types/node": "^
|
|
567
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
572
|
-
"tailwindcss": "^4.3.
|
|
572
|
+
"tailwindcss": "^4.3.1",
|
|
573
573
|
"tw-animate-css": "^1.4.0",
|
|
574
574
|
"typescript": "^6.0.3"
|
|
575
575
|
}
|
|
@@ -420,15 +420,15 @@ export default withAui(nextConfig);
|
|
|
420
420
|
"start": "next start"
|
|
421
421
|
},
|
|
422
422
|
"dependencies": {
|
|
423
|
-
"@ag-ui/client": "^0.0.
|
|
423
|
+
"@ag-ui/client": "^0.0.57",
|
|
424
424
|
"@assistant-ui/react": "workspace:*",
|
|
425
425
|
"@assistant-ui/react-ag-ui": "workspace:*",
|
|
426
426
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
427
427
|
"@assistant-ui/ui": "workspace:*",
|
|
428
428
|
"class-variance-authority": "^0.7.1",
|
|
429
429
|
"clsx": "^2.1.1",
|
|
430
|
-
"lucide-react": "^1.
|
|
431
|
-
"next": "^16.2.
|
|
430
|
+
"lucide-react": "^1.21.0",
|
|
431
|
+
"next": "^16.2.9",
|
|
432
432
|
"react": "^19.2.7",
|
|
433
433
|
"react-dom": "^19.2.7",
|
|
434
434
|
"tailwind-merge": "^3.6.0"
|
|
@@ -436,12 +436,12 @@ export default withAui(nextConfig);
|
|
|
436
436
|
"devDependencies": {
|
|
437
437
|
"@assistant-ui/next": "workspace:*",
|
|
438
438
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
439
|
-
"@tailwindcss/postcss": "^4.3.
|
|
440
|
-
"@types/node": "^
|
|
439
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
444
|
-
"tailwindcss": "^4.3.
|
|
444
|
+
"tailwindcss": "^4.3.1",
|
|
445
445
|
"tw-animate-css": "^1.4.0",
|
|
446
446
|
"typescript": "^6.0.3"
|
|
447
447
|
}
|
|
@@ -316,16 +316,16 @@ 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.
|
|
328
|
-
"next": "^16.2.
|
|
327
|
+
"lucide-react": "^1.21.0",
|
|
328
|
+
"next": "^16.2.9",
|
|
329
329
|
"react": "^19.2.7",
|
|
330
330
|
"react-dom": "^19.2.7",
|
|
331
331
|
"tailwind-merge": "^3.6.0",
|
|
@@ -334,12 +334,12 @@ export default withAui(nextConfig);
|
|
|
334
334
|
"devDependencies": {
|
|
335
335
|
"@assistant-ui/next": "workspace:*",
|
|
336
336
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
337
|
-
"@tailwindcss/postcss": "^4.3.
|
|
338
|
-
"@types/node": "^
|
|
337
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
342
|
-
"tailwindcss": "^4.3.
|
|
342
|
+
"tailwindcss": "^4.3.1",
|
|
343
343
|
"tw-animate-css": "^1.4.0",
|
|
344
344
|
"typescript": "^6.0.3"
|
|
345
345
|
}
|
|
@@ -426,16 +426,16 @@ 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.
|
|
438
|
-
"next": "^16.2.
|
|
437
|
+
"lucide-react": "^1.21.0",
|
|
438
|
+
"next": "^16.2.9",
|
|
439
439
|
"react": "^19.2.7",
|
|
440
440
|
"react-dom": "^19.2.7",
|
|
441
441
|
"tailwind-merge": "^3.6.0",
|
|
@@ -444,12 +444,12 @@ export default withAui(nextConfig);
|
|
|
444
444
|
"devDependencies": {
|
|
445
445
|
"@assistant-ui/next": "workspace:*",
|
|
446
446
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
447
|
-
"@tailwindcss/postcss": "^4.3.
|
|
448
|
-
"@types/node": "^
|
|
447
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
452
|
-
"tailwindcss": "^4.3.
|
|
452
|
+
"tailwindcss": "^4.3.1",
|
|
453
453
|
"tw-animate-css": "^1.4.0",
|
|
454
454
|
"typescript": "^6.0.3"
|
|
455
455
|
}
|
|
@@ -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,8 +449,8 @@ 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.
|
|
437
|
-
"next": "^16.2.
|
|
452
|
+
"lucide-react": "^1.21.0",
|
|
453
|
+
"next": "^16.2.9",
|
|
438
454
|
"react": "^19.2.7",
|
|
439
455
|
"react-dom": "^19.2.7",
|
|
440
456
|
"tailwind-merge": "^3.6.0",
|
|
@@ -443,12 +459,12 @@ export default withAui(nextConfig);
|
|
|
443
459
|
"devDependencies": {
|
|
444
460
|
"@assistant-ui/next": "workspace:*",
|
|
445
461
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
446
|
-
"@tailwindcss/postcss": "^4.3.
|
|
447
|
-
"@types/node": "^
|
|
462
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
451
|
-
"tailwindcss": "^4.3.
|
|
467
|
+
"tailwindcss": "^4.3.1",
|
|
452
468
|
"tw-animate-css": "^1.4.0",
|
|
453
469
|
"typescript": "^6.0.3"
|
|
454
470
|
}
|
|
@@ -229,23 +229,23 @@ 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
|
-
"@tailwindcss/postcss": "^4.3.
|
|
239
|
-
"@types/chrome": "^0.
|
|
240
|
-
"@types/node": "^
|
|
238
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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
|
-
"esbuild": "^0.28.
|
|
243
|
+
"esbuild": "^0.28.1",
|
|
244
244
|
"postcss": "^8.5.15",
|
|
245
|
-
"tailwindcss": "^4.3.
|
|
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,61 +587,11 @@ 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
|
|
|
642
593
|
return (
|
|
643
|
-
<ComposerPrimitive.Root className="border-input bg-background has-[textarea:focus-visible]:border-
|
|
594
|
+
<ComposerPrimitive.Root className="border-input bg-background has-[textarea:focus-visible]:border-foreground/60 flex w-full flex-col rounded-2xl border px-1 pt-2 transition-colors outline-none">
|
|
644
595
|
<ComposerPrimitive.Input
|
|
645
596
|
placeholder="Send a message..."
|
|
646
597
|
className="placeholder:text-muted-foreground mb-1 max-h-32 min-h-14 w-full resize-none bg-transparent px-4 pt-2 pb-3 text-sm outline-none"
|
|
@@ -849,16 +800,16 @@ 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.
|
|
861
|
-
"next": "^16.2.
|
|
811
|
+
"lucide-react": "^1.21.0",
|
|
812
|
+
"next": "^16.2.9",
|
|
862
813
|
"react": "^19.2.7",
|
|
863
814
|
"react-dom": "^19.2.7",
|
|
864
815
|
"tailwind-merge": "^3.6.0",
|
|
@@ -867,12 +818,12 @@ export default withAui(nextConfig);
|
|
|
867
818
|
"devDependencies": {
|
|
868
819
|
"@assistant-ui/next": "workspace:*",
|
|
869
820
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
870
|
-
"@tailwindcss/postcss": "^4.3.
|
|
871
|
-
"@types/node": "^
|
|
821
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
875
|
-
"tailwindcss": "^4.3.
|
|
826
|
+
"tailwindcss": "^4.3.1",
|
|
876
827
|
"tw-animate-css": "^1.4.0",
|
|
877
828
|
"typescript": "^6.0.3"
|
|
878
829
|
}
|
|
@@ -568,13 +568,13 @@ 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.
|
|
577
|
-
"next": "^16.2.
|
|
576
|
+
"lucide-react": "^1.21.0",
|
|
577
|
+
"next": "^16.2.9",
|
|
578
578
|
"react": "^19.2.7",
|
|
579
579
|
"react-dom": "^19.2.7",
|
|
580
580
|
"tailwind-merge": "^3.6.0"
|
|
@@ -582,12 +582,12 @@ export default withAui(nextConfig);
|
|
|
582
582
|
"devDependencies": {
|
|
583
583
|
"@assistant-ui/next": "workspace:*",
|
|
584
584
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
585
|
-
"@tailwindcss/postcss": "^4.3.
|
|
586
|
-
"@types/node": "^
|
|
585
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
590
|
-
"tailwindcss": "^4.3.
|
|
590
|
+
"tailwindcss": "^4.3.1",
|
|
591
591
|
"tw-animate-css": "^1.4.0",
|
|
592
592
|
"typescript": "^6.0.3"
|
|
593
593
|
}
|
|
@@ -328,16 +328,16 @@ 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.
|
|
340
|
-
"next": "^16.2.
|
|
339
|
+
"lucide-react": "^1.21.0",
|
|
340
|
+
"next": "^16.2.9",
|
|
341
341
|
"react": "^19.2.7",
|
|
342
342
|
"react-dom": "^19.2.7",
|
|
343
343
|
"tailwind-merge": "^3.6.0"
|
|
@@ -345,12 +345,12 @@ export default withAui(nextConfig);
|
|
|
345
345
|
"devDependencies": {
|
|
346
346
|
"@assistant-ui/next": "workspace:*",
|
|
347
347
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
348
|
-
"@tailwindcss/postcss": "^4.3.
|
|
349
|
-
"@types/node": "^
|
|
348
|
+
"@tailwindcss/postcss": "^4.3.1",
|
|
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",
|
|
353
|
-
"tailwindcss": "^4.3.
|
|
353
|
+
"tailwindcss": "^4.3.1",
|
|
354
354
|
"tw-animate-css": "^1.4.0",
|
|
355
355
|
"typescript": "^6.0.3"
|
|
356
356
|
}
|