@assistant-ui/mcp-docs-server 0.1.32 → 0.1.33

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.
Files changed (112) hide show
  1. package/.docs/organized/code-examples/waterfall.md +15 -17
  2. package/.docs/organized/code-examples/with-a2a.md +19 -19
  3. package/.docs/organized/code-examples/with-ag-ui.md +25 -20
  4. package/.docs/organized/code-examples/with-ai-sdk-v6.md +6 -4
  5. package/.docs/organized/code-examples/with-artifacts.md +34 -28
  6. package/.docs/organized/code-examples/with-assistant-transport.md +59 -47
  7. package/.docs/organized/code-examples/with-browser-extension.md +17 -5
  8. package/.docs/organized/code-examples/with-chain-of-thought.md +376 -78
  9. package/.docs/organized/code-examples/with-cloud-standalone.md +20 -19
  10. package/.docs/organized/code-examples/with-cloud.md +6 -4
  11. package/.docs/organized/code-examples/with-custom-thread-list.md +9 -7
  12. package/.docs/organized/code-examples/with-elevenlabs-conversational.md +18 -16
  13. package/.docs/organized/code-examples/with-elevenlabs-scribe.md +9 -8
  14. package/.docs/organized/code-examples/with-expo.md +23 -17
  15. package/.docs/organized/code-examples/with-external-store.md +4 -2
  16. package/.docs/organized/code-examples/with-ffmpeg.md +317 -280
  17. package/.docs/organized/code-examples/with-generative-ui.md +1018 -214
  18. package/.docs/organized/code-examples/with-google-adk.md +4 -2
  19. package/.docs/organized/code-examples/with-heat-graph.md +8 -6
  20. package/.docs/organized/code-examples/with-image-generation.md +19 -17
  21. package/.docs/organized/code-examples/with-interactables.md +312 -234
  22. package/.docs/organized/code-examples/with-langchain.md +9 -7
  23. package/.docs/organized/code-examples/with-langgraph.md +82 -78
  24. package/.docs/organized/code-examples/with-livekit.md +19 -17
  25. package/.docs/organized/code-examples/with-mcp.md +13 -7
  26. package/.docs/organized/code-examples/with-opencode.md +61 -61
  27. package/.docs/organized/code-examples/with-react-hook-form.md +14 -12
  28. package/.docs/organized/code-examples/with-react-ink.md +2 -2
  29. package/.docs/organized/code-examples/with-react-router.md +11 -9
  30. package/.docs/organized/code-examples/with-resumable-stream.md +10 -9
  31. package/.docs/organized/code-examples/with-store.md +14 -12
  32. package/.docs/organized/code-examples/with-tanstack.md +8 -9
  33. package/.docs/organized/code-examples/with-tap-runtime.md +21 -19
  34. package/.docs/raw/docs/(docs)/architecture.mdx +43 -2
  35. package/.docs/raw/docs/(docs)/cli.mdx +1 -2
  36. package/.docs/raw/docs/(docs)/copilots/model-context.mdx +34 -26
  37. package/.docs/raw/docs/(docs)/copilots/motivation.mdx +32 -26
  38. package/.docs/raw/docs/(docs)/installation.mdx +1 -1
  39. package/.docs/raw/docs/(reference)/api-reference/adapters/persistence.mdx +5 -1
  40. package/.docs/raw/docs/(reference)/api-reference/external-store/message-conversion.mdx +14 -14
  41. package/.docs/raw/docs/(reference)/api-reference/external-store/runtime.mdx +11 -1
  42. package/.docs/raw/docs/(reference)/api-reference/generative-ui/index.mdx +18 -0
  43. package/.docs/raw/docs/(reference)/api-reference/generative-ui/rendering.mdx +33 -0
  44. package/.docs/raw/docs/(reference)/api-reference/generative-ui/spec.mdx +45 -0
  45. package/.docs/raw/docs/(reference)/api-reference/hooks/composer-triggers.mdx +41 -41
  46. package/.docs/raw/docs/(reference)/api-reference/hooks/model-context.mdx +19 -1
  47. package/.docs/raw/docs/(reference)/api-reference/hooks/primitives.mdx +122 -122
  48. package/.docs/raw/docs/(reference)/api-reference/integrations/react-ai-sdk.mdx +32 -2
  49. package/.docs/raw/docs/(reference)/api-reference/model-context/context.mdx +6 -0
  50. package/.docs/raw/docs/(reference)/api-reference/overview.mdx +4 -6
  51. package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +30 -0
  52. package/.docs/raw/docs/(reference)/api-reference/tools/component-tools.mdx +20 -3
  53. package/.docs/raw/docs/(reference)/api-reference/tools/index.mdx +8 -8
  54. package/.docs/raw/docs/(reference)/api-reference/tools/rendering.mdx +52 -4
  55. package/.docs/raw/docs/(reference)/api-reference/tools/toolkits.mdx +6 -7
  56. package/.docs/raw/docs/(reference)/api-reference/utilities/miscellaneous.mdx +58 -46
  57. package/.docs/raw/docs/cloud/ai-sdk.mdx +0 -2
  58. package/.docs/raw/docs/guides/chain-of-thought.mdx +7 -9
  59. package/.docs/raw/docs/guides/context-api.mdx +2 -1
  60. package/.docs/raw/docs/guides/index.mdx +3 -12
  61. package/.docs/raw/docs/guides/mentions.mdx +4 -4
  62. package/.docs/raw/docs/guides/slash-commands.mdx +1 -1
  63. package/.docs/raw/docs/guides/suggestions.mdx +1 -1
  64. package/.docs/raw/docs/ink/hooks.mdx +98 -85
  65. package/.docs/raw/docs/ink/migration.mdx +1 -1
  66. package/.docs/raw/docs/ink/primitives.mdx +2 -2
  67. package/.docs/raw/docs/integrations/frameworks/ai-sdk.mdx +1 -1
  68. package/.docs/raw/docs/integrations/index.mdx +2 -2
  69. package/.docs/raw/docs/integrations/persistence/custom-adapter.mdx +17 -2
  70. package/.docs/raw/docs/migrations/toolkit-tools.mdx +226 -0
  71. package/.docs/raw/docs/primitives/chain-of-thought.mdx +10 -16
  72. package/.docs/raw/docs/primitives/message.mdx +9 -10
  73. package/.docs/raw/docs/react-native/hooks.mdx +57 -82
  74. package/.docs/raw/docs/react-native/migration.mdx +1 -1
  75. package/.docs/raw/docs/react-native/primitives.mdx +2 -2
  76. package/.docs/raw/docs/runtimes/a2a/client-and-hooks.mdx +3 -0
  77. package/.docs/raw/docs/runtimes/ai-sdk/v6.mdx +122 -1
  78. package/.docs/raw/docs/runtimes/concepts/threads.mdx +7 -1
  79. package/.docs/raw/docs/runtimes/custom/local-runtime.mdx +18 -7
  80. package/.docs/raw/docs/runtimes/google-adk/hooks.mdx +108 -38
  81. package/.docs/raw/docs/runtimes/langgraph/generative-ui.mdx +2 -2
  82. package/.docs/raw/docs/runtimes/langgraph/streaming.mdx +1 -1
  83. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +64 -50
  84. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +98 -86
  85. package/.docs/raw/docs/tools/backend.mdx +136 -0
  86. package/.docs/raw/docs/tools/defining-tools.mdx +413 -0
  87. package/.docs/raw/docs/tools/dynamic-tools.mdx +110 -0
  88. package/.docs/raw/docs/tools/generative-ui.mdx +214 -0
  89. package/.docs/raw/docs/tools/index.mdx +76 -0
  90. package/.docs/raw/docs/{guides → tools}/interactables.mdx +1 -1
  91. package/.docs/raw/docs/{integrations/tools → tools}/mcp.mdx +77 -50
  92. package/.docs/raw/docs/{guides → tools}/multi-agent.mdx +17 -19
  93. package/.docs/raw/docs/tools/tool-ui.mdx +967 -0
  94. package/.docs/raw/docs/{integrations/tools/react-mcp.mdx → tools/user-managed-mcp.mdx} +3 -3
  95. package/.docs/raw/docs/ui/directive-text.mdx +3 -3
  96. package/.docs/raw/docs/ui/mcp-config.mdx +4 -4
  97. package/.docs/raw/docs/ui/part-grouping.mdx +84 -50
  98. package/.docs/raw/docs/ui/reasoning.mdx +4 -5
  99. package/.docs/raw/docs/ui/tool-group.mdx +5 -6
  100. package/.docs/raw/docs/utilities/heat-graph.mdx +1 -1
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/prepare-docs/code-examples.d.ts.map +1 -1
  103. package/dist/prepare-docs/copy-raw.d.ts.map +1 -1
  104. package/dist/utils/paths.d.ts.map +1 -1
  105. package/package.json +3 -3
  106. package/.docs/organized/code-examples/with-parent-id-grouping.md +0 -596
  107. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +0 -151
  108. package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +0 -230
  109. package/.docs/raw/docs/guides/generative-ui.mdx +0 -142
  110. package/.docs/raw/docs/guides/tool-ui.mdx +0 -858
  111. package/.docs/raw/docs/guides/tools.mdx +0 -736
  112. /package/.docs/raw/docs/{guides → tools}/mcp-apps.mdx +0 -0
