@assistant-ui/mcp-docs-server 0.1.23 → 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 +5 -3
- package/.docs/organized/code-examples/with-a2a.md +676 -0
- package/.docs/organized/code-examples/with-ag-ui.md +7 -8
- package/.docs/organized/code-examples/with-ai-sdk-v6.md +28 -16
- package/.docs/organized/code-examples/with-artifacts.md +5 -5
- package/.docs/organized/code-examples/with-assistant-transport.md +3 -3
- package/.docs/organized/code-examples/with-chain-of-thought.md +34 -26
- package/.docs/organized/code-examples/with-cloud-standalone.md +10 -8
- package/.docs/organized/code-examples/with-cloud.md +5 -5
- package/.docs/organized/code-examples/with-custom-thread-list.md +7 -7
- package/.docs/organized/code-examples/with-elevenlabs-scribe.md +8 -8
- package/.docs/organized/code-examples/with-expo.md +571 -539
- package/.docs/organized/code-examples/with-external-store.md +3 -4
- package/.docs/organized/code-examples/with-ffmpeg.md +5 -5
- 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 +25 -23
- package/.docs/organized/code-examples/with-parent-id-grouping.md +4 -4
- package/.docs/organized/code-examples/with-react-hook-form.md +6 -9
- package/.docs/organized/code-examples/with-react-ink.md +265 -0
- package/.docs/organized/code-examples/with-react-router.md +10 -11
- package/.docs/organized/code-examples/with-store.md +29 -18
- package/.docs/organized/code-examples/with-tanstack.md +7 -7
- package/.docs/organized/code-examples/with-tap-runtime.md +6 -4
- 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 +89 -7
- package/.docs/raw/docs/cloud/ai-sdk.mdx +19 -5
- 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/ai-sdk/v6.mdx +53 -0
- 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/context-display.mdx +147 -0
- 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
|
@@ -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
|
+
|
|
@@ -40,19 +40,26 @@ async function handleRequest(req: NextRequest, method: string) {
|
|
|
40
40
|
options,
|
|
41
41
|
);
|
|
42
42
|
|
|
43
|
+
const headers = new Headers(res.headers);
|
|
44
|
+
headers.delete("content-encoding");
|
|
45
|
+
headers.delete("content-length");
|
|
46
|
+
headers.delete("transfer-encoding");
|
|
47
|
+
const corsHeaders = getCorsHeaders();
|
|
48
|
+
for (const [key, value] of Object.entries(corsHeaders)) {
|
|
49
|
+
headers.set(key, value);
|
|
50
|
+
}
|
|
51
|
+
|
|
43
52
|
return new NextResponse(res.body, {
|
|
44
53
|
status: res.status,
|
|
45
54
|
statusText: res.statusText,
|
|
46
|
-
headers
|
|
47
|
-
...res.headers,
|
|
48
|
-
...getCorsHeaders(),
|
|
49
|
-
},
|
|
55
|
+
headers,
|
|
50
56
|
});
|
|
51
57
|
} catch (e: unknown) {
|
|
52
58
|
if (e instanceof Error) {
|
|
59
|
+
const typedError = e as Error & { status?: number };
|
|
53
60
|
return NextResponse.json(
|
|
54
|
-
{ error:
|
|
55
|
-
{ status:
|
|
61
|
+
{ error: typedError.message },
|
|
62
|
+
{ status: typedError.status ?? 500 },
|
|
56
63
|
);
|
|
57
64
|
}
|
|
58
65
|
return NextResponse.json({ error: "Unknown error" }, { status: 500 });
|
|
@@ -64,16 +71,11 @@ export const POST = (req: NextRequest) => handleRequest(req, "POST");
|
|
|
64
71
|
export const PUT = (req: NextRequest) => handleRequest(req, "PUT");
|
|
65
72
|
export const PATCH = (req: NextRequest) => handleRequest(req, "PATCH");
|
|
66
73
|
export const DELETE = (req: NextRequest) => handleRequest(req, "DELETE");
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export const OPTIONS = () => {
|
|
70
|
-
return new NextResponse(null, {
|
|
74
|
+
export const OPTIONS = () =>
|
|
75
|
+
new NextResponse(null, {
|
|
71
76
|
status: 204,
|
|
72
|
-
headers:
|
|
73
|
-
...getCorsHeaders(),
|
|
74
|
-
},
|
|
77
|
+
headers: getCorsHeaders(),
|
|
75
78
|
});
|
|
76
|
-
};
|
|
77
79
|
|
|
78
80
|
```
|
|
79
81
|
|
|
@@ -735,14 +737,14 @@ const createClient = () => {
|
|
|
735
737
|
});
|
|
736
738
|
};
|
|
737
739
|
|
|
738
|
-
export const
|
|
740
|
+
export const createThread = async () => {
|
|
739
741
|
const client = createClient();
|
|
740
|
-
return client.
|
|
742
|
+
return client.threads.create();
|
|
741
743
|
};
|
|
742
744
|
|
|
743
|
-
export const
|
|
745
|
+
export const createAssistant = async (graphId: string) => {
|
|
744
746
|
const client = createClient();
|
|
745
|
-
return client.
|
|
747
|
+
return client.assistants.create({ graphId });
|
|
746
748
|
};
|
|
747
749
|
|
|
748
750
|
export const getThreadState = async (
|
|
@@ -822,7 +824,7 @@ export const sendMessage = (params: {
|
|
|
822
824
|
model_name: "openai",
|
|
823
825
|
},
|
|
824
826
|
},
|
|
825
|
-
streamMode: "messages-tuple",
|
|
827
|
+
streamMode: ["messages-tuple", "values"],
|
|
826
828
|
...(checkpointId && { checkpoint_id: checkpointId }),
|
|
827
829
|
...restConfig,
|
|
828
830
|
},
|
|
@@ -869,10 +871,10 @@ export default nextConfig;
|
|
|
869
871
|
"@assistant-ui/react-langgraph": "workspace:*",
|
|
870
872
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
871
873
|
"@assistant-ui/ui": "workspace:*",
|
|
872
|
-
"@langchain/langgraph-sdk": "^1.
|
|
874
|
+
"@langchain/langgraph-sdk": "^1.7.2",
|
|
873
875
|
"class-variance-authority": "^0.7.1",
|
|
874
876
|
"clsx": "^2.1.1",
|
|
875
|
-
"lucide-react": "^0.
|
|
877
|
+
"lucide-react": "^0.577.0",
|
|
876
878
|
"next": "^16.1.6",
|
|
877
879
|
"react": "^19.2.4",
|
|
878
880
|
"react-dom": "^19.2.4",
|
|
@@ -881,10 +883,10 @@ export default nextConfig;
|
|
|
881
883
|
"devDependencies": {
|
|
882
884
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
883
885
|
"@tailwindcss/postcss": "^4.2.1",
|
|
884
|
-
"@types/node": "^25.
|
|
886
|
+
"@types/node": "^25.5.0",
|
|
885
887
|
"@types/react": "^19.2.14",
|
|
886
888
|
"@types/react-dom": "^19.2.3",
|
|
887
|
-
"postcss": "^8.5.
|
|
889
|
+
"postcss": "^8.5.8",
|
|
888
890
|
"tailwindcss": "^4.2.1",
|
|
889
891
|
"tw-animate-css": "^1.4.0",
|
|
890
892
|
"typescript": "^5.9.3"
|
|
@@ -474,13 +474,13 @@ export default nextConfig;
|
|
|
474
474
|
"start": "next start"
|
|
475
475
|
},
|
|
476
476
|
"dependencies": {
|
|
477
|
-
"@ai-sdk/openai": "^3.0.
|
|
477
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
478
478
|
"@assistant-ui/react": "workspace:*",
|
|
479
479
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
480
480
|
"@assistant-ui/ui": "workspace:*",
|
|
481
481
|
"class-variance-authority": "^0.7.1",
|
|
482
482
|
"clsx": "^2.1.1",
|
|
483
|
-
"lucide-react": "^0.
|
|
483
|
+
"lucide-react": "^0.577.0",
|
|
484
484
|
"next": "^16.1.6",
|
|
485
485
|
"react": "^19.2.4",
|
|
486
486
|
"react-dom": "^19.2.4",
|
|
@@ -489,10 +489,10 @@ export default nextConfig;
|
|
|
489
489
|
"devDependencies": {
|
|
490
490
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
491
491
|
"@tailwindcss/postcss": "^4.2.1",
|
|
492
|
-
"@types/node": "^25.
|
|
492
|
+
"@types/node": "^25.5.0",
|
|
493
493
|
"@types/react": "^19.2.14",
|
|
494
494
|
"@types/react-dom": "^19.2.3",
|
|
495
|
-
"postcss": "^8.5.
|
|
495
|
+
"postcss": "^8.5.8",
|
|
496
496
|
"tailwindcss": "^4.2.1",
|
|
497
497
|
"tw-animate-css": "^1.4.0",
|
|
498
498
|
"typescript": "^5.9.3"
|
|
@@ -537,32 +537,29 @@ export default nextConfig;
|
|
|
537
537
|
"start": "next start"
|
|
538
538
|
},
|
|
539
539
|
"dependencies": {
|
|
540
|
-
"@ai-sdk/openai": "^3.0.
|
|
540
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
541
541
|
"@assistant-ui/react": "workspace:*",
|
|
542
542
|
"@assistant-ui/react-ai-sdk": "workspace:*",
|
|
543
543
|
"@assistant-ui/react-hook-form": "workspace:*",
|
|
544
544
|
"@assistant-ui/react-markdown": "workspace:*",
|
|
545
545
|
"@assistant-ui/ui": "workspace:*",
|
|
546
|
-
"
|
|
547
|
-
"ai": "^6.0.98",
|
|
546
|
+
"ai": "^6.0.116",
|
|
548
547
|
"class-variance-authority": "^0.7.1",
|
|
549
548
|
"clsx": "^2.1.1",
|
|
550
|
-
"lucide-react": "^0.
|
|
549
|
+
"lucide-react": "^0.577.0",
|
|
551
550
|
"next": "^16.1.6",
|
|
552
551
|
"react": "^19.2.4",
|
|
553
552
|
"react-dom": "^19.2.4",
|
|
554
553
|
"react-hook-form": "^7.71.2",
|
|
555
|
-
"
|
|
556
|
-
"tailwind-merge": "^3.5.0",
|
|
557
|
-
"zod": "^4.3.6"
|
|
554
|
+
"tailwind-merge": "^3.5.0"
|
|
558
555
|
},
|
|
559
556
|
"devDependencies": {
|
|
560
557
|
"@assistant-ui/x-buildutils": "workspace:*",
|
|
561
558
|
"@tailwindcss/postcss": "^4.2.1",
|
|
562
|
-
"@types/node": "^25.
|
|
559
|
+
"@types/node": "^25.5.0",
|
|
563
560
|
"@types/react": "^19.2.14",
|
|
564
561
|
"@types/react-dom": "^19.2.3",
|
|
565
|
-
"postcss": "^8.5.
|
|
562
|
+
"postcss": "^8.5.8",
|
|
566
563
|
"tailwindcss": "^4.2.1",
|
|
567
564
|
"tw-animate-css": "^1.4.0",
|
|
568
565
|
"typescript": "^5.9.3"
|