@assistant-ui/mcp-docs-server 0.1.22 → 0.1.24
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 +801 -0
- package/.docs/organized/code-examples/with-ag-ui.md +39 -27
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +39 -29
- package/.docs/organized/code-examples/with-artifacts.md +467 -0
- package/.docs/organized/code-examples/with-assistant-transport.md +32 -25
- package/.docs/organized/code-examples/with-chain-of-thought.md +42 -33
- package/.docs/organized/code-examples/with-cloud-standalone.md +674 -0
- package/.docs/organized/code-examples/with-cloud.md +35 -28
- package/.docs/organized/code-examples/with-custom-thread-list.md +35 -28
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +42 -31
- package/.docs/organized/code-examples/with-expo.md +2012 -0
- package/.docs/organized/code-examples/with-external-store.md +32 -26
- package/.docs/organized/code-examples/with-ffmpeg.md +32 -28
- package/.docs/organized/code-examples/with-langgraph.md +97 -39
- package/.docs/organized/code-examples/with-parent-id-grouping.md +33 -26
- package/.docs/organized/code-examples/with-react-hook-form.md +63 -61
- package/.docs/organized/code-examples/with-react-router.md +38 -31
- package/.docs/organized/code-examples/with-store.md +17 -25
- package/.docs/organized/code-examples/with-tanstack.md +36 -26
- package/.docs/organized/code-examples/with-tap-runtime.md +11 -25
- package/.docs/raw/docs/(docs)/cli.mdx +13 -6
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +26 -3
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +53 -52
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +0 -2
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +169 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +327 -0
- package/.docs/raw/docs/(docs)/guides/speech.mdx +0 -1
- package/.docs/raw/docs/(docs)/index.mdx +12 -2
- package/.docs/raw/docs/(docs)/installation.mdx +8 -2
- package/.docs/raw/docs/(docs)/llm.mdx +9 -7
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar-more.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +2 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-if.mdx +27 -27
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +60 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +78 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +32 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/selection-toolbar.mdx +61 -0
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +1 -1
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +1 -6
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +2 -2
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +1 -6
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +1 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +17 -17
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +209 -0
- package/.docs/raw/docs/cloud/ai-sdk.mdx +296 -0
- package/.docs/raw/docs/cloud/authorization.mdx +178 -79
- package/.docs/raw/docs/cloud/{persistence/langgraph.mdx → langgraph.mdx} +2 -2
- package/.docs/raw/docs/cloud/overview.mdx +29 -39
- package/.docs/raw/docs/react-native/adapters.mdx +118 -0
- package/.docs/raw/docs/react-native/custom-backend.mdx +210 -0
- package/.docs/raw/docs/react-native/hooks.mdx +364 -0
- package/.docs/raw/docs/react-native/index.mdx +332 -0
- package/.docs/raw/docs/react-native/primitives.mdx +653 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +60 -15
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +103 -0
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +25 -2
- package/.docs/raw/docs/runtimes/data-stream.mdx +1 -3
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +113 -9
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +1 -4
- package/.docs/raw/docs/ui/attachment.mdx +4 -2
- package/.docs/raw/docs/ui/context-display.mdx +147 -0
- package/.docs/raw/docs/ui/message-timing.mdx +92 -0
- package/.docs/raw/docs/ui/part-grouping.mdx +1 -1
- package/.docs/raw/docs/ui/reasoning.mdx +4 -4
- package/.docs/raw/docs/ui/scrollbar.mdx +2 -2
- package/.docs/raw/docs/ui/syntax-highlighting.mdx +55 -50
- package/.docs/raw/docs/ui/thread.mdx +16 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/tools/tests/integration.test.ts +2 -2
- package/src/tools/tests/json-parsing.test.ts +1 -1
- package/src/tools/tests/mcp-protocol.test.ts +1 -3
- package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +0 -108
|
@@ -214,7 +214,12 @@ import { SignupForm } from "@/components/SignupForm";
|
|
|
214
214
|
import { AssistantSidebar } from "@/components/assistant-ui/assistant-sidebar";
|
|
215
215
|
import { Form } from "@/components/ui/form";
|
|
216
216
|
import { useAssistantForm } from "@assistant-ui/react-hook-form";
|
|
217
|
-
import {
|
|
217
|
+
import {
|
|
218
|
+
useAssistantInstructions,
|
|
219
|
+
useAui,
|
|
220
|
+
AuiProvider,
|
|
221
|
+
Suggestions,
|
|
222
|
+
} from "@assistant-ui/react";
|
|
218
223
|
import Link from "next/link";
|
|
219
224
|
|
|
220
225
|
const SetFormFieldTool = () => {
|
|
@@ -256,35 +261,53 @@ export default function Home() {
|
|
|
256
261
|
},
|
|
257
262
|
});
|
|
258
263
|
|
|
264
|
+
const aui = useAui({
|
|
265
|
+
suggestions: Suggestions([
|
|
266
|
+
{
|
|
267
|
+
title: "Fill out the form",
|
|
268
|
+
label: "with sample data",
|
|
269
|
+
prompt: "Please fill out the signup form with sample data for me.",
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
title: "Help me register",
|
|
273
|
+
label: "for the hackathon",
|
|
274
|
+
prompt:
|
|
275
|
+
"I'd like to sign up for the hackathon. My name is Jane Doe and my email is jane@example.com.",
|
|
276
|
+
},
|
|
277
|
+
]),
|
|
278
|
+
});
|
|
279
|
+
|
|
259
280
|
return (
|
|
260
|
-
<
|
|
261
|
-
<
|
|
262
|
-
<
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
<
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
281
|
+
<AuiProvider value={aui}>
|
|
282
|
+
<AssistantSidebar>
|
|
283
|
+
<div className="h-full overflow-y-scroll">
|
|
284
|
+
<main className="container py-8">
|
|
285
|
+
<h1 className="mb-2 font-semibold text-2xl">
|
|
286
|
+
Simon's Hackathon
|
|
287
|
+
</h1>
|
|
288
|
+
<p>
|
|
289
|
+
I'm hosting a Hackathon on AI UX. Be the first to get an
|
|
290
|
+
invite!
|
|
291
|
+
</p>
|
|
292
|
+
|
|
293
|
+
<div className="my-4 font-bold">
|
|
294
|
+
Built with{" "}
|
|
295
|
+
<Link
|
|
296
|
+
href="https://github.com/assistant-ui/assistant-ui"
|
|
297
|
+
className="text-blue-600 underline"
|
|
298
|
+
>
|
|
299
|
+
assistant-ui
|
|
300
|
+
</Link>
|
|
301
|
+
.
|
|
302
|
+
</div>
|
|
303
|
+
|
|
304
|
+
<Form {...form}>
|
|
305
|
+
<SignupForm />
|
|
306
|
+
</Form>
|
|
307
|
+
</main>
|
|
308
|
+
</div>
|
|
309
|
+
</AssistantSidebar>
|
|
310
|
+
</AuiProvider>
|
|
288
311
|
);
|
|
289
312
|
}
|
|
290
313
|
|
|
@@ -487,18 +510,6 @@ export const submitSignup = async (data: object) => {
|
|
|
487
510
|
|
|
488
511
|
```
|
|
489
512
|
|
|
490
|
-
## lib/utils.ts
|
|
491
|
-
|
|
492
|
-
```typescript
|
|
493
|
-
import { type ClassValue, clsx } from "clsx";
|
|
494
|
-
import { twMerge } from "tailwind-merge";
|
|
495
|
-
|
|
496
|
-
export function cn(...inputs: ClassValue[]) {
|
|
497
|
-
return twMerge(clsx(inputs));
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
```
|
|
501
|
-
|
|
502
513
|
## next.config.ts
|
|
503
514
|
|
|
504
515
|
```typescript
|
|
@@ -526,40 +537,30 @@ export default nextConfig;
|
|
|
526
537
|
"start": "next start"
|
|
527
538
|
},
|
|
528
539
|
"dependencies": {
|
|
529
|
-
"@ai-sdk/openai": "^3.0.
|
|
540
|
+
"@ai-sdk/openai": "^3.0.39",
|
|
530
541
|
"@assistant-ui/react": "workspace:*",
|
|
531
542
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
532
543
|
"@assistant-ui/react-hook-form": "workspace:*",
|
|
533
544
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
534
545
|
"@assistant-ui/ui": "workspace:*",
|
|
535
|
-
"
|
|
536
|
-
"@radix-ui/react-avatar": "^1.1.11",
|
|
537
|
-
"@radix-ui/react-collapsible": "^1.1.12",
|
|
538
|
-
"@radix-ui/react-dialog": "^1.1.15",
|
|
539
|
-
"@radix-ui/react-label": "^2.1.8",
|
|
540
|
-
"@radix-ui/react-slot": "^1.2.4",
|
|
541
|
-
"@radix-ui/react-tabs": "^1.1.13",
|
|
542
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
543
|
-
"ai": "^6.0.73",
|
|
546
|
+
"ai": "^6.0.111",
|
|
544
547
|
"class-variance-authority": "^0.7.1",
|
|
545
548
|
"clsx": "^2.1.1",
|
|
546
|
-
"lucide-react": "^0.
|
|
549
|
+
"lucide-react": "^0.576.0",
|
|
547
550
|
"next": "^16.1.6",
|
|
548
551
|
"react": "^19.2.4",
|
|
549
552
|
"react-dom": "^19.2.4",
|
|
550
|
-
"react-hook-form": "^7.71.
|
|
551
|
-
"
|
|
552
|
-
"tailwind-merge": "^3.4.0",
|
|
553
|
-
"zod": "^4.3.6"
|
|
553
|
+
"react-hook-form": "^7.71.2",
|
|
554
|
+
"tailwind-merge": "^3.5.0"
|
|
554
555
|
},
|
|
555
556
|
"devDependencies": {
|
|
556
557
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
557
|
-
"@tailwindcss/postcss": "^4.1
|
|
558
|
-
"@types/node": "^25.
|
|
559
|
-
"@types/react": "^19.2.
|
|
558
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
559
|
+
"@types/node": "^25.3.3",
|
|
560
|
+
"@types/react": "^19.2.14",
|
|
560
561
|
"@types/react-dom": "^19.2.3",
|
|
561
|
-
"postcss": "^8.5.
|
|
562
|
-
"tailwindcss": "^4.1
|
|
562
|
+
"postcss": "^8.5.8",
|
|
563
|
+
"tailwindcss": "^4.2.1",
|
|
563
564
|
"tw-animate-css": "^1.4.0",
|
|
564
565
|
"typescript": "^5.9.3"
|
|
565
566
|
}
|
|
@@ -624,6 +625,7 @@ npm run dev
|
|
|
624
625
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
625
626
|
],
|
|
626
627
|
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
628
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
627
629
|
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
628
630
|
}
|
|
629
631
|
},
|
|
@@ -142,18 +142,6 @@ body {
|
|
|
142
142
|
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
## app/lib/utils.ts
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
import { clsx, type ClassValue } from "clsx";
|
|
149
|
-
import { twMerge } from "tailwind-merge";
|
|
150
|
-
|
|
151
|
-
export function cn(...inputs: ClassValue[]) {
|
|
152
|
-
return twMerge(clsx(inputs));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
```
|
|
156
|
-
|
|
157
145
|
## app/MyRuntimeProvider.tsx
|
|
158
146
|
|
|
159
147
|
```tsx
|
|
@@ -697,6 +685,7 @@ export async function action({ request }: Route.ActionArgs) {
|
|
|
697
685
|
|
|
698
686
|
```tsx
|
|
699
687
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
688
|
+
import { useAui, AuiProvider, Suggestions } from "@assistant-ui/react";
|
|
700
689
|
|
|
701
690
|
export function meta() {
|
|
702
691
|
return [
|
|
@@ -705,10 +694,32 @@ export function meta() {
|
|
|
705
694
|
];
|
|
706
695
|
}
|
|
707
696
|
|
|
697
|
+
function ThreadWithSuggestions() {
|
|
698
|
+
const aui = useAui({
|
|
699
|
+
suggestions: Suggestions([
|
|
700
|
+
{
|
|
701
|
+
title: "Hello!",
|
|
702
|
+
label: "start a conversation",
|
|
703
|
+
prompt: "Hello! What can you help me with?",
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
title: "Tell me a joke",
|
|
707
|
+
label: "about programming",
|
|
708
|
+
prompt: "Tell me a funny programming joke.",
|
|
709
|
+
},
|
|
710
|
+
]),
|
|
711
|
+
});
|
|
712
|
+
return (
|
|
713
|
+
<AuiProvider value={aui}>
|
|
714
|
+
<Thread />
|
|
715
|
+
</AuiProvider>
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
|
|
708
719
|
export default function Home() {
|
|
709
720
|
return (
|
|
710
721
|
<main className="h-dvh">
|
|
711
|
-
<
|
|
722
|
+
<ThreadWithSuggestions />
|
|
712
723
|
</main>
|
|
713
724
|
);
|
|
714
725
|
}
|
|
@@ -761,36 +772,31 @@ export default function Home() {
|
|
|
761
772
|
"dependencies": {
|
|
762
773
|
"@assistant-ui/react": "workspace:*",
|
|
763
774
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
764
|
-
"@
|
|
765
|
-
"@
|
|
766
|
-
"@radix-ui/react-slot": "^1.2.4",
|
|
767
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
768
|
-
"@react-router/node": "7.13.0",
|
|
769
|
-
"@react-router/serve": "7.13.0",
|
|
775
|
+
"@react-router/node": "^7.13.1",
|
|
776
|
+
"@react-router/serve": "^7.13.1",
|
|
770
777
|
"class-variance-authority": "^0.7.1",
|
|
771
778
|
"clsx": "^2.1.1",
|
|
772
779
|
"eventsource-parser": "^3.0.6",
|
|
773
|
-
"isbot": "^5.1.
|
|
774
|
-
"lucide-react": "^0.
|
|
775
|
-
"openai": "^6.
|
|
780
|
+
"isbot": "^5.1.35",
|
|
781
|
+
"lucide-react": "^0.576.0",
|
|
782
|
+
"openai": "^6.25.0",
|
|
776
783
|
"react": "^19.2.4",
|
|
777
784
|
"react-dom": "^19.2.4",
|
|
778
|
-
"react-router": "7.13.
|
|
785
|
+
"react-router": "^7.13.1",
|
|
779
786
|
"remark-gfm": "^4.0.1",
|
|
780
|
-
"tailwind-merge": "^3.
|
|
781
|
-
"zustand": "^5.0.11"
|
|
787
|
+
"tailwind-merge": "^3.5.0"
|
|
782
788
|
},
|
|
783
789
|
"devDependencies": {
|
|
784
|
-
"@react-router/dev": "7.13.
|
|
785
|
-
"@tailwindcss/vite": "^4.1
|
|
786
|
-
"@types/node": "^25.
|
|
787
|
-
"@types/react": "^19.2.
|
|
790
|
+
"@react-router/dev": "^7.13.1",
|
|
791
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
792
|
+
"@types/node": "^25.3.3",
|
|
793
|
+
"@types/react": "^19.2.14",
|
|
788
794
|
"@types/react-dom": "^19.2.3",
|
|
789
|
-
"tailwindcss": "^4.1
|
|
795
|
+
"tailwindcss": "^4.2.1",
|
|
790
796
|
"tw-animate-css": "^1.4.0",
|
|
791
797
|
"typescript": "^5.9.3",
|
|
792
798
|
"vite": "^7.3.1",
|
|
793
|
-
"vite-tsconfig-paths": "^6.
|
|
799
|
+
"vite-tsconfig-paths": "^6.1.1"
|
|
794
800
|
}
|
|
795
801
|
}
|
|
796
802
|
|
|
@@ -880,6 +886,7 @@ npm run dev
|
|
|
880
886
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
881
887
|
],
|
|
882
888
|
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
889
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
883
890
|
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
884
891
|
},
|
|
885
892
|
"esModuleInterop": true,
|
|
@@ -118,8 +118,8 @@ import { FooList, FooListResource } from "./store/foo-store";
|
|
|
118
118
|
*/
|
|
119
119
|
const Foo = () => {
|
|
120
120
|
const aui = useAui();
|
|
121
|
-
const fooId = useAuiState((
|
|
122
|
-
const fooBar = useAuiState((
|
|
121
|
+
const fooId = useAuiState((s) => s.foo.id);
|
|
122
|
+
const fooBar = useAuiState((s) => s.foo.bar);
|
|
123
123
|
|
|
124
124
|
// Each foo logs its own events - only receives events from THIS foo instance
|
|
125
125
|
useAuiEvent("foo.updated", (payload) => {
|
|
@@ -167,7 +167,7 @@ const Foo = () => {
|
|
|
167
167
|
};
|
|
168
168
|
|
|
169
169
|
const FooListLength = () => {
|
|
170
|
-
const fooListLength = useAuiState((
|
|
170
|
+
const fooListLength = useAuiState((s) => s.fooList.foos.length);
|
|
171
171
|
return (
|
|
172
172
|
<span className="text-gray-500 dark:text-gray-400">
|
|
173
173
|
({fooListLength} items)
|
|
@@ -314,15 +314,13 @@ type FooListEvents = {
|
|
|
314
314
|
};
|
|
315
315
|
|
|
316
316
|
declare module "@assistant-ui/store" {
|
|
317
|
-
interface
|
|
317
|
+
interface ScopeRegistry {
|
|
318
318
|
foo: {
|
|
319
|
-
state: FooState;
|
|
320
319
|
methods: FooMethods;
|
|
321
320
|
meta: FooMeta;
|
|
322
321
|
events: FooEvents;
|
|
323
322
|
};
|
|
324
323
|
fooList: {
|
|
325
|
-
state: FooListState;
|
|
326
324
|
methods: FooListMethods;
|
|
327
325
|
events: FooListEvents;
|
|
328
326
|
};
|
|
@@ -372,12 +370,9 @@ export const FooItemResource = resource(
|
|
|
372
370
|
};
|
|
373
371
|
|
|
374
372
|
return {
|
|
375
|
-
state,
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
updateBar,
|
|
379
|
-
remove: handleRemove,
|
|
380
|
-
},
|
|
373
|
+
getState: () => state,
|
|
374
|
+
updateBar,
|
|
375
|
+
remove: handleRemove,
|
|
381
376
|
};
|
|
382
377
|
},
|
|
383
378
|
);
|
|
@@ -408,12 +403,9 @@ export const FooListResource = resource(
|
|
|
408
403
|
const state = tapMemo(() => ({ foos: foos.state }), [foos.state]);
|
|
409
404
|
|
|
410
405
|
return {
|
|
411
|
-
state,
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
foo: foos.get,
|
|
415
|
-
addFoo,
|
|
416
|
-
},
|
|
406
|
+
getState: () => state,
|
|
407
|
+
foo: foos.get,
|
|
408
|
+
addFoo,
|
|
417
409
|
};
|
|
418
410
|
},
|
|
419
411
|
);
|
|
@@ -441,7 +433,7 @@ export const FooList = ({
|
|
|
441
433
|
}: {
|
|
442
434
|
components: { Foo: React.ComponentType };
|
|
443
435
|
}) => {
|
|
444
|
-
const fooListState = useAuiState((
|
|
436
|
+
const fooListState = useAuiState((s) => s.fooList.foos.length);
|
|
445
437
|
|
|
446
438
|
return (
|
|
447
439
|
<>
|
|
@@ -491,12 +483,12 @@ export default nextConfig;
|
|
|
491
483
|
},
|
|
492
484
|
"devDependencies": {
|
|
493
485
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
494
|
-
"@tailwindcss/postcss": "^4.1
|
|
495
|
-
"@types/node": "^25.
|
|
496
|
-
"@types/react": "^19.2.
|
|
486
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
487
|
+
"@types/node": "^25.3.3",
|
|
488
|
+
"@types/react": "^19.2.14",
|
|
497
489
|
"@types/react-dom": "^19.2.3",
|
|
498
|
-
"postcss": "^8.5.
|
|
499
|
-
"tailwindcss": "^4.1
|
|
490
|
+
"postcss": "^8.5.8",
|
|
491
|
+
"tailwindcss": "^4.2.1",
|
|
500
492
|
"tw-animate-css": "^1.4.0",
|
|
501
493
|
"typescript": "^5.9.3"
|
|
502
494
|
}
|
|
@@ -554,7 +546,7 @@ Open [http://localhost:3000](http://localhost:3000) to see the example.
|
|
|
554
546
|
|
|
555
547
|
```typescript
|
|
556
548
|
declare module "@assistant-ui/store" {
|
|
557
|
-
interface
|
|
549
|
+
interface ScopeRegistry {
|
|
558
550
|
foo: {
|
|
559
551
|
state: { id: string; bar: string };
|
|
560
552
|
methods: {
|
|
@@ -64,29 +64,27 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@assistant-ui/react": "workspace:*",
|
|
66
66
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
67
|
-
"@
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"@tanstack/react-router": "^1.158.1",
|
|
71
|
-
"@tanstack/react-start": "^1.158.3",
|
|
67
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
68
|
+
"@tanstack/react-router": "^1.163.3",
|
|
69
|
+
"@tanstack/react-start": "^1.166.1",
|
|
72
70
|
"class-variance-authority": "^0.7.1",
|
|
73
71
|
"clsx": "^2.1.1",
|
|
74
|
-
"lucide-react": "^0.
|
|
72
|
+
"lucide-react": "^0.576.0",
|
|
75
73
|
"nitro": "^3.0.1-alpha.2",
|
|
76
|
-
"openai": "^6.
|
|
74
|
+
"openai": "^6.25.0",
|
|
77
75
|
"react": "^19.2.4",
|
|
78
76
|
"react-dom": "^19.2.4",
|
|
79
77
|
"remark-gfm": "^4.0.1",
|
|
80
|
-
"tailwind-merge": "^3.
|
|
81
|
-
"tailwindcss": "^4.1
|
|
82
|
-
"vite-tsconfig-paths": "^6.
|
|
78
|
+
"tailwind-merge": "^3.5.0",
|
|
79
|
+
"tailwindcss": "^4.2.1",
|
|
80
|
+
"vite-tsconfig-paths": "^6.1.1"
|
|
83
81
|
},
|
|
84
82
|
"devDependencies": {
|
|
85
83
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
86
|
-
"@types/node": "^25.
|
|
87
|
-
"@types/react": "^19.2.
|
|
84
|
+
"@types/node": "^25.3.3",
|
|
85
|
+
"@types/react": "^19.2.14",
|
|
88
86
|
"@types/react-dom": "^19.2.3",
|
|
89
|
-
"@vitejs/plugin-react": "^5.1.
|
|
87
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
90
88
|
"typescript": "^5.9.3",
|
|
91
89
|
"vite": "^7.3.1"
|
|
92
90
|
}
|
|
@@ -249,18 +247,6 @@ export function MyRuntimeProvider({
|
|
|
249
247
|
|
|
250
248
|
```
|
|
251
249
|
|
|
252
|
-
## src/lib/utils.ts
|
|
253
|
-
|
|
254
|
-
```typescript
|
|
255
|
-
import { clsx, type ClassValue } from "clsx";
|
|
256
|
-
import { twMerge } from "tailwind-merge";
|
|
257
|
-
|
|
258
|
-
export function cn(...inputs: ClassValue[]) {
|
|
259
|
-
return twMerge(clsx(inputs));
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
|
|
264
250
|
## src/router.tsx
|
|
265
251
|
|
|
266
252
|
```tsx
|
|
@@ -336,15 +322,38 @@ function RootDocument({ children }: { children: React.ReactNode }) {
|
|
|
336
322
|
```tsx
|
|
337
323
|
import { createFileRoute } from "@tanstack/react-router";
|
|
338
324
|
import { Thread } from "@/components/assistant-ui/thread";
|
|
325
|
+
import { useAui, AuiProvider, Suggestions } from "@assistant-ui/react";
|
|
339
326
|
import { MyRuntimeProvider } from "@/components/MyRuntimeProvider";
|
|
340
327
|
|
|
341
328
|
export const Route = createFileRoute("/")({ component: App });
|
|
342
329
|
|
|
330
|
+
function ThreadWithSuggestions() {
|
|
331
|
+
const aui = useAui({
|
|
332
|
+
suggestions: Suggestions([
|
|
333
|
+
{
|
|
334
|
+
title: "Hello!",
|
|
335
|
+
label: "start a conversation",
|
|
336
|
+
prompt: "Hello! What can you help me with?",
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
title: "What can you do?",
|
|
340
|
+
label: "tell me your capabilities",
|
|
341
|
+
prompt: "What kinds of things can you help me with?",
|
|
342
|
+
},
|
|
343
|
+
]),
|
|
344
|
+
});
|
|
345
|
+
return (
|
|
346
|
+
<AuiProvider value={aui}>
|
|
347
|
+
<Thread />
|
|
348
|
+
</AuiProvider>
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
343
352
|
function App() {
|
|
344
353
|
return (
|
|
345
354
|
<MyRuntimeProvider>
|
|
346
355
|
<main className="h-dvh">
|
|
347
|
-
<
|
|
356
|
+
<ThreadWithSuggestions />
|
|
348
357
|
</main>
|
|
349
358
|
</MyRuntimeProvider>
|
|
350
359
|
);
|
|
@@ -735,6 +744,7 @@ export const chatStream = createServerFn({ method: "POST" })
|
|
|
735
744
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
736
745
|
],
|
|
737
746
|
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
747
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
738
748
|
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
739
749
|
}
|
|
740
750
|
},
|
|
@@ -461,7 +461,7 @@ function ThreadListItem() {
|
|
|
461
461
|
}
|
|
462
462
|
|
|
463
463
|
function ThreadListItemId() {
|
|
464
|
-
const id = useAuiState((
|
|
464
|
+
const id = useAuiState((s) => s.threadListItem.id);
|
|
465
465
|
return <>{id}</>;
|
|
466
466
|
}
|
|
467
467
|
|
|
@@ -476,7 +476,7 @@ import { Thread } from "@/components/assistant-ui/thread";
|
|
|
476
476
|
import { useAuiState } from "@assistant-ui/react";
|
|
477
477
|
|
|
478
478
|
export default function Home() {
|
|
479
|
-
const isEmpty = useAuiState((
|
|
479
|
+
const isEmpty = useAuiState((s) => s.threads.main.isEmpty);
|
|
480
480
|
|
|
481
481
|
return (
|
|
482
482
|
<div className="flex h-full flex-col">
|
|
@@ -563,18 +563,6 @@ export default function Home() {
|
|
|
563
563
|
|
|
564
564
|
```
|
|
565
565
|
|
|
566
|
-
## lib/utils.ts
|
|
567
|
-
|
|
568
|
-
```typescript
|
|
569
|
-
import { type ClassValue, clsx } from "clsx";
|
|
570
|
-
import { twMerge } from "tailwind-merge";
|
|
571
|
-
|
|
572
|
-
export function cn(...inputs: ClassValue[]) {
|
|
573
|
-
return twMerge(clsx(inputs));
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
```
|
|
577
|
-
|
|
578
566
|
## next.config.ts
|
|
579
567
|
|
|
580
568
|
```typescript
|
|
@@ -605,25 +593,22 @@ export default nextConfig;
|
|
|
605
593
|
"@assistant-ui/react": "workspace:*",
|
|
606
594
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
607
595
|
"@assistant-ui/ui": "workspace:*",
|
|
608
|
-
"@radix-ui/react-avatar": "^1.1.11",
|
|
609
|
-
"@radix-ui/react-slot": "^1.2.4",
|
|
610
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
611
596
|
"class-variance-authority": "^0.7.1",
|
|
612
597
|
"clsx": "^2.1.1",
|
|
613
|
-
"lucide-react": "^0.
|
|
598
|
+
"lucide-react": "^0.576.0",
|
|
614
599
|
"next": "^16.1.6",
|
|
615
600
|
"react": "^19.2.4",
|
|
616
601
|
"react-dom": "^19.2.4",
|
|
617
|
-
"tailwind-merge": "^3.
|
|
602
|
+
"tailwind-merge": "^3.5.0"
|
|
618
603
|
},
|
|
619
604
|
"devDependencies": {
|
|
620
605
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
621
|
-
"@tailwindcss/postcss": "^4.1
|
|
622
|
-
"@types/node": "^25.
|
|
623
|
-
"@types/react": "^19.2.
|
|
606
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
607
|
+
"@types/node": "^25.3.3",
|
|
608
|
+
"@types/react": "^19.2.14",
|
|
624
609
|
"@types/react-dom": "^19.2.3",
|
|
625
|
-
"postcss": "^8.5.
|
|
626
|
-
"tailwindcss": "^4.1
|
|
610
|
+
"postcss": "^8.5.8",
|
|
611
|
+
"tailwindcss": "^4.2.1",
|
|
627
612
|
"tw-animate-css": "^1.4.0",
|
|
628
613
|
"typescript": "^5.9.3"
|
|
629
614
|
}
|
|
@@ -754,7 +739,7 @@ Type-safe client definitions via module augmentation (defined in `@assistant-ui/
|
|
|
754
739
|
|
|
755
740
|
```typescript
|
|
756
741
|
declare module "@assistant-ui/store" {
|
|
757
|
-
interface
|
|
742
|
+
interface ScopeRegistry {
|
|
758
743
|
threads: ThreadsClientSchema;
|
|
759
744
|
thread: ThreadClientSchema;
|
|
760
745
|
message: MessageClientSchema;
|
|
@@ -795,6 +780,7 @@ You can extend this example to:
|
|
|
795
780
|
"../../packages/ui/src/components/assistant-ui/*"
|
|
796
781
|
],
|
|
797
782
|
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
783
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
798
784
|
"@assistant-ui/ui/*": ["../../packages/ui/src/*"],
|
|
799
785
|
"@assistant-ui/*": ["../../packages/*/src"],
|
|
800
786
|
"@assistant-ui/react/*": ["../../packages/react/src/*"],
|
|
@@ -51,10 +51,12 @@ This command uses `create-next-app` with assistant-ui starter templates.
|
|
|
51
51
|
|
|
52
52
|
| Template | Description | Command |
|
|
53
53
|
|----------|-------------|---------|
|
|
54
|
-
| `default` |
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
54
|
+
| `default` | Default template with Vercel AI SDK | `npx assistant-ui create` |
|
|
55
|
+
| `minimal` | Bare-bones starting point | `npx assistant-ui create -t minimal` |
|
|
56
|
+
| `cloud` | Cloud-backed persistence starter | `npx assistant-ui create -t cloud` |
|
|
57
|
+
| `cloud-clerk` | Cloud-backed starter with Clerk auth | `npx assistant-ui create -t cloud-clerk` |
|
|
58
|
+
| `langgraph` | LangGraph starter template | `npx assistant-ui create -t langgraph` |
|
|
59
|
+
| `mcp` | MCP starter template | `npx assistant-ui create -t mcp` |
|
|
58
60
|
|
|
59
61
|
**Available Examples**
|
|
60
62
|
|
|
@@ -63,10 +65,12 @@ Use `--example` to create a project from one of the monorepo examples with full
|
|
|
63
65
|
| Example | Description | Command |
|
|
64
66
|
|---------|-------------|---------|
|
|
65
67
|
| `with-ai-sdk-v6` | Vercel AI SDK v6 integration | `npx assistant-ui create my-app -e with-ai-sdk-v6` |
|
|
68
|
+
| `with-artifacts` | HTML artifact rendering with live preview | `npx assistant-ui create my-app -e with-artifacts` |
|
|
66
69
|
| `with-langgraph` | LangGraph agent with custom tools | `npx assistant-ui create my-app -e with-langgraph` |
|
|
67
70
|
| `with-cloud` | Assistant Cloud persistence | `npx assistant-ui create my-app -e with-cloud` |
|
|
68
71
|
| `with-ag-ui` | AG-UI protocol integration | `npx assistant-ui create my-app -e with-ag-ui` |
|
|
69
72
|
| `with-assistant-transport` | Custom backend via Assistant Transport | `npx assistant-ui create my-app -e with-assistant-transport` |
|
|
73
|
+
| `with-chain-of-thought` | Chain-of-thought with JS execution | `npx assistant-ui create my-app -e with-chain-of-thought` |
|
|
70
74
|
| `with-external-store` | External message store | `npx assistant-ui create my-app -e with-external-store` |
|
|
71
75
|
| `with-custom-thread-list` | Custom thread list UI | `npx assistant-ui create my-app -e with-custom-thread-list` |
|
|
72
76
|
| `with-react-hook-form` | React Hook Form integration | `npx assistant-ui create my-app -e with-react-hook-form` |
|
|
@@ -85,6 +89,9 @@ npx assistant-ui@latest create my-app
|
|
|
85
89
|
# Create with cloud template
|
|
86
90
|
npx assistant-ui@latest create my-app -t cloud
|
|
87
91
|
|
|
92
|
+
# Create with cloud + clerk template
|
|
93
|
+
npx assistant-ui@latest create my-app -t cloud-clerk
|
|
94
|
+
|
|
88
95
|
# Create from an example
|
|
89
96
|
npx assistant-ui@latest create my-app --example with-langgraph
|
|
90
97
|
|
|
@@ -106,7 +113,7 @@ Arguments:
|
|
|
106
113
|
project-directory name of the project directory
|
|
107
114
|
|
|
108
115
|
Options:
|
|
109
|
-
-t, --template <template> template to use (default, cloud, langgraph, mcp)
|
|
116
|
+
-t, --template <template> template to use (default, minimal, cloud, cloud-clerk, langgraph, mcp)
|
|
110
117
|
-e, --example <example> create from an example (e.g., with-langgraph)
|
|
111
118
|
--use-npm explicitly use npm
|
|
112
119
|
--use-pnpm explicitly use pnpm
|
|
@@ -441,4 +448,4 @@ The CLI respects your project's configuration:
|
|
|
441
448
|
- **Package Manager**: Automatically detects npm, pnpm, yarn, or bun
|
|
442
449
|
- **TypeScript**: Works with your `tsconfig.json` paths
|
|
443
450
|
- **Tailwind**: Uses your `tailwind.config.js` settings
|
|
444
|
-
- **Import Aliases**: Respects `components.json` or `assistant-ui.json` configuration
|
|
451
|
+
- **Import Aliases**: Respects `components.json` or `assistant-ui.json` configuration
|