Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typescript-sdk/integrations/mastra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@ag-ui/core": ">=0.0.37",
"@ag-ui/client": ">=0.0.37",
"@copilotkit/runtime": "^1.9.3",
"@mastra/core": ">=0.11.1",
"@mastra/core": ">=0.11.1 <0.17.0",
"zod": "^3.25.67"
},
"devDependencies": {
Expand Down
6 changes: 0 additions & 6 deletions typescript-sdk/integrations/mastra/src/mastra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import {
GetRemoteAgentsOptions,
GetLocalAgentOptions,
getLocalAgent,
GetNetworkOptions,
getNetwork,
} from "./utils";

export interface MastraAgentConfig extends AgentConfig {
Expand Down Expand Up @@ -344,8 +342,4 @@ export class MastraAgent extends AbstractAgent {
static getLocalAgent(options: GetLocalAgentOptions) {
return getLocalAgent(options);
}

static getNetwork(options: GetNetworkOptions) {
return getNetwork(options);
}
}
35 changes: 0 additions & 35 deletions typescript-sdk/integrations/mastra/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,6 @@ export function getLocalAgents({
runtimeContext,
}: GetLocalAgentsOptions): Record<string, AbstractAgent> {
const agents = mastra.getAgents() || {};
const networks = mastra.getNetworks() || [];

const networkAGUI = networks.reduce(
(acc, network) => {
acc[network.name!] = new MastraAgent({
agentId: network.name!,
agent: network as unknown as LocalMastraAgent,
resourceId,
runtimeContext,
});
return acc;
},
{} as Record<string, AbstractAgent>,
);

const agentAGUI = Object.entries(agents).reduce(
(acc, [agentId, agent]) => {
Expand All @@ -127,7 +113,6 @@ export function getLocalAgents({

return {
...agentAGUI,
...networkAGUI,
};
}

Expand Down Expand Up @@ -155,23 +140,3 @@ export function getLocalAgent({
runtimeContext,
}) as AbstractAgent;
}

export interface GetNetworkOptions {
mastra: Mastra;
networkId: string;
resourceId?: string;
runtimeContext?: RuntimeContext;
}

export function getNetwork({ mastra, networkId, resourceId, runtimeContext }: GetNetworkOptions) {
const network = mastra.getNetwork(networkId);
if (!network) {
throw new Error(`Network ${networkId} not found`);
}
return new MastraAgent({
agentId: network.name!,
agent: network as unknown as LocalMastraAgent,
resourceId,
runtimeContext,
}) as AbstractAgent;
}