Skip to content

Commit 148467d

Browse files
authored
refact: Remove mastra in favor of ai sdk v5 (#1402)
1 parent fa8b903 commit 148467d

File tree

94 files changed

+4124
-16490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4124
-16490
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ dist
4040
kv
4141
kv-shm
4242
kv-wal
43-
.specstory/**
43+
.specstory/**
44+
.tsbuildinfo

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

apps/api/package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,27 @@
99
},
1010
"dependencies": {
1111
"@ai-sdk/ui-utils": "^1.2.11",
12-
"@deco/actors": "npm:@jsr/[email protected].1",
12+
"@deco/actors": "npm:@jsr/[email protected].2",
1313
"@deco/ai": "^1.0.0",
1414
"@deco/mcp": "npm:@jsr/[email protected]",
1515
"@deco/sdk": "^0.1.1",
1616
"@libsql/client": "^0.15.4",
17-
"@modelcontextprotocol/sdk": "1.17.1",
18-
"outerbase-browsable-do-enforced": "0.2.0",
17+
"@modelcontextprotocol/sdk": "^1.19.1",
1918
"@supabase/ssr": "0.6.1",
2019
"@supabase/supabase-js": "2.49.4",
21-
"ai": "^4.3.13",
22-
"cloudflare": "^4.2.0",
20+
"ai": "^5.0.61",
21+
"cloudflare": "^4.5.0",
2322
"hono": "^4.7.7",
2423
"mimetext": "^3.0.27",
24+
"outerbase-browsable-do-enforced": "0.2.0",
2525
"postal-mime": "^2.4.3",
26-
"zod": "^3.24.3"
26+
"zod": "^3.25.76"
2727
},
2828
"devDependencies": {
2929
"@cloudflare/workers-types": "^4.20250620.0",
30-
"supabase": "^2.22.12",
31-
"wrangler": "^4.23.0"
30+
"supabase": "^2.22.12"
3231
},
3332
"engines": {
34-
"node": ">=20.0.0"
33+
"node": ">=24.0.0"
3534
}
3635
}

apps/api/src/api.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,20 +189,28 @@ const createMCPHandlerFor = (
189189

190190
registeredTools.add(tool.name);
191191

192+
const evalInputSchema =
193+
tool.inputSchema instanceof z.ZodLazy
194+
? tool.inputSchema.schema
195+
: tool.inputSchema;
196+
197+
const evalOutputSchema =
198+
tool.outputSchema instanceof z.ZodLazy
199+
? tool.outputSchema.schema
200+
: tool.outputSchema;
201+
192202
server.registerTool(
193203
tool.name,
194204
{
195205
annotations: tool.annotations,
196206
description: tool.description,
197207
inputSchema:
198-
"shape" in tool.inputSchema
199-
? (tool.inputSchema.shape as z.ZodRawShape)
208+
"shape" in evalInputSchema
209+
? (evalInputSchema.shape as z.ZodRawShape)
200210
: z.object({}).shape,
201211
outputSchema:
202-
tool.outputSchema &&
203-
typeof tool.outputSchema === "object" &&
204-
"shape" in tool.outputSchema
205-
? (tool.outputSchema.shape as z.ZodRawShape)
212+
evalOutputSchema && "shape" in evalOutputSchema
213+
? (evalOutputSchema.shape as z.ZodRawShape)
206214
: z.object({}).shape,
207215
},
208216
// @ts-expect-error: zod shape is not typed

apps/api/src/email.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ export function email(
108108
{
109109
id: crypto.randomUUID(),
110110
role: "user",
111-
content: await readContent(message),
111+
parts: [{ type: "text", text: await readContent(message) }],
112112
},
113113
],
114+
{}, // metadata - empty for email
114115
{
115116
threadId: originalMessageId,
116117
resourceId: originalMessageId,

apps/outbound/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
"@supabase/ssr": "0.6.1",
1313
"@supabase/supabase-js": "2.49.4"
1414
},
15-
"devDependencies": {
16-
"wrangler": "^4.13.2"
17-
},
1815
"engines": {
19-
"node": ">=20.0.0"
16+
"node": ">=24.0.0"
2017
}
2118
}

apps/web/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@ai-sdk/provider": "^1.1.3",
14-
"@ai-sdk/react": "^1.2.5",
15-
"@deco/actors": "npm:@jsr/[email protected].1",
13+
"@ai-sdk/provider": "^2.0.0",
14+
"@ai-sdk/react": "^2.0.59",
15+
"@deco/actors": "npm:@jsr/[email protected].2",
1616
"@deco/sdk": "^0.1.1",
1717
"@deco/ui": "^1.0.0",
1818
"@gsap/react": "^2.1.2",
@@ -39,8 +39,8 @@
3939
"marked": "^15.0.7",
4040
"posthog-js": "^1.259.0",
4141
"prismjs": "1.30.0",
42-
"react": "^19.0.0",
43-
"react-dom": "^19.0.0",
42+
"react": "^19.2.0",
43+
"react-dom": "^19.2.0",
4444
"react-hook-form": "^7.55.0",
4545
"react-markdown": "^10.1.0",
4646
"react-router": "^7.4.1",
@@ -54,7 +54,7 @@
5454
"urlpattern-polyfill": "^10.1.0",
5555
"use-debounce": "^10.0.6",
5656
"vite-plugin-pwa": "^1.0.1",
57-
"zod": "^3.24.3"
57+
"zod": "^3.25.76"
5858
},
5959
"devDependencies": {
6060
"@react-scan/vite-plugin-react-scan": "^0.1.8",
@@ -64,10 +64,10 @@
6464
"@types/react": "^19.0.10",
6565
"@types/react-syntax-highlighter": "^15.5.13",
6666
"@types/react-dom": "^19.0.4",
67-
"@vitejs/plugin-react-swc": "^3.8.0",
67+
"@vitejs/plugin-react-swc": "^4.1.0",
6868
"react-scan": "^0.4.3",
6969
"tailwindcss": "^4.1.1",
7070
"vite-plugin-inspect": "^11.3.0",
71-
"vite": "^7.0.5"
71+
"vite": "^7.1.8"
7272
}
7373
}

0 commit comments

Comments
 (0)