Skip to content

Commit 68236eb

Browse files
committed
[chore] Functions renamed for Mastra 0.20.0
1 parent f827d51 commit 68236eb

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

typescript-sdk/integrations/mastra/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@
5858
},
5959
"dependencies": {
6060
"@ai-sdk/ui-utils": "^1.1.19",
61-
"@mastra/client-js": "^0.14.0",
61+
"@mastra/client-js": "^0.15.0",
6262
"rxjs": "7.8.1"
6363
},
6464
"peerDependencies": {
6565
"@ag-ui/core": ">=0.0.39",
6666
"@ag-ui/client": ">=0.0.40",
6767
"@copilotkit/runtime": "^1.10.5",
68-
"@mastra/core": ">=0.19.0",
68+
"@mastra/core": ">=0.20.0",
6969
"zod": "^3.25.67"
7070
},
7171
"devDependencies": {
7272
"@ag-ui/core": "workspace:*",
7373
"@ag-ui/client": "workspace:*",
74-
"@mastra/core": "^0.19.0",
74+
"@mastra/core": "^0.20.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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export class MastraAgent extends AbstractAgent {
256256
if (this.isLocalMastraAgent(this.agent)) {
257257
// Local agent - use the agent's stream method directly
258258
try {
259-
const response = await this.agent.streamVNext(convertedMessages, {
259+
const response = await this.agent.stream(convertedMessages, {
260260
threadId,
261261
resourceId,
262262
runId,
@@ -311,7 +311,7 @@ export class MastraAgent extends AbstractAgent {
311311
} else {
312312
// Remote agent - use the remote agent's stream method
313313
try {
314-
const response = await this.agent.streamVNext({
314+
const response = await this.agent.stream({
315315
threadId,
316316
resourceId,
317317
runId,

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

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,6 @@ export function getLocalAgents({
9797
runtimeContext,
9898
}: GetLocalAgentsOptions): Record<string, AbstractAgent> {
9999
const agents = mastra.getAgents() || {};
100-
const networks = mastra.vnext_getNetworks() || [];
101-
102-
const networkAGUI = networks.reduce(
103-
(acc, network) => {
104-
acc[network.name!] = new MastraAgent({
105-
agentId: network.name!,
106-
agent: network as unknown as LocalMastraAgent,
107-
resourceId,
108-
runtimeContext,
109-
});
110-
return acc;
111-
},
112-
{} as Record<string, AbstractAgent>,
113-
);
114100

115101
const agentAGUI = Object.entries(agents).reduce(
116102
(acc, [agentId, agent]) => {
@@ -125,10 +111,7 @@ export function getLocalAgents({
125111
{} as Record<string, AbstractAgent>,
126112
);
127113

128-
return {
129-
...agentAGUI,
130-
...networkAGUI,
131-
};
114+
return agentAGUI;
132115
}
133116

134117
export interface GetLocalAgentOptions {
@@ -164,7 +147,7 @@ export interface GetNetworkOptions {
164147
}
165148

166149
export function getNetwork({ mastra, networkId, resourceId, runtimeContext }: GetNetworkOptions) {
167-
const network = mastra.vnext_getNetwork(networkId);
150+
const network = mastra.getAgent(networkId);
168151
if (!network) {
169152
throw new Error(`Network ${networkId} not found`);
170153
}

0 commit comments

Comments
 (0)