Skip to content

Commit 2ead19e

Browse files
committed
wip
1 parent be3d09b commit 2ead19e

File tree

4 files changed

+103
-178
lines changed

4 files changed

+103
-178
lines changed

typescript-sdk/apps/dojo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"rxjs": "7.8.1",
6060
"tailwind-merge": "^3.0.2",
6161
"tailwindcss-animate": "^1.0.7",
62-
"uuid": "^11.1.0"
62+
"uuid": "^11.1.0",
63+
"zod": "^3.22.4"
6364
},
6465
"peerDependencies": {
6566
"@ag-ui/client": "workspace:*",
@@ -79,7 +80,6 @@
7980
"@types/react-dom": "^19",
8081
"eslint": "^9",
8182
"eslint-config-next": "15.2.1",
82-
"nextjs-node-loader": "^1.1.9",
8383
"tailwindcss": "^4",
8484
"typescript": "^5"
8585
}

typescript-sdk/apps/dojo/src/app/[integrationId]/feature/agentic_chat/page.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import React, { useState } from "react";
33
import "@copilotkit/react-ui/styles.css";
44
import "./style.css";
5-
import { CopilotKit, useCopilotAction, useCopilotChat } from "@copilotkit/react-core";
5+
import { CopilotKit, useCoAgent, useCopilotAction, useCopilotChat } from "@copilotkit/react-core";
66
import { CopilotChat } from "@copilotkit/react-ui";
77

88
interface AgenticChatProps {
@@ -29,6 +29,17 @@ const AgenticChat: React.FC<AgenticChatProps> = ({ params }) => {
2929
const Chat = () => {
3030
const [background, setBackground] = useState<string>("--copilot-kit-background-color");
3131

32+
const { state: agentState, setState: setAgentState } = useCoAgent({
33+
name: "agentic_chat",
34+
initialState: {
35+
firstName: "Markus",
36+
},
37+
});
38+
39+
delete (agentState as any).messages;
40+
41+
console.log(agentState);
42+
3243
useCopilotAction({
3344
name: "lookup_weather",
3445
description: "Lookup the weather for a given city",

typescript-sdk/apps/dojo/src/local/mastra.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Agent } from "@mastra/core/agent";
44
import { Memory } from "@mastra/memory";
55
import { MockStore } from "@mastra/core/storage";
66
import { Mastra } from "@mastra/core";
7+
import { z } from "zod";
78

89
// import { weatherTool } from "../tools/weather-tool";
910

@@ -27,6 +28,14 @@ export const LOCAL_MASTRA = new Mastra({
2728
// tools: { weatherTool },
2829
memory: new Memory({
2930
storage: new MockStore(),
31+
options: {
32+
workingMemory: {
33+
enabled: true,
34+
schema: z.object({
35+
firstName: z.string(),
36+
}),
37+
},
38+
},
3039
}),
3140
}),
3241
},

0 commit comments

Comments
 (0)