Skip to content

Commit f827d51

Browse files
authored
chore: use latest copilot action wrapper methods in dojo (#503)
* chore: use latest copilot action wrapper methods in dojo
1 parent 85c313c commit f827d51

File tree

10 files changed

+1779
-921
lines changed

10 files changed

+1779
-921
lines changed

typescript-sdk/apps/dojo/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"@ag-ui/server-starter-all-features": "workspace:*",
2525
"@ag-ui/vercel-ai-sdk": "workspace:*",
2626
"@ai-sdk/openai": "^2.0.42",
27-
"@copilotkit/react-core": "1.10.5",
28-
"@copilotkit/react-ui": "1.10.5",
29-
"@copilotkit/runtime": "1.10.5",
30-
"@copilotkit/runtime-client-gql": "1.10.5",
31-
"@copilotkit/shared": "1.10.5",
27+
"@copilotkit/react-core": "1.10.6-next.2",
28+
"@copilotkit/react-ui": "1.10.6-next.2",
29+
"@copilotkit/runtime": "1.10.6-next.2",
30+
"@copilotkit/runtime-client-gql": "1.10.6-next.2",
31+
"@copilotkit/shared": "1.10.6-next.2",
3232
"@mastra/client-js": "^0.14.0",
3333
"@mastra/core": "^0.19.0",
3434
"@mastra/dynamodb": "^0.15.4",

typescript-sdk/apps/dojo/scripts/prep-dojo-everything.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const ALL_TARGETS = {
8989
cwd: path.join(integrationsRoot, 'llamaindex/server-py'),
9090
},
9191
'mastra': {
92-
command: 'npm install',
92+
command: 'pnpm install',
9393
name: 'Mastra',
9494
cwd: path.join(integrationsRoot, 'mastra/example'),
9595
},

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import "./style.css";
55
import {
66
ActionRenderProps,
77
CopilotKit,
8-
useCoAgent,
9-
useCoAgentStateRender,
8+
useRenderToolCall,
109
useCopilotAction,
1110
useCopilotChat,
1211
} from "@copilotkit/react-core";
@@ -127,10 +126,9 @@ const Chat = ({ onNotification }: { onNotification?: () => void }) => {
127126
}
128127
}, [isLoading, JSON.stringify(visibleMessages)]);
129128

130-
useCopilotAction({
129+
useRenderToolCall({
131130
name: "send_message_to_a2a_agent",
132131
description: "Sends a message to an A2A agent",
133-
available: "frontend",
134132
parameters: [
135133
{
136134
name: "agentName",

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
import React, { useState } from "react";
33
import "@copilotkit/react-ui/styles.css";
44
import "./style.css";
5-
import { CopilotKit, useCoAgent, useCopilotAction, useCopilotChat } from "@copilotkit/react-core";
5+
import {
6+
CopilotKit,
7+
useFrontendTool,
8+
} from "@copilotkit/react-core";
69
import { CopilotChat } from "@copilotkit/react-ui";
710

811
interface AgenticChatProps {
@@ -29,7 +32,7 @@ const AgenticChat: React.FC<AgenticChatProps> = ({ params }) => {
2932
const Chat = () => {
3033
const [background, setBackground] = useState<string>("--copilot-kit-background-color");
3134

32-
useCopilotAction({
35+
useFrontendTool({
3336
name: "change_background",
3437
description:
3538
"Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.",

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
import React, { useState } from "react";
33
import "@copilotkit/react-ui/styles.css";
44
import "./style.css";
5-
import { CopilotKit, useCoAgent, useCopilotAction, useCopilotChat } from "@copilotkit/react-core";
5+
import {
6+
CopilotKit,
7+
useCoAgent,
8+
useCopilotAction,
9+
useCopilotChat,
10+
useFrontendTool,
11+
} from "@copilotkit/react-core";
612
import { CopilotChat } from "@copilotkit/react-ui";
713
import { ChevronDown } from "lucide-react";
814
import { Button } from "@/components/ui/button";
@@ -56,7 +62,7 @@ const Chat = () => {
5662
setAgentState({ model });
5763
};
5864

59-
useCopilotAction({
65+
useFrontendTool({
6066
name: "change_background",
6167
description:
6268
"Change the background color of the chat. Can be anything that the CSS background attribute accepts. Regular colors, linear of radial gradients etc.",

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
import React, { useState, useEffect } from "react";
33
import "@copilotkit/react-ui/styles.css";
44
import "./style.css";
5-
import { CopilotKit, useCopilotAction, useLangGraphInterrupt } from "@copilotkit/react-core";
5+
import {
6+
CopilotKit,
7+
useHumanInTheLoop,
8+
useLangGraphInterrupt,
9+
} from "@copilotkit/react-core";
610
import { CopilotChat } from "@copilotkit/react-ui";
711
import { useTheme } from "next-themes";
812

@@ -329,7 +333,7 @@ const Chat = ({ integrationId }: { integrationId: string }) => {
329333
useLangGraphInterrupt({
330334
render: ({ event, resolve }) => <InterruptHumanInTheLoop event={event} resolve={resolve} />,
331335
});
332-
useCopilotAction({
336+
useHumanInTheLoop({
333337
name: "generate_task_steps",
334338
description: "Generates a list of steps for the user to perform",
335339
parameters: [
@@ -354,7 +358,7 @@ const Chat = ({ integrationId }: { integrationId: string }) => {
354358
available: ["langgraph", "langgraph-fastapi", "langgraph-typescript"].includes(integrationId)
355359
? "disabled"
356360
: "enabled",
357-
renderAndWaitForResponse: ({ args, respond, status }) => {
361+
render: ({ args, respond, status }) => {
358362
return <StepsFeedback args={args} respond={respond} status={status} />;
359363
},
360364
});

typescript-sdk/apps/dojo/src/files.json

Lines changed: 21 additions & 21 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)