@copilotkitnext/core 0.0.3 → 0.0.4

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.
@@ -1,216 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
2
- import { CopilotKitCore } from "../core";
3
- import { FrontendTool } from "../types";
4
- import {
5
- MockAgent,
6
- createAssistantMessage,
7
- createToolCallMessage,
8
- createMultipleToolCallsMessage,
9
- createTool,
10
- } from "./test-utils";
11
-
12
- describe("CopilotKitCore.runAgent - Follow-up Logic", () => {
13
- let copilotKitCore: CopilotKitCore;
14
-
15
- beforeEach(() => {
16
- copilotKitCore = new CopilotKitCore({});
17
- vi.clearAllMocks();
18
- });
19
-
20
- afterEach(() => {
21
- vi.restoreAllMocks();
22
- });
23
-
24
- it("should trigger recursive call when tool.followUp is true", async () => {
25
- const tool = createTool({
26
- name: "followUpTool",
27
- handler: vi.fn(async () => "Result"),
28
- followUp: true,
29
- });
30
- copilotKitCore.addTool(tool);
31
-
32
- const message = createToolCallMessage("followUpTool");
33
- const followUpMessage = createAssistantMessage({ content: "Follow-up response" });
34
-
35
- const agent = new MockAgent({ newMessages: [message] });
36
- let callCount = 0;
37
- agent.runAgentCallback = () => {
38
- callCount++;
39
- if (callCount === 2) {
40
- agent.setNewMessages([followUpMessage]);
41
- }
42
- };
43
-
44
- const result = await copilotKitCore.runAgent({ agent: agent as any });
45
-
46
- expect(agent.runAgentCalls).toHaveLength(2);
47
- expect(result.newMessages).toContain(followUpMessage);
48
- });
49
-
50
- it("should not trigger recursive call when tool.followUp is false", async () => {
51
- const tool = createTool({
52
- name: "noFollowUpTool",
53
- handler: vi.fn(async () => "Result"),
54
- followUp: false,
55
- });
56
- copilotKitCore.addTool(tool);
57
-
58
- const message = createToolCallMessage("noFollowUpTool");
59
- const agent = new MockAgent({ newMessages: [message] });
60
-
61
- await copilotKitCore.runAgent({ agent: agent as any });
62
-
63
- expect(agent.runAgentCalls).toHaveLength(1);
64
- });
65
-
66
- it("should trigger recursive call when tool.followUp is undefined (default)", async () => {
67
- const tool: FrontendTool = {
68
- name: "defaultFollowUpTool",
69
- handler: vi.fn(async () => "Result"),
70
- // followUp is undefined
71
- };
72
- copilotKitCore.addTool(tool);
73
-
74
- const message = createToolCallMessage("defaultFollowUpTool");
75
- const followUpMessage = createAssistantMessage({ content: "Follow-up" });
76
-
77
- const agent = new MockAgent({ newMessages: [message] });
78
- let callCount = 0;
79
- agent.runAgentCallback = () => {
80
- callCount++;
81
- if (callCount === 2) {
82
- agent.setNewMessages([followUpMessage]);
83
- }
84
- };
85
-
86
- await copilotKitCore.runAgent({ agent: agent as any });
87
-
88
- expect(agent.runAgentCalls).toHaveLength(2);
89
- });
90
-
91
- it("should trigger follow-up when at least one tool needs it", async () => {
92
- const tool1 = createTool({
93
- name: "tool1",
94
- handler: vi.fn(async () => "Result 1"),
95
- followUp: false,
96
- });
97
- const tool2 = createTool({
98
- name: "tool2",
99
- handler: vi.fn(async () => "Result 2"),
100
- followUp: true,
101
- });
102
- const tool3 = createTool({
103
- name: "tool3",
104
- handler: vi.fn(async () => "Result 3"),
105
- followUp: false,
106
- });
107
- copilotKitCore.addTool(tool1);
108
- copilotKitCore.addTool(tool2);
109
- copilotKitCore.addTool(tool3);
110
-
111
- const message = createMultipleToolCallsMessage([
112
- { name: "tool1" },
113
- { name: "tool2" },
114
- { name: "tool3" },
115
- ]);
116
-
117
- const agent = new MockAgent({ newMessages: [message] });
118
- let callCount = 0;
119
- agent.runAgentCallback = () => {
120
- callCount++;
121
- if (callCount === 2) {
122
- agent.setNewMessages([]);
123
- }
124
- };
125
-
126
- await copilotKitCore.runAgent({ agent: agent as any });
127
-
128
- expect(agent.runAgentCalls).toHaveLength(2);
129
- });
130
-
131
- it("should not trigger follow-up when all tools have followUp=false", async () => {
132
- const tool1 = createTool({
133
- name: "tool1",
134
- handler: vi.fn(async () => "Result 1"),
135
- followUp: false,
136
- });
137
- const tool2 = createTool({
138
- name: "tool2",
139
- handler: vi.fn(async () => "Result 2"),
140
- followUp: false,
141
- });
142
- copilotKitCore.addTool(tool1);
143
- copilotKitCore.addTool(tool2);
144
-
145
- const message = createMultipleToolCallsMessage([
146
- { name: "tool1" },
147
- { name: "tool2" },
148
- ]);
149
-
150
- const agent = new MockAgent({ newMessages: [message] });
151
-
152
- await copilotKitCore.runAgent({ agent: agent as any });
153
-
154
- expect(agent.runAgentCalls).toHaveLength(1);
155
- });
156
-
157
- it("should return final result after recursive follow-up", async () => {
158
- const tool = createTool({
159
- name: "recursiveTool",
160
- handler: vi.fn(async () => "Tool result"),
161
- followUp: true,
162
- });
163
- copilotKitCore.addTool(tool);
164
-
165
- const initialMessage = createToolCallMessage("recursiveTool");
166
- const finalMessage = createAssistantMessage({ content: "Final response" });
167
-
168
- const agent = new MockAgent({ newMessages: [initialMessage] });
169
- let callCount = 0;
170
- agent.runAgentCallback = () => {
171
- callCount++;
172
- if (callCount === 2) {
173
- agent.setNewMessages([finalMessage]);
174
- }
175
- };
176
-
177
- const result = await copilotKitCore.runAgent({ agent: agent as any });
178
-
179
- expect(result.newMessages).toEqual([finalMessage]);
180
- });
181
-
182
- it("should handle multiple recursive follow-ups (chain)", async () => {
183
- const tool1 = createTool({
184
- name: "chainTool1",
185
- handler: vi.fn(async () => "Result 1"),
186
- followUp: true,
187
- });
188
- const tool2 = createTool({
189
- name: "chainTool2",
190
- handler: vi.fn(async () => "Result 2"),
191
- followUp: true,
192
- });
193
- copilotKitCore.addTool(tool1);
194
- copilotKitCore.addTool(tool2);
195
-
196
- const msg1 = createToolCallMessage("chainTool1");
197
- const msg2 = createToolCallMessage("chainTool2");
198
- const finalMsg = createAssistantMessage({ content: "Done" });
199
-
200
- const agent = new MockAgent({ newMessages: [msg1] });
201
- let callCount = 0;
202
- agent.runAgentCallback = () => {
203
- callCount++;
204
- if (callCount === 2) {
205
- agent.setNewMessages([msg2]);
206
- } else if (callCount === 3) {
207
- agent.setNewMessages([finalMsg]);
208
- }
209
- };
210
-
211
- const result = await copilotKitCore.runAgent({ agent: agent as any });
212
-
213
- expect(agent.runAgentCalls).toHaveLength(3);
214
- expect(result.newMessages).toEqual([finalMsg]);
215
- });
216
- });
@@ -1,320 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi, afterEach } from "vitest";
2
- import { CopilotKitCore } from "../core";
3
- import { FrontendTool } from "../types";
4
- import {
5
- MockAgent,
6
- createMessage,
7
- createAssistantMessage,
8
- createToolCallMessage,
9
- createToolResultMessage,
10
- createTool,
11
- createMultipleToolCallsMessage,
12
- } from "./test-utils";
13
-
14
- describe("CopilotKitCore.runAgent - Full Test Suite", () => {
15
- let copilotKitCore: CopilotKitCore;
16
-
17
- beforeEach(() => {
18
- copilotKitCore = new CopilotKitCore({});
19
- vi.clearAllMocks();
20
- });
21
-
22
- afterEach(() => {
23
- vi.restoreAllMocks();
24
- });
25
-
26
- describe("Tests that should pass", () => {
27
- it("TEST 1: should run agent without tools", async () => {
28
- const messages = [
29
- createMessage({ content: "Hello" }),
30
- createAssistantMessage({ content: "Hi there!" }),
31
- ];
32
- const agent = new MockAgent({ newMessages: messages });
33
-
34
- const result = await copilotKitCore.runAgent({ agent: agent as any });
35
-
36
- expect(result.newMessages).toEqual(messages);
37
- expect(agent.runAgentCalls).toHaveLength(1);
38
- });
39
-
40
- it("TEST 2: should execute tool with string result", async () => {
41
- const toolName = "stringTool";
42
- const tool = createTool({
43
- name: toolName,
44
- handler: vi.fn(async () => "String result"),
45
- followUp: false,
46
- });
47
- copilotKitCore.addTool(tool);
48
-
49
- const message = createToolCallMessage(toolName, { input: "test" });
50
- const agent = new MockAgent({ newMessages: [message] });
51
-
52
- await copilotKitCore.runAgent({ agent: agent as any });
53
-
54
- expect(tool.handler).toHaveBeenCalledWith({ input: "test" });
55
- expect(agent.messages.some(m => m.role === "tool")).toBe(true);
56
- });
57
-
58
- it("TEST 3: should skip tool when not found", async () => {
59
- const message = createToolCallMessage("nonExistentTool");
60
- const agent = new MockAgent({ newMessages: [message] });
61
-
62
- await copilotKitCore.runAgent({ agent: agent as any });
63
-
64
- expect(agent.messages.filter(m => m.role === "tool")).toHaveLength(0);
65
- });
66
- });
67
-
68
- describe("Tests that might reveal problems", () => {
69
- it("TEST 4: should handle follow-up with recursion", async () => {
70
- console.log("TEST 4: Starting follow-up test");
71
- const tool = createTool({
72
- name: "followUpTool",
73
- handler: vi.fn(async () => "Result"),
74
- followUp: true, // This should trigger recursion
75
- });
76
- copilotKitCore.addTool(tool);
77
-
78
- const message = createToolCallMessage("followUpTool");
79
- const followUpMessage = createAssistantMessage({ content: "Follow-up response" });
80
-
81
- const agent = new MockAgent({ newMessages: [message] });
82
- let callCount = 0;
83
- agent.runAgentCallback = () => {
84
- callCount++;
85
- console.log(`TEST 4: Call count: ${callCount}`);
86
- if (callCount === 2) {
87
- agent.setNewMessages([followUpMessage]);
88
- }
89
- };
90
-
91
- try {
92
- const result = await copilotKitCore.runAgent({ agent: agent as any });
93
- console.log(`TEST 4: Success - calls: ${agent.runAgentCalls.length}`);
94
- expect(agent.runAgentCalls).toHaveLength(2);
95
- expect(result.newMessages).toContain(followUpMessage);
96
- } catch (error) {
97
- console.log(`TEST 4: Error - ${error}`);
98
- throw error;
99
- }
100
- });
101
-
102
- it("TEST 5: should handle multiple tools with at least one follow-up", async () => {
103
- console.log("TEST 5: Starting multiple tools test");
104
- const tool1 = createTool({
105
- name: "tool1",
106
- handler: vi.fn(async () => "Result 1"),
107
- followUp: false,
108
- });
109
- const tool2 = createTool({
110
- name: "tool2",
111
- handler: vi.fn(async () => "Result 2"),
112
- followUp: true, // This one needs follow-up
113
- });
114
- copilotKitCore.addTool(tool1);
115
- copilotKitCore.addTool(tool2);
116
-
117
- const message = createMultipleToolCallsMessage([
118
- { name: "tool1" },
119
- { name: "tool2" },
120
- ]);
121
-
122
- const agent = new MockAgent({ newMessages: [message] });
123
- let callCount = 0;
124
- agent.runAgentCallback = () => {
125
- callCount++;
126
- console.log(`TEST 5: Call count: ${callCount}`);
127
- if (callCount === 2) {
128
- agent.setNewMessages([]);
129
- }
130
- };
131
-
132
- try {
133
- await copilotKitCore.runAgent({ agent: agent as any });
134
- console.log(`TEST 5: Success - calls: ${agent.runAgentCalls.length}`);
135
- expect(agent.runAgentCalls).toHaveLength(2);
136
- } catch (error) {
137
- console.log(`TEST 5: Error - ${error}`);
138
- throw error;
139
- }
140
- });
141
-
142
- it("TEST 6: should handle tool with undefined follow-up (defaults to true)", async () => {
143
- console.log("TEST 6: Starting undefined follow-up test");
144
- const tool: FrontendTool = {
145
- name: "defaultFollowUpTool",
146
- handler: vi.fn(async () => "Result"),
147
- // followUp is undefined - should default to true
148
- };
149
- copilotKitCore.addTool(tool);
150
-
151
- const message = createToolCallMessage("defaultFollowUpTool");
152
- const followUpMessage = createAssistantMessage({ content: "Follow-up" });
153
-
154
- const agent = new MockAgent({ newMessages: [message] });
155
- let callCount = 0;
156
- agent.runAgentCallback = () => {
157
- callCount++;
158
- console.log(`TEST 6: Call count: ${callCount}`);
159
- if (callCount === 2) {
160
- agent.setNewMessages([followUpMessage]);
161
- }
162
- };
163
-
164
- try {
165
- await copilotKitCore.runAgent({ agent: agent as any });
166
- console.log(`TEST 6: Success - calls: ${agent.runAgentCalls.length}`);
167
- expect(agent.runAgentCalls).toHaveLength(2);
168
- } catch (error) {
169
- console.log(`TEST 6: Error - ${error}`);
170
- throw error;
171
- }
172
- });
173
-
174
- it("TEST 7: should handle invalid JSON in tool arguments", async () => {
175
- console.log("TEST 7: Starting invalid JSON test");
176
- const toolName = "invalidJsonTool";
177
- const tool = createTool({
178
- name: toolName,
179
- handler: vi.fn(async () => "Should not be called"),
180
- });
181
- copilotKitCore.addTool(tool);
182
-
183
- const message = createAssistantMessage({
184
- content: "",
185
- toolCalls: [{
186
- id: "tool-call-1",
187
- type: "function",
188
- function: {
189
- name: toolName,
190
- arguments: "{ invalid json",
191
- },
192
- }],
193
- });
194
- const agent = new MockAgent({ newMessages: [message] });
195
-
196
- try {
197
- await copilotKitCore.runAgent({ agent: agent as any });
198
- console.log("TEST 7: ERROR - Should have thrown!");
199
- expect(true).toBe(false); // Should not reach here
200
- } catch (error) {
201
- console.log(`TEST 7: Success - caught error: ${error}`);
202
- expect(tool.handler).not.toHaveBeenCalled();
203
- }
204
- });
205
-
206
- it("TEST 8: should handle empty string arguments", async () => {
207
- console.log("TEST 8: Starting empty arguments test");
208
- const tool = createTool({
209
- name: "emptyArgsTool",
210
- handler: vi.fn(async (args) => `Received: ${JSON.stringify(args)}`),
211
- });
212
- copilotKitCore.addTool(tool);
213
-
214
- const message = createAssistantMessage({
215
- content: "",
216
- toolCalls: [{
217
- id: "empty-args-call",
218
- type: "function",
219
- function: {
220
- name: "emptyArgsTool",
221
- arguments: "",
222
- },
223
- }],
224
- });
225
-
226
- const agent = new MockAgent({ newMessages: [message] });
227
-
228
- try {
229
- await copilotKitCore.runAgent({ agent: agent as any });
230
- console.log("TEST 8: ERROR - Should have thrown on empty string!");
231
- expect(true).toBe(false);
232
- } catch (error) {
233
- console.log(`TEST 8: Success - caught error: ${error}`);
234
- expect(tool.handler).not.toHaveBeenCalled();
235
- }
236
- });
237
-
238
- it("TEST 9: should handle chain of follow-ups", async () => {
239
- console.log("TEST 9: Starting chain test");
240
- const tool1 = createTool({
241
- name: "chainTool1",
242
- handler: vi.fn(async () => "Result 1"),
243
- followUp: true,
244
- });
245
- const tool2 = createTool({
246
- name: "chainTool2",
247
- handler: vi.fn(async () => "Result 2"),
248
- followUp: true,
249
- });
250
- copilotKitCore.addTool(tool1);
251
- copilotKitCore.addTool(tool2);
252
-
253
- const msg1 = createToolCallMessage("chainTool1");
254
- const msg2 = createToolCallMessage("chainTool2");
255
- const finalMsg = createAssistantMessage({ content: "Done" });
256
-
257
- const agent = new MockAgent({ newMessages: [msg1] });
258
- let callCount = 0;
259
- agent.runAgentCallback = () => {
260
- callCount++;
261
- console.log(`TEST 9: Call count: ${callCount}`);
262
- if (callCount === 2) {
263
- agent.setNewMessages([msg2]);
264
- } else if (callCount === 3) {
265
- agent.setNewMessages([finalMsg]);
266
- }
267
- };
268
-
269
- try {
270
- const result = await copilotKitCore.runAgent({ agent: agent as any });
271
- console.log(`TEST 9: Success - calls: ${agent.runAgentCalls.length}`);
272
- expect(agent.runAgentCalls).toHaveLength(3);
273
- expect(result.newMessages).toEqual([finalMsg]);
274
- } catch (error) {
275
- console.log(`TEST 9: Error - ${error}`);
276
- throw error;
277
- }
278
- });
279
-
280
- it("TEST 10: should handle concurrent tool calls", async () => {
281
- console.log("TEST 10: Starting concurrent tools test");
282
- const delays = [50, 30, 70];
283
- const tools = delays.map((delay, i) =>
284
- createTool({
285
- name: `concurrentTool${i}`,
286
- handler: vi.fn(async () => {
287
- await new Promise(resolve => setTimeout(resolve, delay));
288
- return `Result ${i} after ${delay}ms`;
289
- }),
290
- followUp: false,
291
- })
292
- );
293
-
294
- tools.forEach(tool => copilotKitCore.addTool(tool));
295
-
296
- const message = createMultipleToolCallsMessage(
297
- delays.map((_, i) => ({ name: `concurrentTool${i}` }))
298
- );
299
- const agent = new MockAgent({ newMessages: [message] });
300
-
301
- const startTime = Date.now();
302
- try {
303
- await copilotKitCore.runAgent({ agent: agent as any });
304
- const duration = Date.now() - startTime;
305
- console.log(`TEST 10: Success - duration: ${duration}ms`);
306
-
307
- // Should execute sequentially
308
- const expectedMinDuration = delays.reduce((a, b) => a + b, 0);
309
- expect(duration).toBeGreaterThanOrEqual(expectedMinDuration - 10);
310
-
311
- tools.forEach(tool => {
312
- expect(tool.handler).toHaveBeenCalled();
313
- });
314
- } catch (error) {
315
- console.log(`TEST 10: Error - ${error}`);
316
- throw error;
317
- }
318
- });
319
- });
320
- });
@@ -1,24 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi } from "vitest";
2
- import { CopilotKitCore } from "../core";
3
- import { MockAgent, createMessage, createAssistantMessage } from "./test-utils";
4
-
5
- describe("CopilotKitCore.runAgent Simple", () => {
6
- let copilotKitCore: CopilotKitCore;
7
-
8
- beforeEach(() => {
9
- copilotKitCore = new CopilotKitCore({});
10
- });
11
-
12
- it("should run agent without tools", async () => {
13
- const messages = [
14
- createMessage({ content: "Hello" }),
15
- createAssistantMessage({ content: "Hi there!" }),
16
- ];
17
- const agent = new MockAgent({ newMessages: messages });
18
-
19
- const result = await copilotKitCore.runAgent({ agent: agent as any });
20
-
21
- expect(result.newMessages).toEqual(messages);
22
- expect(agent.runAgentCalls).toHaveLength(1);
23
- });
24
- });
@@ -1,41 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi } from "vitest";
2
- import { CopilotKitCore } from "../core";
3
- import {
4
- MockAgent,
5
- createToolCallMessage,
6
- createTool,
7
- } from "./test-utils";
8
-
9
- describe("CopilotKitCore Tool Minimal", () => {
10
- let copilotKitCore: CopilotKitCore;
11
-
12
- beforeEach(() => {
13
- copilotKitCore = new CopilotKitCore({});
14
- });
15
-
16
- it("should execute tool with string result", async () => {
17
- const toolName = "stringTool";
18
- const tool = createTool({
19
- name: toolName,
20
- handler: vi.fn(async () => "String result"),
21
- });
22
- copilotKitCore.addTool(tool);
23
-
24
- const message = createToolCallMessage(toolName, { input: "test" });
25
- const agent = new MockAgent({ newMessages: [message] });
26
-
27
- await copilotKitCore.runAgent({ agent: agent as any });
28
-
29
- expect(tool.handler).toHaveBeenCalledWith({ input: "test" });
30
- expect(agent.messages.some(m => m.role === "tool")).toBe(true);
31
- });
32
-
33
- it("should skip tool call when tool not found", async () => {
34
- const message = createToolCallMessage("nonExistentTool");
35
- const agent = new MockAgent({ newMessages: [message] });
36
-
37
- await copilotKitCore.runAgent({ agent: agent as any });
38
-
39
- expect(agent.messages.filter(m => m.role === "tool")).toHaveLength(0);
40
- });
41
- });
@@ -1,40 +0,0 @@
1
- import { describe, it, expect, beforeEach, vi } from "vitest";
2
- import { CopilotKitCore } from "../core";
3
- import {
4
- MockAgent,
5
- createToolCallMessage,
6
- createTool,
7
- } from "./test-utils";
8
-
9
- describe("CopilotKitCore Tool Simple", () => {
10
- let copilotKitCore: CopilotKitCore;
11
-
12
- beforeEach(() => {
13
- copilotKitCore = new CopilotKitCore({});
14
- });
15
-
16
- it("should execute a simple tool", async () => {
17
- console.log("Starting simple tool test");
18
-
19
- const toolName = "simpleTool";
20
- const tool = createTool({
21
- name: toolName,
22
- handler: vi.fn(async () => {
23
- console.log("Tool handler called");
24
- return "Simple result";
25
- }),
26
- followUp: false, // Important: no follow-up to avoid recursion
27
- });
28
- copilotKitCore.addTool(tool);
29
-
30
- const message = createToolCallMessage(toolName, { input: "test" });
31
- const agent = new MockAgent({ newMessages: [message] });
32
-
33
- console.log("About to run agent");
34
- await copilotKitCore.runAgent({ agent: agent as any });
35
- console.log("Agent run complete");
36
-
37
- expect(tool.handler).toHaveBeenCalledWith({ input: "test" });
38
- expect(agent.messages.length).toBeGreaterThan(0);
39
- });
40
- });
@@ -1,45 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
- import { CopilotKitCore } from '../core';
3
- import { FrontendTool } from '../types';
4
-
5
- describe('CopilotKitCore - Wildcard Tool Simple', () => {
6
- it('should add wildcard tool', () => {
7
- const core = new CopilotKitCore({
8
- headers: {},
9
- properties: {},
10
- });
11
-
12
- const wildcardTool: FrontendTool = {
13
- name: '*',
14
- handler: vi.fn(),
15
- };
16
-
17
- core.addTool(wildcardTool);
18
- expect(core.tools['*']).toBeDefined();
19
- expect(core.tools['*']?.name).toBe('*');
20
- });
21
-
22
- it('should not interfere with specific tools', () => {
23
- const core = new CopilotKitCore({
24
- headers: {},
25
- properties: {},
26
- });
27
-
28
- const specificTool: FrontendTool = {
29
- name: 'specific',
30
- handler: vi.fn(),
31
- };
32
-
33
- const wildcardTool: FrontendTool = {
34
- name: '*',
35
- handler: vi.fn(),
36
- };
37
-
38
- core.addTool(specificTool);
39
- core.addTool(wildcardTool);
40
-
41
- expect(core.tools['specific']).toBeDefined();
42
- expect(core.tools['*']).toBeDefined();
43
- expect(Object.keys(core.tools).length).toBe(2);
44
- });
45
- });
@@ -1,13 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { Message } from "@ag-ui/client";
3
-
4
- describe("Import Test", () => {
5
- it("should import Message type", () => {
6
- const msg: Message = {
7
- id: "test",
8
- role: "user",
9
- content: "test",
10
- };
11
- expect(msg.id).toBe("test");
12
- });
13
- });