Skip to content

Commit aa22400

Browse files
committed
wip
1 parent 64b784a commit aa22400

File tree

6 files changed

+1148
-113
lines changed

6 files changed

+1148
-113
lines changed

typescript-sdk/apps/dojo/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,24 @@
1010
},
1111
"dependencies": {
1212
"@ag-ui/agno": "workspace:*",
13+
"@ag-ui/crewai": "workspace:*",
1314
"@ag-ui/langgraph": "workspace:*",
1415
"@ag-ui/llamaindex": "workspace:*",
1516
"@ag-ui/mastra": "workspace:*",
1617
"@ag-ui/middleware-starter": "workspace:*",
1718
"@ag-ui/server-starter": "workspace:*",
1819
"@ag-ui/server-starter-all-features": "workspace:*",
1920
"@ag-ui/vercel-ai-sdk": "workspace:*",
20-
"@ag-ui/crewai": "workspace:*",
2121
"@ai-sdk/openai": "^1.3.22",
2222
"@copilotkit/react-core": "1.8.14-next.4",
2323
"@copilotkit/react-ui": "1.8.14-next.4",
2424
"@copilotkit/runtime": "1.8.14-next.4",
2525
"@copilotkit/runtime-client-gql": "1.8.14-next.4",
2626
"@copilotkit/shared": "1.8.14-next.4",
27-
"@mastra/client-js": "^0.10.1",
27+
"@mastra/client-js": "^0.10.7",
28+
"@mastra/core": "^0.10.8",
29+
"@mastra/loggers": "^0.10.2",
30+
"@mastra/memory": "^0.11.0",
2831
"@mdx-js/loader": "^3.1.0",
2932
"@mdx-js/mdx": "^3.1.0",
3033
"@mdx-js/react": "^3.1.0",
@@ -76,6 +79,7 @@
7679
"@types/react-dom": "^19",
7780
"eslint": "^9",
7881
"eslint-config-next": "15.2.1",
82+
"nextjs-node-loader": "^1.1.9",
7983
"tailwindcss": "^4",
8084
"typescript": "^5"
8185
}

typescript-sdk/apps/dojo/src/agents.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import "server-only";
2+
13
import { AgentIntegrationConfig } from "./types/integration";
24
import { MiddlewareStarterAgent } from "@ag-ui/middleware-starter";
35
import { ServerStarterAgent } from "@ag-ui/server-starter";
@@ -10,6 +12,7 @@ import { LangGraphAgent } from "@ag-ui/langgraph";
1012
import { AgnoAgent } from "@ag-ui/agno";
1113
import { LlamaIndexAgent } from "@ag-ui/llamaindex";
1214
import { CrewAIAgent } from "@ag-ui/crewai";
15+
import { agenticChatMastraAgent } from "./local/mastra";
1316

1417
export const agentsIntegrations: AgentIntegrationConfig[] = [
1518
{
@@ -65,6 +68,14 @@ export const agentsIntegrations: AgentIntegrationConfig[] = [
6568
});
6669
},
6770
},
71+
{
72+
id: "mastra-agent-local",
73+
agents: async () => {
74+
return {
75+
agentic_chat: new MastraAgent({ agent: agenticChatMastraAgent("agentic_chat") }),
76+
};
77+
},
78+
},
6879
{
6980
id: "vercel-ai-sdk",
7081
agents: async () => {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import "server-only";
2+
import { openai } from "@ai-sdk/openai";
3+
import { Agent } from "@mastra/core/agent";
4+
import { Memory } from "@mastra/memory";
5+
// import { weatherTool } from "../tools/weather-tool";
6+
7+
export const agenticChatMastraAgent = (name: string) =>
8+
new Agent({
9+
name,
10+
instructions: `
11+
You are a helpful weather assistant that provides accurate weather information.
12+
13+
Your primary function is to help users get weather details for specific locations. When responding:
14+
- Always ask for a location if none is provided
15+
- If the location name isn’t in English, please translate it
16+
- If giving a location with multiple parts (e.g. "New York, NY"), use the most relevant part (e.g. "New York")
17+
- Include relevant details like humidity, wind conditions, and precipitation
18+
- Keep responses concise but informative
19+
20+
Use the weatherTool to fetch current weather data.
21+
`,
22+
model: openai("gpt-4o-mini"),
23+
// tools: { weatherTool },
24+
memory: new Memory({}),
25+
});

typescript-sdk/apps/dojo/src/menu.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const menuIntegrations: MenuIntegrationConfig[] = [
1313
},
1414
{
1515
id: "server-starter-all-features",
16-
name: "Server Starter All Features",
16+
name: "Server Starter (All Features)",
1717
features: [
1818
"agentic_chat",
1919
"human_in_the_loop",
@@ -28,6 +28,11 @@ export const menuIntegrations: MenuIntegrationConfig[] = [
2828
name: "Mastra",
2929
features: ["agentic_chat"],
3030
},
31+
{
32+
id: "mastra-agent-local",
33+
name: "Mastra Agent (Local)",
34+
features: ["agentic_chat"],
35+
},
3136
{
3237
id: "vercel-ai-sdk",
3338
name: "Vercel AI SDK",

typescript-sdk/integrations/mastra/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@
2525
"dependencies": {
2626
"@ag-ui/client": "workspace:*",
2727
"@ai-sdk/ui-utils": "^1.1.19",
28-
"@mastra/client-js": "^0.10.1",
28+
"@mastra/client-js": "^0.10.7",
2929
"hono": "^4.5.1",
3030
"rxjs": "7.8.1"
3131
},
3232
"peerDependencies": {
3333
"@copilotkit/runtime": "^1.8.13",
34-
"@mastra/core": "^0.10.1",
35-
"zod": "^3.0.0"
34+
"@mastra/core": "^0.10.8",
35+
"zod": "^3.25.67"
3636
},
3737
"devDependencies": {
38+
"@mastra/core": "^0.10.8",
3839
"@types/jest": "^29.5.14",
3940
"@types/node": "^20.11.19",
4041
"jest": "^29.7.0",

0 commit comments

Comments
 (0)