Skip to content

Commit 49bb147

Browse files
committed
chore(mastra): bump deps and update tests
Signed-off-by: Tyler Slaton <[email protected]>
1 parent 50c6b43 commit 49bb147

File tree

8 files changed

+1862
-185
lines changed

8 files changed

+1862
-185
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Set up Node.js
5959
uses: actions/setup-node@v4
6060
with:
61-
node-version: '18'
61+
node-version: '22'
6262

6363
- name: Install protoc
6464
uses: arduino/setup-protoc@v3
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import { test, expect } from "@playwright/test";
22
import { ToolBaseGenUIPage } from "../../featurePages/ToolBaseGenUIPage";
33

4-
const pageURL =
5-
"/mastra/feature/tool_based_generative_ui";
4+
const pageURL = "/mastra/feature/tool_based_generative_ui";
65

7-
// Fails. Not a test issue, issue with the integration or cpk.
8-
test.fixme('[Mastra] Haiku generation and display verification', async ({
9-
page,
10-
}) => {
6+
test("[Mastra] Haiku generation and display verification", async ({ page }) => {
117
await page.goto(pageURL);
128

139
const genAIAgent = new ToolBaseGenUIPage(page);
@@ -18,23 +14,24 @@ test.fixme('[Mastra] Haiku generation and display verification', async ({
1814
await genAIAgent.checkHaikuDisplay(page);
1915
});
2016

21-
// Fails. Not a test issue, issue with the integration or cpk.
22-
test.fixme('[Mastra] Haiku generation and UI consistency for two different prompts', async ({
23-
page,
24-
}) => {
25-
await page.goto(pageURL);
17+
// test infra issue, not an integration issue
18+
test.fixme(
19+
"[Mastra] Haiku generation and UI consistency for two different prompts",
20+
async ({ page }) => {
21+
await page.goto(pageURL);
2622

27-
const genAIAgent = new ToolBaseGenUIPage(page);
23+
const genAIAgent = new ToolBaseGenUIPage(page);
2824

29-
await expect(genAIAgent.haikuAgentIntro).toBeVisible();
25+
await expect(genAIAgent.haikuAgentIntro).toBeVisible();
3026

31-
const prompt1 = 'Generate Haiku for "I will always win"';
32-
await genAIAgent.generateHaiku(prompt1);
33-
await genAIAgent.checkGeneratedHaiku();
34-
await genAIAgent.checkHaikuDisplay(page);
27+
const prompt1 = 'Generate Haiku for "I will always win"';
28+
await genAIAgent.generateHaiku(prompt1);
29+
await genAIAgent.checkGeneratedHaiku();
30+
await genAIAgent.checkHaikuDisplay(page);
3531

36-
const prompt2 = 'Generate Haiku for "The moon shines bright"';
37-
await genAIAgent.generateHaiku(prompt2);
38-
await genAIAgent.checkGeneratedHaiku(); // Wait for second haiku to be generated
39-
await genAIAgent.checkHaikuDisplay(page); // Now compare the second haiku
40-
});
32+
const prompt2 = 'Generate Haiku for "The moon shines bright"';
33+
await genAIAgent.generateHaiku(prompt2);
34+
await genAIAgent.checkGeneratedHaiku(); // Wait for second haiku to be generated
35+
await genAIAgent.checkHaikuDisplay(page); // Now compare the second haiku
36+
},
37+
);

typescript-sdk/integrations/mastra/example/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"main": "index.js",
55
"scripts": {
6-
"test": "echo \"Error: no test specified\" && exit 1",
6+
"test": "echo \"no tests to run\" && exit 0",
77
"dev": "mastra dev",
88
"build": "mastra build"
99
},
@@ -17,16 +17,16 @@
1717
},
1818
"dependencies": {
1919
"@ai-sdk/openai": "^2.0.23",
20-
"@mastra/client-js": "^0.13.2",
21-
"@mastra/core": "^0.18.0",
22-
"@mastra/libsql": "^0.14.3",
23-
"@mastra/loggers": "^0.10.13",
24-
"@mastra/memory": "^0.15.3",
20+
"@mastra/client-js": "^0.14.0",
21+
"@mastra/core": "^0.19.0",
22+
"@mastra/libsql": "^0.15.0",
23+
"@mastra/loggers": "^0.10.14",
24+
"@mastra/memory": "^0.15.4",
2525
"zod": "^3.25.48"
2626
},
2727
"devDependencies": {
2828
"@types/node": "^22.15.29",
29-
"mastra": "^0.11.2",
29+
"mastra": "^0.13.3",
3030
"typescript": "^5.8.3"
3131
}
3232
}

typescript-sdk/integrations/mastra/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ag-ui/mastra",
3-
"version": "0.1.0-next.1",
3+
"version": "0.1.0",
44
"license": "Apache-2.0",
55
"main": "./dist/index.js",
66
"module": "./dist/index.mjs",
@@ -58,20 +58,20 @@
5858
},
5959
"dependencies": {
6060
"@ai-sdk/ui-utils": "^1.1.19",
61-
"@mastra/client-js": "^0.13.2",
61+
"@mastra/client-js": "^0.14.0",
6262
"rxjs": "7.8.1"
6363
},
6464
"peerDependencies": {
65-
"@ag-ui/core": ">=0.0.38",
66-
"@ag-ui/client": ">=0.0.38",
67-
"@copilotkit/runtime": "^1.10.4",
68-
"@mastra/core": ">=0.18.0",
65+
"@ag-ui/core": ">=0.0.39",
66+
"@ag-ui/client": ">=0.0.39",
67+
"@copilotkit/runtime": "^1.10.5",
68+
"@mastra/core": ">=0.19.0",
6969
"zod": "^3.25.67"
7070
},
7171
"devDependencies": {
7272
"@ag-ui/core": "workspace:*",
7373
"@ag-ui/client": "workspace:*",
74-
"@mastra/core": "^0.18.0",
74+
"@mastra/core": "^0.19.0",
7575
"@types/jest": "^29.5.14",
7676
"@types/node": "^20.11.19",
7777
"jest": "^29.7.0",

typescript-sdk/integrations/mastra/src/mastra.ts

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export class MastraAgent extends AbstractAgent {
211211

212212
run();
213213

214-
return () => { };
214+
return () => {};
215215
});
216216
}
217217

@@ -249,13 +249,11 @@ export class MastraAgent extends AbstractAgent {
249249
);
250250
const resourceId = this.resourceId ?? threadId;
251251

252-
253252
const convertedMessages = convertAGUIMessagesToMastra(messages);
254-
this.runtimeContext?.set('ag-ui', { context: inputContext });
253+
this.runtimeContext?.set("ag-ui", { context: inputContext });
255254
const runtimeContext = this.runtimeContext;
256255

257256
if (this.isLocalMastraAgent(this.agent)) {
258-
259257
// Local agent - use the agent's stream method directly
260258
try {
261259
const response = await this.agent.streamVNext(convertedMessages, {
@@ -271,40 +269,35 @@ export class MastraAgent extends AbstractAgent {
271269
if (response && typeof response === "object") {
272270
for await (const chunk of response.fullStream) {
273271
switch (chunk.type) {
274-
case 'text-delta': {
272+
case "text-delta": {
275273
onTextPart?.(chunk.payload.text);
276274
break;
277275
}
278-
case 'tool-call': {
276+
case "tool-call": {
279277
onToolCallPart?.({
280278
toolCallId: chunk.payload.toolCallId,
281279
toolName: chunk.payload.toolName,
282280
args: chunk.payload.args,
283281
});
284282
break;
285283
}
286-
case 'tool-result': {
284+
case "tool-result": {
287285
onToolResultPart?.({
288286
toolCallId: chunk.payload.toolCallId,
289287
result: chunk.payload.result,
290288
});
291289
break;
292290
}
293291

294-
case 'error': {
292+
case "error": {
295293
onError?.(new Error(chunk.payload.error as string));
296294
break;
297295
}
298296

299-
case 'finish': {
297+
case "finish": {
300298
onFinishMessagePart?.();
301299
break;
302300
}
303-
304-
case 'tool-output': {
305-
console.log(JSON.stringify(chunk.payload, null, 2))
306-
break;
307-
}
308301
}
309302
}
310303

@@ -331,28 +324,27 @@ export class MastraAgent extends AbstractAgent {
331324
await response.processDataStream({
332325
onChunk: async (chunk) => {
333326
switch (chunk.type) {
334-
case 'text-delta': {
327+
case "text-delta": {
335328
onTextPart?.(chunk.payload.text);
336329
break;
337330
}
338-
case 'tool-call': {
339-
331+
case "tool-call": {
340332
onToolCallPart?.({
341333
toolCallId: chunk.payload.toolCallId,
342334
toolName: chunk.payload.toolName,
343335
args: chunk.payload.args,
344336
});
345337
break;
346338
}
347-
case 'tool-result': {
339+
case "tool-result": {
348340
onToolResultPart?.({
349341
toolCallId: chunk.payload.toolCallId,
350342
result: chunk.payload.result,
351343
});
352344
break;
353345
}
354346

355-
case 'finish': {
347+
case "finish": {
356348
onFinishMessagePart?.();
357349
break;
358350
}

0 commit comments

Comments
 (0)