@@ -88,13 +88,13 @@ import { WaterfallPage } from "@/lib/waterfall-page";
88
88
 
89
89
  export default function Home() {
90
90
  return (
91
- <div className="min-h-screen bg-background p-8">
91
+ <div className="bg-background min-h-screen p-8">
92
92
  <div className="mx-auto max-w-6xl">
93
93
  <div className="mb-8">
94
- <h1 className="mb-2 font-bold text-4xl text-foreground">
94
+ <h1 className="text-foreground mb-2 text-4xl font-bold">
95
95
  Waterfall Timeline
96
96
  </h1>
97
- <p className="text-lg text-muted-foreground">
97
+ <p className="text-muted-foreground text-lg">
98
98
  Span visualization powered by @assistant-ui/react-o11y
99
99
  </p>
100
100
  </div>
@@ -411,14 +411,14 @@ export function WaterfallRow() {
411
411
  <SpanPrimitive.Indent
412
412
  baseIndent={8}
413
413
  indentPerLevel={12}
414
- className="sticky left-0 z-10 flex shrink-0 items-center gap-1 overflow-hidden border-border border-r bg-background px-2 group-hover:bg-accent/50"
414
+ className="border-border bg-background group-hover:bg-accent/50 sticky left-0 z-10 flex shrink-0 items-center gap-1 overflow-hidden border-r px-2"
415
415
  style={{ width: LABEL_WIDTH, height: barHeight }}
416
416
  >
417
417
  <AuiIf condition={(s) => s.span.hasChildren}>
418
- <SpanPrimitive.CollapseToggle className="flex shrink-0 items-center justify-center rounded p-0.5 text-muted-foreground hover:text-foreground">
418
+ <SpanPrimitive.CollapseToggle className="text-muted-foreground hover:text-foreground flex shrink-0 items-center justify-center rounded p-0.5">
419
419
  <svg
420
420
  aria-hidden="true"
421
- className="size-3.5 transition-transform data-[collapsed=true]:[-rotate-90]"
421
+ className="data-[collapsed=true]:[-rotate-90] size-3.5 transition-transform"
422
422
  viewBox="0 0 16 16"
423
423
  fill="currentColor"
424
424
  >
@@ -430,7 +430,7 @@ export function WaterfallRow() {
430
430
  <span className="w-4.5 shrink-0" />
431
431
  </AuiIf>
432
432
  <SpanPrimitive.StatusIndicator className="size-1.5 shrink-0 rounded-full bg-current" />
433
- <SpanPrimitive.TypeBadge className="shrink-0 rounded border border-border px-1 text-[10px] text-muted-foreground" />
433
+ <SpanPrimitive.TypeBadge className="border-border text-muted-foreground shrink-0 rounded border px-1 text-[10px]" />
434
434
  <SpanPrimitive.Name className="truncate text-sm" />
435
435
  </SpanPrimitive.Indent>
436
436
 
@@ -569,7 +569,6 @@ export function WaterfallTimeline() {
569
569
  ) as SpanState["timeRange"];
570
570
 
571
571
  // Measure outer container width — re-attach when scroll container mounts
572
- // biome-ignore lint/correctness/useExhaustiveDependencies: hasSpans triggers re-attach when scroll container mounts
573
572
  useEffect(() => {
574
573
  const el = outerRef.current;
575
574
  if (!el) return;
@@ -588,7 +587,6 @@ export function WaterfallTimeline() {
588
587
  }, [hasSpans]);
589
588
 
590
589
  // Cmd + scroll wheel zoom — re-attach when scroll container mounts
591
- // biome-ignore lint/correctness/useExhaustiveDependencies: hasSpans triggers re-attach when scroll container mounts
592
590
  useEffect(() => {
593
591
  const el = scrollRef.current;
594
592
  if (!el) return;
@@ -653,14 +651,14 @@ export function WaterfallTimeline() {
653
651
 
654
652
  if (!hasSpans) {
655
653
  return (
656
- <div className="rounded-lg border border-border py-12 text-center text-muted-foreground text-sm">
654
+ <div className="border-border text-muted-foreground rounded-lg border py-12 text-center text-sm">
657
655
  No spans recorded.
658
656
  </div>
659
657
  );
660
658
  }
661
659
 
662
660
  return (
663
- <div ref={outerRef} className="rounded-lg border border-border">
661
+ <div ref={outerRef} className="border-border rounded-lg border">
664
662
  <div
665
663
  ref={scrollRef}
666
664
  className="overflow-auto"
@@ -668,11 +666,11 @@ export function WaterfallTimeline() {
668
666
  >
669
667
  {/* Time axis */}
670
668
  <div
671
- className="sticky top-0 z-20 flex border-border border-b bg-background"
669
+ className="border-border bg-background sticky top-0 z-20 flex border-b"
672
670
  style={{ width: contentWidth }}
673
671
  >
674
672
  <div
675
- className="sticky left-0 z-30 shrink-0 border-border border-r bg-background px-2 py-1.5 text-muted-foreground text-xs"
673
+ className="border-border bg-background text-muted-foreground sticky left-0 z-30 shrink-0 border-r px-2 py-1.5 text-xs"
676
674
  style={{ width: LABEL_WIDTH }}
677
675
  >
678
676
  Span
@@ -684,8 +682,6 @@ export function WaterfallTimeline() {
684
682
 
685
683
  {/* Span rows */}
686
684
  <WaterfallLayoutContext.Provider value={layoutValue}>
687
- {/* biome-ignore lint/a11y/useKeyWithClickEvents: event delegation on span rows */}
688
- {/* biome-ignore lint/a11y/noStaticElementInteractions: event delegation on span rows */}
689
685
  <div
690
686
  style={{ width: contentWidth }}
691
687
  onClick={(e) => {
@@ -704,7 +700,7 @@ export function WaterfallTimeline() {
704
700
  </div>
705
701
 
706
702
  {/* Legend */}
707
- <div className="flex items-center gap-4 border-border border-t px-3 py-2 text-muted-foreground text-xs">
703
+ <div className="border-border text-muted-foreground flex items-center gap-4 border-t px-3 py-2 text-xs">
708
704
  <div className="flex items-center gap-1.5">
709
705
  <span
710
706
  className="size-2.5 rounded-sm"
@@ -750,13 +746,14 @@ export function WaterfallTimeline() {
750
746
  ## next.config.ts
751
747
 
752
748
  ```typescript
749
+ import { withAui } from "@assistant-ui/next";
753
750
  import type { NextConfig } from "next";
754
751
 
755
752
  const nextConfig: NextConfig = {
756
753
  /* config options here */
757
754
  };
758
755
 
759
- export default nextConfig;
756
+ export default withAui(nextConfig);
760
757
 
761
758
  ```
762
759
 
@@ -782,6 +779,7 @@ export default nextConfig;
782
779
  "react-dom": "^19.2.6"
783
780
  },
784
781
  "devDependencies": {
782
+ "@assistant-ui/next": "workspace:*",
785
783
  "@assistant-ui/x-buildutils": "workspace:*",
786
784
  "@tailwindcss/postcss": "^4.3.0",
787
785
  "@types/node": "^25.9.1",
@@ -257,7 +257,7 @@ function StateBadge({ state }: { state: A2ATaskState }) {
257
257
 
258
258
  return (
259
259
  <span
260
- className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 font-medium text-xs ${config.color} ${config.bg}`}
260
+ className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${config.color} ${config.bg}`}
261
261
  >
262
262
  {isActive ? (
263
263
  <span className="relative flex size-1.5">
@@ -286,7 +286,7 @@ function TaskStatusBar() {
286
286
  <StateBadge state={state} />
287
287
  <span className="text-muted-foreground">Task {task.id.slice(0, 8)}</span>
288
288
  {errorText && (
289
- <span className="ml-auto text-red-600 text-xs">{errorText}</span>
289
+ <span className="ml-auto text-xs text-red-600">{errorText}</span>
290
290
  )}
291
291
  </div>
292
292
  );
@@ -295,18 +295,18 @@ function TaskStatusBar() {
295
295
  function ArtifactPartView({ part }: { part: A2APart }) {
296
296
  if (part.text !== undefined) {
297
297
  return (
298
- <pre className="overflow-x-auto whitespace-pre-wrap rounded border bg-background p-2 font-mono text-xs">
298
+ <pre className="bg-background overflow-x-auto rounded border p-2 font-mono text-xs whitespace-pre-wrap">
299
299
  {part.text}
300
300
  </pre>
301
301
  );
302
302
  }
303
303
  if (part.data !== undefined) {
304
304
  return (
305
- <div className="rounded border bg-background p-2">
306
- <div className="mb-1 font-medium text-muted-foreground text-xs">
305
+ <div className="bg-background rounded border p-2">
306
+ <div className="text-muted-foreground mb-1 text-xs font-medium">
307
307
  Data
308
308
  </div>
309
- <pre className="overflow-x-auto whitespace-pre-wrap font-mono text-xs">
309
+ <pre className="overflow-x-auto font-mono text-xs whitespace-pre-wrap">
310
310
  {JSON.stringify(part.data, null, 2)}
311
311
  </pre>
312
312
  </div>
@@ -316,7 +316,6 @@ function ArtifactPartView({ part }: { part: A2APart }) {
316
316
  const isImage = part.mediaType?.startsWith("image/");
317
317
  if (isImage) {
318
318
  return (
319
- // biome-ignore lint/performance/noImgElement: example component
320
319
  <img
321
320
  src={part.url}
322
321
  alt={part.filename ?? "image"}
@@ -329,7 +328,7 @@ function ArtifactPartView({ part }: { part: A2APart }) {
329
328
  href={part.url}
330
329
  target="_blank"
331
330
  rel="noopener noreferrer"
332
- className="inline-flex items-center gap-2 rounded border bg-background p-2 text-sm hover:bg-muted"
331
+ className="bg-background hover:bg-muted inline-flex items-center gap-2 rounded border p-2 text-sm"
333
332
  >
334
333
  <span>📄</span>
335
334
  <span>{part.filename ?? "Download"}</span>
@@ -345,7 +344,6 @@ function ArtifactPartView({ part }: { part: A2APart }) {
345
344
  const isImage = part.mediaType?.startsWith("image/");
346
345
  if (isImage) {
347
346
  return (
348
- // biome-ignore lint/performance/noImgElement: example component
349
347
  <img
350
348
  src={`data:${part.mediaType};base64,${part.raw}`}
351
349
  alt={part.filename ?? "image"}
@@ -358,7 +356,7 @@ function ArtifactPartView({ part }: { part: A2APart }) {
358
356
  <a
359
357
  href={dataUri}
360
358
  download={part.filename ?? "download"}
361
- className="inline-flex items-center gap-2 rounded border bg-background p-2 text-sm hover:bg-muted"
359
+ className="bg-background hover:bg-muted inline-flex items-center gap-2 rounded border p-2 text-sm"
362
360
  >
363
361
  <span>📎</span>
364
362
  <span>{part.filename ?? "File"}</span>
@@ -380,17 +378,17 @@ function ArtifactPanel() {
380
378
 
381
379
  return (
382
380
  <div className="max-h-80 overflow-y-auto border-t px-4 py-3">
383
- <h3 className="mb-2 font-medium text-muted-foreground text-xs">
381
+ <h3 className="text-muted-foreground mb-2 text-xs font-medium">
384
382
  Artifacts ({artifacts.length})
385
383
  </h3>
386
384
  <div className="space-y-2">
387
385
  {artifacts.map((artifact) => (
388
386
  <div
389
387
  key={artifact.artifactId}
390
- className="overflow-hidden rounded-md border bg-muted/30"
388
+ className="bg-muted/30 overflow-hidden rounded-md border"
391
389
  >
392
- <div className="flex items-center gap-2 border-b bg-muted/50 px-3 py-1.5">
393
- <span className="font-medium text-xs">
390
+ <div className="bg-muted/50 flex items-center gap-2 border-b px-3 py-1.5">
391
+ <span className="text-xs font-medium">
394
392
  {artifact.name ?? artifact.artifactId}
395
393
  </span>
396
394
  {artifact.description && (
@@ -417,16 +415,16 @@ function AgentCardBanner() {
417
415
  if (!card) return null;
418
416
 
419
417
  return (
420
- <div className="flex items-center gap-3 border-b bg-muted/30 px-4 py-2">
418
+ <div className="bg-muted/30 flex items-center gap-3 border-b px-4 py-2">
421
419
  <div className="flex-1">
422
- <div className="font-medium text-sm">{card.name}</div>
420
+ <div className="text-sm font-medium">{card.name}</div>
423
421
  <div className="text-muted-foreground text-xs">{card.description}</div>
424
422
  </div>
425
423
  <div className="flex flex-wrap gap-1">
426
424
  {card.skills.map((skill) => (
427
425
  <span
428
426
  key={skill.id}
429
- className="rounded-md bg-muted px-2 py-0.5 text-xs"
427
+ className="bg-muted rounded-md px-2 py-0.5 text-xs"
430
428
  title={skill.description}
431
429
  >
432
430
  {skill.name}
@@ -526,13 +524,14 @@ export default function Home() {
526
524
  ## next.config.ts
527
525
 
528
526
  ```typescript
527
+ import { withAui } from "@assistant-ui/next";
529
528
  import type { NextConfig } from "next";
530
529
 
531
530
  const nextConfig: NextConfig = {
532
531
  /* config options here */
533
532
  };
534
533
 
535
- export default nextConfig;
534
+ export default withAui(nextConfig);
536
535
 
537
536
  ```
538
537
 
@@ -556,13 +555,14 @@ export default nextConfig;
556
555
  "@assistant-ui/ui": "workspace:*",
557
556
  "class-variance-authority": "^0.7.1",
558
557
  "clsx": "^2.1.1",
559
- "lucide-react": "^1.16.0",
558
+ "lucide-react": "^1.17.0",
560
559
  "next": "^16.2.6",
561
560
  "react": "^19.2.6",
562
561
  "react-dom": "^19.2.6",
563
562
  "tailwind-merge": "^3.6.0"
564
563
  },
565
564
  "devDependencies": {
565
+ "@assistant-ui/next": "workspace:*",
566
566
  "@assistant-ui/x-buildutils": "workspace:*",
567
567
  "@tailwindcss/postcss": "^4.3.0",
568
568
  "@types/node": "^25.9.1",
@@ -263,17 +263,17 @@ export function MyRuntimeProvider({
263
263
  "use client";
264
264
 
265
265
  import {
266
- useAssistantTool,
267
266
  useAui,
268
267
  AuiProvider,
269
268
  Suggestions,
269
+ Tools,
270
+ type Toolkit,
270
271
  } from "@assistant-ui/react";
271
272
  import { Thread } from "@/components/assistant-ui/thread";
272
273
  import { PlusIcon } from "lucide-react";
273
274
 
274
- function BrowserAlertTool() {
275
- useAssistantTool<{ message: string }, { status: string }>({
276
- toolName: "browser_alert",
275
+ const toolkit = {
276
+ browser_alert: {
277
277
  description: "Display a native browser alert dialog to the user.",
278
278
  parameters: {
279
279
  type: "object",
@@ -291,24 +291,22 @@ function BrowserAlertTool() {
291
291
  },
292
292
  render: ({ args, result }) => (
293
293
  <div className="mt-3 w-full max-w-(--thread-max-width) rounded-lg border px-4 py-3 text-sm">
294
- <p className="font-semibold text-muted-foreground">browser_alert</p>
294
+ <p className="text-muted-foreground font-semibold">browser_alert</p>
295
295
  <p className="mt-1">
296
296
  Requested alert with message:
297
- <span className="ml-1 font-mono text-foreground">
297
+ <span className="text-foreground ml-1 font-mono">
298
298
  {JSON.stringify(args.message)}
299
299
  </span>
300
300
  </p>
301
301
  {result?.status === "shown" && (
302
- <p className="mt-2 text-foreground/70 text-xs">
302
+ <p className="text-foreground/70 mt-2 text-xs">
303
303
  Alert displayed in this tab.
304
304
  </p>
305
305
  )}
306
306
  </div>
307
307
  ),
308
- });
309
-
310
- return null;
311
- }
308
+ },
309
+ } satisfies Toolkit;
312
310
 
313
311
  function NewThreadButton() {
314
312
  const aui = useAui();
@@ -317,7 +315,7 @@ function NewThreadButton() {
317
315
  <button
318
316
  type="button"
319
317
  onClick={() => aui.threads().switchToNewThread()}
320
- className="absolute top-4 right-4 z-10 flex items-center gap-2 rounded-lg border bg-background px-3 py-2 font-medium text-sm shadow-sm transition-colors hover:bg-accent"
318
+ className="bg-background hover:bg-accent absolute top-4 right-4 z-10 flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium shadow-sm transition-colors"
321
319
  >
322
320
  <PlusIcon className="size-4" />
323
321
  New Thread
@@ -348,12 +346,17 @@ function ThreadWithSuggestions() {
348
346
  }
349
347
 
350
348
  export default function Home() {
349
+ const aui = useAui({
350
+ tools: Tools({ toolkit }),
351
+ });
352
+
351
353
  return (
352
- <main className="relative h-dvh">
353
- <NewThreadButton />
354
- <ThreadWithSuggestions />
355
- <BrowserAlertTool />
356
- </main>
354
+ <AuiProvider value={aui}>
355
+ <main className="relative h-dvh">
356
+ <NewThreadButton />
357
+ <ThreadWithSuggestions />
358
+ </main>
359
+ </AuiProvider>
357
360
  );
358
361
  }
359
362
 
@@ -392,13 +395,14 @@ export default function Home() {
392
395
  ## next.config.ts
393
396
 
394
397
  ```typescript
398
+ import { withAui } from "@assistant-ui/next";
395
399
  import type { NextConfig } from "next";
396
400
 
397
401
  const nextConfig: NextConfig = {
398
402
  /* config options here */
399
403
  };
400
404
 
401
- export default nextConfig;
405
+ export default withAui(nextConfig);
402
406
 
403
407
  ```
404
408
 
@@ -416,20 +420,21 @@ export default nextConfig;
416
420
  "start": "next start"
417
421
  },
418
422
  "dependencies": {
419
- "@ag-ui/client": "^0.0.53",
423
+ "@ag-ui/client": "^0.0.54",
420
424
  "@assistant-ui/react": "workspace:*",
421
425
  "@assistant-ui/react-ag-ui": "workspace:*",
422
426
  "@assistant-ui/react-markdown": "workspace:*",
423
427
  "@assistant-ui/ui": "workspace:*",
424
428
  "class-variance-authority": "^0.7.1",
425
429
  "clsx": "^2.1.1",
426
- "lucide-react": "^1.16.0",
430
+ "lucide-react": "^1.17.0",
427
431
  "next": "^16.2.6",
428
432
  "react": "^19.2.6",
429
433
  "react-dom": "^19.2.6",
430
434
  "tailwind-merge": "^3.6.0"
431
435
  },
432
436
  "devDependencies": {
437
+ "@assistant-ui/next": "workspace:*",
433
438
  "@assistant-ui/x-buildutils": "workspace:*",
434
439
  "@tailwindcss/postcss": "^4.3.0",
435
440
  "@types/node": "^25.9.1",
@@ -292,12 +292,13 @@ export default function Home() {
292
292
  ## next.config.js
293
293
 
294
294
  ```javascript
295
+ import { withAui } from "@assistant-ui/next";
295
296
  /** @type {import('next').NextConfig} */
296
297
  const nextConfig = {
297
298
  transpilePackages: ["@assistant-ui/react", "@assistant-ui/react-ai-sdk"],
298
299
  };
299
300
 
300
- export default nextConfig;
301
+ export default withAui(nextConfig);
301
302
 
302
303
  ```
303
304
 
@@ -315,15 +316,15 @@ export default nextConfig;
315
316
  "start": "next start"
316
317
  },
317
318
  "dependencies": {
318
- "@ai-sdk/openai": "^3.0.64",
319
+ "@ai-sdk/openai": "^3.0.67",
319
320
  "@assistant-ui/react": "workspace:*",
320
321
  "@assistant-ui/react-ai-sdk": "workspace:*",
321
322
  "@assistant-ui/react-markdown": "workspace:*",
322
323
  "@assistant-ui/ui": "workspace:*",
323
- "ai": "^6.0.188",
324
+ "ai": "^6.0.193",
324
325
  "class-variance-authority": "^0.7.1",
325
326
  "clsx": "^2.1.1",
326
- "lucide-react": "^1.16.0",
327
+ "lucide-react": "^1.17.0",
327
328
  "next": "^16.2.6",
328
329
  "react": "^19.2.6",
329
330
  "react-dom": "^19.2.6",
@@ -331,6 +332,7 @@ export default nextConfig;
331
332
  "zod": "^4.4.3"
332
333
  },
333
334
  "devDependencies": {
335
+ "@assistant-ui/next": "workspace:*",
334
336
  "@assistant-ui/x-buildutils": "workspace:*",
335
337
  "@tailwindcss/postcss": "^4.3.0",
336
338
  "@types/node": "^25.9.1",
@@ -211,7 +211,8 @@ export default function RootLayout({
211
211
  import { Thread } from "@/components/assistant-ui/thread";
212
212
  import {
213
213
  AssistantRuntimeProvider,
214
- makeAssistantTool,
214
+ Tools,
215
+ type Toolkit,
215
216
  useAui,
216
217
  useAuiState,
217
218
  AuiProvider,
@@ -223,25 +224,26 @@ import { TerminalIcon, CodeIcon, EyeIcon } from "lucide-react";
223
224
  import { useState } from "react";
224
225
  import { z } from "zod";
225
226
 
226
- const RenderHTMLTool = makeAssistantTool({
227
- toolName: "render_html",
228
- description:
229
- "Whenever the user asks for HTML code, call this function. The user will see the HTML code rendered in their browser.",
230
- parameters: z.object({
231
- code: z.string(),
232
- }),
233
- execute: async () => {
234
- return {};
235
- },
236
- render: () => {
237
- return (
238
- <div className="my-2 inline-flex items-center gap-2 rounded-full border bg-primary px-4 py-2 text-primary-foreground">
239
- <TerminalIcon className="size-4" />
240
- render_html(&#123; code: &quot;...&quot; &#125;)
241
- </div>
242
- );
227
+ const toolkit = {
228
+ render_html: {
229
+ description:
230
+ "Whenever the user asks for HTML code, call this function. The user will see the HTML code rendered in their browser.",
231
+ parameters: z.object({
232
+ code: z.string(),
233
+ }),
234
+ execute: async () => {
235
+ return {};
236
+ },
237
+ render: () => {
238
+ return (
239
+ <div className="bg-primary text-primary-foreground my-2 inline-flex items-center gap-2 rounded-full border px-4 py-2">
240
+ <TerminalIcon className="size-4" />
241
+ render_html(&#123; code: &quot;...&quot; &#125;)
242
+ </div>
243
+ );
244
+ },
243
245
  },
244
- });
246
+ } satisfies Toolkit;
245
247
 
246
248
  function ArtifactsView() {
247
249
  const [tab, setTab] = useState<"source" | "preview">("source");
@@ -270,7 +272,7 @@ function ArtifactsView() {
270
272
  <button
271
273
  type="button"
272
274
  onClick={() => setTab("source")}
273
- className={`inline-flex flex-1 items-center justify-center gap-2 px-4 py-2.5 font-medium text-sm transition-colors ${
275
+ className={`inline-flex flex-1 items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium transition-colors ${
274
276
  tab === "source"
275
277
  ? "bg-background text-foreground"
276
278
  : "text-muted-foreground hover:text-foreground"
@@ -283,7 +285,7 @@ function ArtifactsView() {
283
285
  type="button"
284
286
  onClick={() => isComplete && setTab("preview")}
285
287
  disabled={!isComplete}
286
- className={`inline-flex flex-1 items-center justify-center gap-2 px-4 py-2.5 font-medium text-sm transition-colors ${
288
+ className={`inline-flex flex-1 items-center justify-center gap-2 px-4 py-2.5 text-sm font-medium transition-colors ${
287
289
  !isComplete
288
290
  ? "cursor-not-allowed opacity-50"
289
291
  : tab === "preview"
@@ -296,7 +298,7 @@ function ArtifactsView() {
296
298
  </button>
297
299
  </div>
298
300
  {tab === "source" || !isComplete ? (
299
- <div className="h-full overflow-y-auto whitespace-pre-line break-words px-4 py-2 font-mono text-sm">
301
+ <div className="h-full overflow-y-auto px-4 py-2 font-mono text-sm break-words whitespace-pre-line">
300
302
  {code}
301
303
  </div>
302
304
  ) : (
@@ -339,14 +341,16 @@ function ThreadWithSuggestions() {
339
341
 
340
342
  export default function Home() {
341
343
  const runtime = useChatRuntime();
344
+ const aui = useAui({
345
+ tools: Tools({ toolkit }),
346
+ });
342
347
 
343
348
  return (
344
- <AssistantRuntimeProvider runtime={runtime}>
349
+ <AssistantRuntimeProvider aui={aui} runtime={runtime}>
345
350
  <main className="flex h-full justify-stretch">
346
351
  <div className="flex-grow basis-full">
347
352
  <ThreadWithSuggestions />
348
353
  </div>
349
- <RenderHTMLTool />
350
354
  <ArtifactsView />
351
355
  </main>
352
356
  </AssistantRuntimeProvider>
@@ -388,6 +392,7 @@ export default function Home() {
388
392
  ## next.config.js
389
393
 
390
394
  ```javascript
395
+ import { withAui } from "@assistant-ui/next";
391
396
  /** @type {import('next').NextConfig} */
392
397
  const nextConfig = {
393
398
  transpilePackages: [
@@ -397,7 +402,7 @@ const nextConfig = {
397
402
  ],
398
403
  };
399
404
 
400
- export default nextConfig;
405
+ export default withAui(nextConfig);
401
406
 
402
407
  ```
403
408
 
@@ -415,15 +420,15 @@ export default nextConfig;
415
420
  "start": "next start"
416
421
  },
417
422
  "dependencies": {
418
- "@ai-sdk/openai": "^3.0.64",
423
+ "@ai-sdk/openai": "^3.0.67",
419
424
  "@assistant-ui/react": "workspace:*",
420
425
  "@assistant-ui/react-ai-sdk": "workspace:*",
421
426
  "@assistant-ui/react-markdown": "workspace:*",
422
427
  "@assistant-ui/ui": "workspace:*",
423
- "ai": "^6.0.188",
428
+ "ai": "^6.0.193",
424
429
  "class-variance-authority": "^0.7.1",
425
430
  "clsx": "^2.1.1",
426
- "lucide-react": "^1.16.0",
431
+ "lucide-react": "^1.17.0",
427
432
  "next": "^16.2.6",
428
433
  "react": "^19.2.6",
429
434
  "react-dom": "^19.2.6",
@@ -431,6 +436,7 @@ export default nextConfig;
431
436
  "zod": "^4.4.3"
432
437
  },
433
438
  "devDependencies": {
439
+ "@assistant-ui/next": "workspace:*",
434
440
  "@assistant-ui/x-buildutils": "workspace:*",
435
441
  "@tailwindcss/postcss": "^4.3.0",
436
442
  "@types/node": "^25.9.1",