@assistant-ui/mcp-docs-server 0.1.24 → 0.1.25
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 -2
- package/.docs/organized/code-examples/with-a2a.md +676 -0
- package/.docs/organized/code-examples/with-ag-ui.md +5 -6
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +27 -15
- package/.docs/organized/code-examples/with-artifacts.md +4 -4
- package/.docs/organized/code-examples/with-assistant-transport.md +2 -2
- package/.docs/organized/code-examples/with-chain-of-thought.md +33 -25
- package/.docs/organized/code-examples/with-cloud-standalone.md +9 -6
- package/.docs/organized/code-examples/with-cloud.md +4 -4
- package/.docs/organized/code-examples/with-custom-thread-list.md +6 -6
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +7 -7
- package/.docs/organized/code-examples/with-expo.md +565 -514
- package/.docs/organized/code-examples/with-external-store.md +2 -2
- package/.docs/organized/code-examples/with-ffmpeg.md +4 -4
- package/.docs/organized/code-examples/with-google-adk.md +353 -0
- package/.docs/organized/code-examples/with-heat-graph.md +304 -0
- package/.docs/organized/code-examples/with-langgraph.md +24 -22
- package/.docs/organized/code-examples/with-parent-id-grouping.md +3 -3
- package/.docs/organized/code-examples/with-react-hook-form.md +4 -4
- package/.docs/organized/code-examples/with-react-ink.md +265 -0
- package/.docs/organized/code-examples/with-react-router.md +5 -5
- package/.docs/organized/code-examples/with-store.md +28 -17
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +5 -3
- package/.docs/raw/blog/2025-01-31-changelog/index.mdx +1 -1
- package/.docs/raw/blog/2026-03-launch-week/index.mdx +227 -0
- package/.docs/raw/docs/(docs)/architecture.mdx +1 -1
- package/.docs/raw/docs/(docs)/cli.mdx +14 -9
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool-ui.mdx +8 -3
- package/.docs/raw/docs/(docs)/copilots/make-assistant-tool.mdx +5 -1
- package/.docs/raw/docs/(docs)/copilots/{make-assistant-readable.mdx → make-assistant-visible.mdx} +14 -5
- package/.docs/raw/docs/(docs)/copilots/model-context.mdx +11 -11
- package/.docs/raw/docs/(docs)/copilots/motivation.mdx +2 -2
- package/.docs/raw/docs/(docs)/devtools.mdx +3 -2
- package/.docs/raw/docs/(docs)/guides/attachments.mdx +9 -11
- package/.docs/raw/docs/(docs)/guides/branching.mdx +11 -6
- package/.docs/raw/docs/(docs)/guides/chain-of-thought.mdx +18 -16
- package/.docs/raw/docs/(docs)/guides/context-api.mdx +81 -43
- package/.docs/raw/docs/(docs)/guides/dictation.mdx +5 -5
- package/.docs/raw/docs/(docs)/guides/editing.mdx +16 -7
- package/.docs/raw/docs/(docs)/guides/latex.mdx +3 -0
- package/.docs/raw/docs/(docs)/guides/message-timing.mdx +2 -1
- package/.docs/raw/docs/(docs)/guides/multi-agent.mdx +173 -0
- package/.docs/raw/docs/(docs)/guides/quoting.mdx +55 -206
- package/.docs/raw/docs/(docs)/guides/speech.mdx +1 -4
- package/.docs/raw/docs/(docs)/guides/suggestions.mdx +9 -15
- package/.docs/raw/docs/(docs)/guides/tool-ui.mdx +17 -7
- package/.docs/raw/docs/(docs)/guides/tools.mdx +24 -9
- package/.docs/raw/docs/(docs)/index.mdx +3 -3
- package/.docs/raw/docs/(docs)/installation.mdx +69 -46
- package/.docs/raw/docs/(reference)/api-reference/context-providers/text-message-part-provider.mdx +20 -6
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-data-stream.mdx +24 -4
- package/.docs/raw/docs/(reference)/api-reference/integrations/react-hook-form.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/integrations/vercel-ai-sdk.mdx +20 -19
- package/.docs/raw/docs/(reference)/api-reference/overview.mdx +28 -53
- package/.docs/raw/docs/(reference)/api-reference/primitives/action-bar.mdx +4 -4
- package/.docs/raw/docs/(reference)/api-reference/primitives/assistant-modal.mdx +7 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/attachment.mdx +20 -14
- package/.docs/raw/docs/(reference)/api-reference/primitives/branch-picker.mdx +1 -1
- package/.docs/raw/docs/(reference)/api-reference/primitives/composer.mdx +99 -45
- package/.docs/raw/docs/(reference)/api-reference/primitives/message-part.mdx +52 -40
- package/.docs/raw/docs/(reference)/api-reference/primitives/message.mdx +343 -23
- package/.docs/raw/docs/(reference)/api-reference/primitives/suggestion.mdx +4 -6
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list-item.mdx +4 -2
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread-list.mdx +3 -5
- package/.docs/raw/docs/(reference)/api-reference/primitives/thread.mdx +169 -22
- package/.docs/raw/docs/(reference)/api-reference/runtimes/assistant-runtime.mdx +14 -4
- package/.docs/raw/docs/(reference)/api-reference/runtimes/attachment-runtime.mdx +15 -26
- package/.docs/raw/docs/(reference)/api-reference/runtimes/composer-runtime.mdx +39 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-part-runtime.mdx +33 -9
- package/.docs/raw/docs/(reference)/api-reference/runtimes/message-runtime.mdx +48 -21
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-item-runtime.mdx +36 -7
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-list-runtime.mdx +30 -10
- package/.docs/raw/docs/(reference)/api-reference/runtimes/thread-runtime.mdx +12 -10
- package/.docs/raw/docs/(reference)/migrations/deprecation-policy.mdx +1 -1
- package/.docs/raw/docs/(reference)/migrations/react-langgraph-v0-7.mdx +9 -4
- package/.docs/raw/docs/(reference)/migrations/v0-11.mdx +7 -5
- package/.docs/raw/docs/(reference)/migrations/v0-12.mdx +9 -7
- package/.docs/raw/docs/(reference)/migrations/v0-14.mdx +159 -0
- package/.docs/raw/docs/(reference)/react-compatibility.mdx +5 -134
- package/.docs/raw/docs/cloud/ai-sdk-assistant-ui.mdx +84 -6
- package/.docs/raw/docs/cloud/ai-sdk.mdx +14 -4
- package/.docs/raw/docs/cloud/langgraph.mdx +13 -3
- package/.docs/raw/docs/ink/adapters.mdx +41 -0
- package/.docs/raw/docs/ink/custom-backend.mdx +203 -0
- package/.docs/raw/docs/ink/hooks.mdx +448 -0
- package/.docs/raw/docs/ink/index.mdx +239 -0
- package/.docs/raw/docs/ink/migration.mdx +140 -0
- package/.docs/raw/docs/ink/primitives.mdx +699 -0
- package/.docs/raw/docs/react-native/adapters.mdx +63 -87
- package/.docs/raw/docs/react-native/custom-backend.mdx +11 -14
- package/.docs/raw/docs/react-native/hooks.mdx +214 -232
- package/.docs/raw/docs/react-native/index.mdx +118 -159
- package/.docs/raw/docs/react-native/migration.mdx +144 -0
- package/.docs/raw/docs/react-native/primitives.mdx +431 -302
- package/.docs/raw/docs/runtimes/a2a/index.mdx +294 -0
- package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +9 -9
- package/.docs/raw/docs/runtimes/ai-sdk/v5-legacy.mdx +14 -3
- package/.docs/raw/docs/runtimes/assistant-transport.mdx +59 -25
- package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +13 -6
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +138 -38
- package/.docs/raw/docs/runtimes/custom/local.mdx +184 -42
- package/.docs/raw/docs/runtimes/data-stream.mdx +92 -19
- package/.docs/raw/docs/runtimes/google-adk/index.mdx +624 -0
- package/.docs/raw/docs/runtimes/helicone.mdx +6 -6
- package/.docs/raw/docs/runtimes/langgraph/index.mdx +38 -27
- package/.docs/raw/docs/runtimes/langgraph/tutorial/introduction.mdx +1 -1
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-1.mdx +15 -20
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +7 -11
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +8 -11
- package/.docs/raw/docs/runtimes/langserve.mdx +6 -7
- package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +18 -3
- package/.docs/raw/docs/ui/file.mdx +5 -4
- package/.docs/raw/docs/ui/image.mdx +5 -4
- package/.docs/raw/docs/ui/markdown.mdx +3 -1
- package/.docs/raw/docs/ui/model-selector.mdx +8 -8
- package/.docs/raw/docs/ui/part-grouping.mdx +7 -10
- package/.docs/raw/docs/ui/quote.mdx +210 -0
- package/.docs/raw/docs/ui/reasoning.mdx +12 -11
- package/.docs/raw/docs/ui/sources.mdx +88 -17
- package/.docs/raw/docs/ui/streamdown.mdx +16 -7
- package/.docs/raw/docs/ui/thread-list.mdx +11 -13
- package/.docs/raw/docs/ui/thread.mdx +28 -33
- package/.docs/raw/docs/ui/tool-fallback.mdx +5 -6
- package/.docs/raw/docs/ui/tool-group.mdx +9 -8
- package/.docs/raw/docs/utilities/heat-graph.mdx +236 -0
- package/.docs/raw/docs/utilities/tw-shimmer.mdx +211 -0
- package/package.json +4 -4
- package/.docs/raw/docs/(reference)/legacy/styled/assistant-modal.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/decomposition.mdx +0 -635
- package/.docs/raw/docs/(reference)/legacy/styled/markdown.mdx +0 -77
- package/.docs/raw/docs/(reference)/legacy/styled/scrollbar.mdx +0 -72
- package/.docs/raw/docs/(reference)/legacy/styled/thread-width.mdx +0 -22
- package/.docs/raw/docs/(reference)/legacy/styled/thread.mdx +0 -77
- /package/.docs/raw/docs/cloud/{overview.mdx → index.mdx} +0 -0
|
@@ -319,7 +319,7 @@ export default nextConfig;
|
|
|
319
319
|
"@assistant-ui/ui": "workspace:*",
|
|
320
320
|
"class-variance-authority": "^0.7.1",
|
|
321
321
|
"clsx": "^2.1.1",
|
|
322
|
-
"lucide-react": "^0.
|
|
322
|
+
"lucide-react": "^0.577.0",
|
|
323
323
|
"next": "^16.1.6",
|
|
324
324
|
"react": "^19.2.4",
|
|
325
325
|
"react-dom": "^19.2.4",
|
|
@@ -328,7 +328,7 @@ export default nextConfig;
|
|
|
328
328
|
"devDependencies": {
|
|
329
329
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
330
330
|
"@tailwindcss/postcss": "^4.2.1",
|
|
331
|
-
"@types/node": "^25.
|
|
331
|
+
"@types/node": "^25.5.0",
|
|
332
332
|
"@types/react": "^19.2.14",
|
|
333
333
|
"@types/react-dom": "^19.2.3",
|
|
334
334
|
"postcss": "^8.5.8",
|
|
@@ -523,17 +523,17 @@ export default nextConfig;
|
|
|
523
523
|
"start": "next start"
|
|
524
524
|
},
|
|
525
525
|
"dependencies": {
|
|
526
|
-
"@ai-sdk/openai": "^3.0.
|
|
526
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
527
527
|
"@assistant-ui/react": "workspace:*",
|
|
528
528
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
529
529
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
530
530
|
"@assistant-ui/ui": "workspace:*",
|
|
531
531
|
"@ffmpeg/ffmpeg": "^0.12.15",
|
|
532
532
|
"@ffmpeg/util": "^0.12.2",
|
|
533
|
-
"ai": "^6.0.
|
|
533
|
+
"ai": "^6.0.116",
|
|
534
534
|
"class-variance-authority": "^0.7.1",
|
|
535
535
|
"clsx": "^2.1.1",
|
|
536
|
-
"lucide-react": "^0.
|
|
536
|
+
"lucide-react": "^0.577.0",
|
|
537
537
|
"next": "^16.1.6",
|
|
538
538
|
"react": "^19.2.4",
|
|
539
539
|
"react-dom": "^19.2.4",
|
|
@@ -543,7 +543,7 @@ export default nextConfig;
|
|
|
543
543
|
"devDependencies": {
|
|
544
544
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
545
545
|
"@tailwindcss/postcss": "^4.2.1",
|
|
546
|
-
"@types/node": "^25.
|
|
546
|
+
"@types/node": "^25.5.0",
|
|
547
547
|
"@types/react": "^19.2.14",
|
|
548
548
|
"@types/react-dom": "^19.2.3",
|
|
549
549
|
"postcss": "^8.5.8",
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# Example: with-google-adk
|
|
2
|
+
|
|
3
|
+
## app/api/chat/route.ts
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { createAdkApiRoute } from "@assistant-ui/react-google-adk/server";
|
|
7
|
+
import { InMemoryRunner, LlmAgent, FunctionTool } from "@google/adk";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
|
|
10
|
+
const weatherTool = new FunctionTool({
|
|
11
|
+
name: "get_weather",
|
|
12
|
+
description: "Get the current weather for a city.",
|
|
13
|
+
parameters: z.object({
|
|
14
|
+
city: z.string().describe("The city name"),
|
|
15
|
+
}),
|
|
16
|
+
execute: async ({ city }) => {
|
|
17
|
+
return {
|
|
18
|
+
city,
|
|
19
|
+
temperature: Math.round(15 + Math.random() * 20),
|
|
20
|
+
condition: ["sunny", "cloudy", "rainy", "snowy"][
|
|
21
|
+
Math.floor(Math.random() * 4)
|
|
22
|
+
],
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const agent = new LlmAgent({
|
|
28
|
+
name: "assistant",
|
|
29
|
+
model: "gemini-2.5-flash",
|
|
30
|
+
instruction:
|
|
31
|
+
"You are a helpful assistant. You can check the weather for any city using the get_weather tool.",
|
|
32
|
+
tools: [weatherTool],
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const runner = new InMemoryRunner({ agent, appName: "adk-example" });
|
|
36
|
+
|
|
37
|
+
const sessions = new Map<string, string>();
|
|
38
|
+
|
|
39
|
+
export const POST = createAdkApiRoute({
|
|
40
|
+
runner,
|
|
41
|
+
userId: "user_1",
|
|
42
|
+
sessionId: async () => {
|
|
43
|
+
const userId = "user_1";
|
|
44
|
+
let sessionId = sessions.get(userId);
|
|
45
|
+
if (!sessionId) {
|
|
46
|
+
const session = await runner.sessionService.createSession({
|
|
47
|
+
appName: "adk-example",
|
|
48
|
+
userId,
|
|
49
|
+
});
|
|
50
|
+
sessionId = session.id;
|
|
51
|
+
sessions.set(userId, sessionId);
|
|
52
|
+
}
|
|
53
|
+
return sessionId;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## app/globals.css
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@import "tailwindcss";
|
|
63
|
+
@import "tw-animate-css";
|
|
64
|
+
|
|
65
|
+
@source "../../../packages/ui/src";
|
|
66
|
+
|
|
67
|
+
@custom-variant dark (&:is(.dark *));
|
|
68
|
+
|
|
69
|
+
@theme inline {
|
|
70
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
71
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
72
|
+
--radius-lg: var(--radius);
|
|
73
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
74
|
+
--color-background: var(--background);
|
|
75
|
+
--color-foreground: var(--foreground);
|
|
76
|
+
--color-card: var(--card);
|
|
77
|
+
--color-card-foreground: var(--card-foreground);
|
|
78
|
+
--color-popover: var(--popover);
|
|
79
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
80
|
+
--color-primary: var(--primary);
|
|
81
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
82
|
+
--color-secondary: var(--secondary);
|
|
83
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
84
|
+
--color-muted: var(--muted);
|
|
85
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
86
|
+
--color-accent: var(--accent);
|
|
87
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
88
|
+
--color-destructive: var(--destructive);
|
|
89
|
+
--color-border: var(--border);
|
|
90
|
+
--color-input: var(--input);
|
|
91
|
+
--color-ring: var(--ring);
|
|
92
|
+
--color-chart-1: var(--chart-1);
|
|
93
|
+
--color-chart-2: var(--chart-2);
|
|
94
|
+
--color-chart-3: var(--chart-3);
|
|
95
|
+
--color-chart-4: var(--chart-4);
|
|
96
|
+
--color-chart-5: var(--chart-5);
|
|
97
|
+
--color-sidebar: var(--sidebar);
|
|
98
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
99
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
100
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
101
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
102
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
103
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
104
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:root {
|
|
108
|
+
--radius: 0.625rem;
|
|
109
|
+
--background: oklch(1 0 0);
|
|
110
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
111
|
+
--card: oklch(1 0 0);
|
|
112
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
113
|
+
--popover: oklch(1 0 0);
|
|
114
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
115
|
+
--primary: oklch(0.21 0.006 285.885);
|
|
116
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
117
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
118
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
119
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
120
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
121
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
122
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
123
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
124
|
+
--border: oklch(0.92 0.004 286.32);
|
|
125
|
+
--input: oklch(0.92 0.004 286.32);
|
|
126
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
127
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
128
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
129
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
130
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
131
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
132
|
+
--sidebar: oklch(0.985 0 0);
|
|
133
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
134
|
+
--sidebar-primary: oklch(0.21 0.006 285.885);
|
|
135
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
136
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
137
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
138
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
139
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.dark {
|
|
143
|
+
--background: oklch(0.141 0.005 285.823);
|
|
144
|
+
--foreground: oklch(0.985 0 0);
|
|
145
|
+
--card: oklch(0.21 0.006 285.885);
|
|
146
|
+
--card-foreground: oklch(0.985 0 0);
|
|
147
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
148
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
149
|
+
--primary: oklch(0.92 0.004 286.32);
|
|
150
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
151
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
152
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
153
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
154
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
155
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
156
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
157
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
158
|
+
--border: oklch(1 0 0 / 10%);
|
|
159
|
+
--input: oklch(1 0 0 / 15%);
|
|
160
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
161
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
162
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
163
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
164
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
165
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
166
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
167
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
168
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
169
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
170
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
171
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
172
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
173
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@layer base {
|
|
177
|
+
* {
|
|
178
|
+
@apply border-border outline-ring/50;
|
|
179
|
+
}
|
|
180
|
+
body {
|
|
181
|
+
@apply bg-background text-foreground;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## app/layout.tsx
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
import type { Metadata } from "next";
|
|
191
|
+
import { MyRuntimeProvider } from "@/app/MyRuntimeProvider";
|
|
192
|
+
import "./globals.css";
|
|
193
|
+
|
|
194
|
+
export const metadata: Metadata = {
|
|
195
|
+
title: "Google ADK Example",
|
|
196
|
+
description: "Example using @assistant-ui/react with Google ADK",
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export default function RootLayout({
|
|
200
|
+
children,
|
|
201
|
+
}: Readonly<{
|
|
202
|
+
children: React.ReactNode;
|
|
203
|
+
}>) {
|
|
204
|
+
return (
|
|
205
|
+
<html lang="en">
|
|
206
|
+
<body className="h-dvh">
|
|
207
|
+
<MyRuntimeProvider>{children}</MyRuntimeProvider>
|
|
208
|
+
</body>
|
|
209
|
+
</html>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## app/MyRuntimeProvider.tsx
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
"use client";
|
|
219
|
+
|
|
220
|
+
import { AssistantRuntimeProvider } from "@assistant-ui/react";
|
|
221
|
+
import { useAdkRuntime, createAdkStream } from "@assistant-ui/react-google-adk";
|
|
222
|
+
|
|
223
|
+
export function MyRuntimeProvider({ children }: { children: React.ReactNode }) {
|
|
224
|
+
const runtime = useAdkRuntime({
|
|
225
|
+
stream: createAdkStream({ api: "/api/chat" }),
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
return (
|
|
229
|
+
<AssistantRuntimeProvider runtime={runtime}>
|
|
230
|
+
{children}
|
|
231
|
+
</AssistantRuntimeProvider>
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## app/page.tsx
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
"use client";
|
|
241
|
+
|
|
242
|
+
import { Thread } from "@/components/assistant-ui/thread";
|
|
243
|
+
import { useAui, AuiProvider, Suggestions } from "@assistant-ui/react";
|
|
244
|
+
|
|
245
|
+
function ThreadWithSuggestions() {
|
|
246
|
+
const aui = useAui({
|
|
247
|
+
suggestions: Suggestions([
|
|
248
|
+
{
|
|
249
|
+
title: "What can you do",
|
|
250
|
+
label: "as a Gemini-powered agent?",
|
|
251
|
+
prompt: "What can you do?",
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
title: "Tell me about",
|
|
255
|
+
label: "the Google ADK framework",
|
|
256
|
+
prompt: "Tell me about Google ADK and what it enables.",
|
|
257
|
+
},
|
|
258
|
+
]),
|
|
259
|
+
});
|
|
260
|
+
return (
|
|
261
|
+
<AuiProvider value={aui}>
|
|
262
|
+
<Thread />
|
|
263
|
+
</AuiProvider>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export default function Home() {
|
|
268
|
+
return (
|
|
269
|
+
<div className="h-dvh">
|
|
270
|
+
<ThreadWithSuggestions />
|
|
271
|
+
</div>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## next.config.js
|
|
278
|
+
|
|
279
|
+
```javascript
|
|
280
|
+
/** @type {import('next').NextConfig} */
|
|
281
|
+
const nextConfig = {
|
|
282
|
+
transpilePackages: ["@assistant-ui/react", "@assistant-ui/react-google-adk"],
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export default nextConfig;
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## package.json
|
|
290
|
+
|
|
291
|
+
```json
|
|
292
|
+
{
|
|
293
|
+
"name": "with-google-adk",
|
|
294
|
+
"version": "0.0.0",
|
|
295
|
+
"private": true,
|
|
296
|
+
"type": "module",
|
|
297
|
+
"scripts": {
|
|
298
|
+
"dev": "next dev",
|
|
299
|
+
"build": "next build",
|
|
300
|
+
"start": "next start"
|
|
301
|
+
},
|
|
302
|
+
"dependencies": {
|
|
303
|
+
"@assistant-ui/react": "workspace:*",
|
|
304
|
+
"@assistant-ui/react-google-adk": "workspace:*",
|
|
305
|
+
"@assistant-ui/react-markdown": "workspace:*",
|
|
306
|
+
"@assistant-ui/ui": "workspace:*",
|
|
307
|
+
"@google/adk": "^0.5.0",
|
|
308
|
+
"class-variance-authority": "^0.7.1",
|
|
309
|
+
"clsx": "^2.1.1",
|
|
310
|
+
"lucide-react": "^0.577.0",
|
|
311
|
+
"next": "^16.1.6",
|
|
312
|
+
"react": "^19.2.4",
|
|
313
|
+
"react-dom": "^19.2.4",
|
|
314
|
+
"tailwind-merge": "^3.5.0",
|
|
315
|
+
"zod": "^4.3.6"
|
|
316
|
+
},
|
|
317
|
+
"devDependencies": {
|
|
318
|
+
"@assistant-ui/x-buildutils": "workspace:*",
|
|
319
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
320
|
+
"@types/node": "^25.5.0",
|
|
321
|
+
"@types/react": "^19.2.14",
|
|
322
|
+
"@types/react-dom": "^19.2.3",
|
|
323
|
+
"postcss": "^8.5.8",
|
|
324
|
+
"tailwindcss": "^4.2.1",
|
|
325
|
+
"tw-animate-css": "^1.4.0",
|
|
326
|
+
"typescript": "^5.9.3"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## tsconfig.json
|
|
333
|
+
|
|
334
|
+
```json
|
|
335
|
+
{
|
|
336
|
+
"extends": "@assistant-ui/x-buildutils/ts/next",
|
|
337
|
+
"compilerOptions": {
|
|
338
|
+
"paths": {
|
|
339
|
+
"@/*": ["./*"],
|
|
340
|
+
"@/components/assistant-ui/*": [
|
|
341
|
+
"../../packages/ui/src/components/assistant-ui/*"
|
|
342
|
+
],
|
|
343
|
+
"@/components/ui/*": ["../../packages/ui/src/components/ui/*"],
|
|
344
|
+
"@/lib/utils": ["../../packages/ui/src/lib/utils"],
|
|
345
|
+
"@assistant-ui/ui/*": ["../../packages/ui/src/*"]
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
349
|
+
"exclude": ["node_modules"]
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
```
|
|
353
|
+
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Example: with-heat-graph
|
|
2
|
+
|
|
3
|
+
## app/globals.css
|
|
4
|
+
|
|
5
|
+
```css
|
|
6
|
+
@import "tailwindcss";
|
|
7
|
+
|
|
8
|
+
:root {
|
|
9
|
+
--background: #ffffff;
|
|
10
|
+
--foreground: #171717;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@theme inline {
|
|
14
|
+
--color-background: var(--background);
|
|
15
|
+
--color-foreground: var(--foreground);
|
|
16
|
+
--font-sans: var(--font-geist-sans);
|
|
17
|
+
--font-mono: var(--font-geist-mono);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
body {
|
|
21
|
+
background: var(--background);
|
|
22
|
+
color: var(--foreground);
|
|
23
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## app/layout.tsx
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import type { Metadata } from "next";
|
|
32
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
33
|
+
import "./globals.css";
|
|
34
|
+
|
|
35
|
+
const geistSans = Geist({
|
|
36
|
+
variable: "--font-geist-sans",
|
|
37
|
+
subsets: ["latin"],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const geistMono = Geist_Mono({
|
|
41
|
+
variable: "--font-geist-mono",
|
|
42
|
+
subsets: ["latin"],
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const metadata: Metadata = {
|
|
46
|
+
title: "Heat Graph Example",
|
|
47
|
+
description: "Activity heatmap graph built with heat-graph",
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default function RootLayout({
|
|
51
|
+
children,
|
|
52
|
+
}: Readonly<{
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
}>) {
|
|
55
|
+
return (
|
|
56
|
+
<html lang="en">
|
|
57
|
+
<body
|
|
58
|
+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
59
|
+
>
|
|
60
|
+
{children}
|
|
61
|
+
</body>
|
|
62
|
+
</html>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## app/page.tsx
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
import { ActivityGraph } from "@/lib/activity-graph";
|
|
72
|
+
import { generateSampleData } from "@/lib/generate-data";
|
|
73
|
+
|
|
74
|
+
const data = generateSampleData(new Date("2026-03-11"), 365);
|
|
75
|
+
|
|
76
|
+
export default function Home() {
|
|
77
|
+
return (
|
|
78
|
+
<div className="min-h-screen bg-white p-8">
|
|
79
|
+
<div className="mx-auto max-w-4xl">
|
|
80
|
+
<h1 className="mb-6 font-bold text-3xl text-gray-900">
|
|
81
|
+
Activity Graph
|
|
82
|
+
</h1>
|
|
83
|
+
<div className="rounded-xl border border-gray-200 bg-white p-6">
|
|
84
|
+
<ActivityGraph data={data} />
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## lib/activity-graph.tsx
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
"use client";
|
|
97
|
+
|
|
98
|
+
import * as HeatGraph from "heat-graph";
|
|
99
|
+
|
|
100
|
+
const COLORS = ["#ebedf0", "#c6d7f9", "#8fb0f3", "#5888e8", "#2563eb"];
|
|
101
|
+
|
|
102
|
+
export function ActivityGraph({ data }: { data: HeatGraph.DataPoint[] }) {
|
|
103
|
+
return (
|
|
104
|
+
<HeatGraph.Root
|
|
105
|
+
data={data}
|
|
106
|
+
weekStart="monday"
|
|
107
|
+
colorScale={COLORS}
|
|
108
|
+
className="flex flex-col gap-2"
|
|
109
|
+
>
|
|
110
|
+
<MonthLabels />
|
|
111
|
+
<div className="flex gap-2">
|
|
112
|
+
<DayLabels />
|
|
113
|
+
<CellGrid />
|
|
114
|
+
</div>
|
|
115
|
+
<GraphLegend />
|
|
116
|
+
<CellTooltip />
|
|
117
|
+
</HeatGraph.Root>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function MonthLabels() {
|
|
122
|
+
return (
|
|
123
|
+
<div className="relative ml-10 h-5">
|
|
124
|
+
<HeatGraph.MonthLabels>
|
|
125
|
+
{({ label, totalWeeks }) => (
|
|
126
|
+
<span
|
|
127
|
+
className="absolute text-gray-500 text-xs"
|
|
128
|
+
style={{ left: `${(label.column / totalWeeks) * 100}%` }}
|
|
129
|
+
>
|
|
130
|
+
{HeatGraph.MONTH_SHORT[label.month]}
|
|
131
|
+
</span>
|
|
132
|
+
)}
|
|
133
|
+
</HeatGraph.MonthLabels>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function DayLabels() {
|
|
139
|
+
return (
|
|
140
|
+
<div className="flex w-8 shrink-0 flex-col justify-between py-[2px]">
|
|
141
|
+
<HeatGraph.DayLabels>
|
|
142
|
+
{({ label }) => (
|
|
143
|
+
<span className="flex h-[13px] items-center text-gray-500 text-xs">
|
|
144
|
+
{label.row % 2 === 0 ? HeatGraph.DAY_SHORT[label.dayOfWeek] : ""}
|
|
145
|
+
</span>
|
|
146
|
+
)}
|
|
147
|
+
</HeatGraph.DayLabels>
|
|
148
|
+
</div>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function CellGrid() {
|
|
153
|
+
return (
|
|
154
|
+
<HeatGraph.Grid className="flex-1 gap-[3px]">
|
|
155
|
+
{() => <HeatGraph.Cell className="aspect-square w-full rounded-sm" />}
|
|
156
|
+
</HeatGraph.Grid>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function CellTooltip() {
|
|
161
|
+
return (
|
|
162
|
+
<HeatGraph.Tooltip className="pointer-events-none whitespace-nowrap rounded-md bg-gray-900 px-3 py-1.5 text-white text-xs shadow-lg">
|
|
163
|
+
{({ cell }) => (
|
|
164
|
+
<>
|
|
165
|
+
<strong>{cell.count} contributions</strong> on{" "}
|
|
166
|
+
{cell.date.toLocaleDateString("en-US", {
|
|
167
|
+
month: "short",
|
|
168
|
+
day: "numeric",
|
|
169
|
+
year: "numeric",
|
|
170
|
+
})}
|
|
171
|
+
</>
|
|
172
|
+
)}
|
|
173
|
+
</HeatGraph.Tooltip>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function GraphLegend() {
|
|
178
|
+
return (
|
|
179
|
+
<div className="ml-auto flex items-center gap-1 text-gray-500 text-xs">
|
|
180
|
+
<span>Less</span>
|
|
181
|
+
<HeatGraph.Legend>
|
|
182
|
+
{() => (
|
|
183
|
+
<HeatGraph.LegendLevel className="h-[13px] w-[13px] rounded-sm" />
|
|
184
|
+
)}
|
|
185
|
+
</HeatGraph.Legend>
|
|
186
|
+
<span>More</span>
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## lib/generate-data.ts
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
import type { DataPoint } from "heat-graph";
|
|
197
|
+
|
|
198
|
+
function seededRandom(seed: number) {
|
|
199
|
+
let s = seed;
|
|
200
|
+
return () => {
|
|
201
|
+
s = (s * 16807 + 0) % 2147483647;
|
|
202
|
+
return s / 2147483647;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function generateSampleData(
|
|
207
|
+
end: Date = new Date(),
|
|
208
|
+
days = 365,
|
|
209
|
+
): DataPoint[] {
|
|
210
|
+
const data: DataPoint[] = [];
|
|
211
|
+
const rand = seededRandom(42);
|
|
212
|
+
|
|
213
|
+
for (let i = 0; i < days; i++) {
|
|
214
|
+
const date = new Date(end);
|
|
215
|
+
date.setDate(date.getDate() - (days - 1 - i));
|
|
216
|
+
|
|
217
|
+
const dayOfWeek = date.getDay();
|
|
218
|
+
const isWeekend = dayOfWeek === 0 || dayOfWeek === 6;
|
|
219
|
+
|
|
220
|
+
// Base activity: higher on weekdays
|
|
221
|
+
const base = isWeekend ? 2 : 8;
|
|
222
|
+
const noise = rand();
|
|
223
|
+
|
|
224
|
+
// Create some streaks and gaps
|
|
225
|
+
const monthProgress = date.getDate() / 31;
|
|
226
|
+
const monthBoost = Math.sin(monthProgress * Math.PI) * 5;
|
|
227
|
+
|
|
228
|
+
// Some days have no activity
|
|
229
|
+
if (noise < 0.15) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const count = Math.max(0, Math.round(base + monthBoost + noise * 12 - 3));
|
|
234
|
+
|
|
235
|
+
if (count > 0) {
|
|
236
|
+
data.push({ date, count });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return data;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## next.config.ts
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import type { NextConfig } from "next";
|
|
249
|
+
|
|
250
|
+
const nextConfig: NextConfig = {
|
|
251
|
+
/* config options here */
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export default nextConfig;
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## package.json
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"name": "with-heat-graph",
|
|
263
|
+
"version": "0.0.0",
|
|
264
|
+
"private": true,
|
|
265
|
+
"type": "module",
|
|
266
|
+
"scripts": {
|
|
267
|
+
"dev": "next dev",
|
|
268
|
+
"build": "next build",
|
|
269
|
+
"start": "next start"
|
|
270
|
+
},
|
|
271
|
+
"dependencies": {
|
|
272
|
+
"heat-graph": "workspace:*",
|
|
273
|
+
"next": "^16.1.6",
|
|
274
|
+
"react": "^19.2.4",
|
|
275
|
+
"react-dom": "^19.2.4"
|
|
276
|
+
},
|
|
277
|
+
"devDependencies": {
|
|
278
|
+
"@assistant-ui/x-buildutils": "workspace:*",
|
|
279
|
+
"@tailwindcss/postcss": "^4.2.1",
|
|
280
|
+
"@types/node": "^25.5.0",
|
|
281
|
+
"@types/react": "^19.2.14",
|
|
282
|
+
"@types/react-dom": "^19.2.3",
|
|
283
|
+
"postcss": "^8.5.8",
|
|
284
|
+
"tailwindcss": "^4.2.1",
|
|
285
|
+
"typescript": "^5.9.3"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## tsconfig.json
|
|
292
|
+
|
|
293
|
+
```json
|
|
294
|
+
{
|
|
295
|
+
"extends": "@assistant-ui/x-buildutils/ts/next",
|
|
296
|
+
"compilerOptions": {
|
|
297
|
+
"paths": { "@/*": ["./*"] }
|
|
298
|
+
},
|
|
299
|
+
"include": ["**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
300
|
+
"exclude": ["node_modules"]
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
```
|
|
304
|
+
|