diff --git a/typescript-sdk/integrations/mastra/package.json b/typescript-sdk/integrations/mastra/package.json index 38bb63908..f2c96e24b 100644 --- a/typescript-sdk/integrations/mastra/package.json +++ b/typescript-sdk/integrations/mastra/package.json @@ -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": { diff --git a/typescript-sdk/integrations/mastra/src/mastra.ts b/typescript-sdk/integrations/mastra/src/mastra.ts index f8310767b..eb1672303 100644 --- a/typescript-sdk/integrations/mastra/src/mastra.ts +++ b/typescript-sdk/integrations/mastra/src/mastra.ts @@ -28,8 +28,6 @@ import { GetRemoteAgentsOptions, GetLocalAgentOptions, getLocalAgent, - GetNetworkOptions, - getNetwork, } from "./utils"; export interface MastraAgentConfig extends AgentConfig { @@ -344,8 +342,4 @@ export class MastraAgent extends AbstractAgent { static getLocalAgent(options: GetLocalAgentOptions) { return getLocalAgent(options); } - - static getNetwork(options: GetNetworkOptions) { - return getNetwork(options); - } } diff --git a/typescript-sdk/integrations/mastra/src/utils.ts b/typescript-sdk/integrations/mastra/src/utils.ts index 17385c21d..abe718771 100644 --- a/typescript-sdk/integrations/mastra/src/utils.ts +++ b/typescript-sdk/integrations/mastra/src/utils.ts @@ -97,20 +97,6 @@ export function getLocalAgents({ runtimeContext, }: GetLocalAgentsOptions): Record { 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, - ); const agentAGUI = Object.entries(agents).reduce( (acc, [agentId, agent]) => { @@ -127,7 +113,6 @@ export function getLocalAgents({ return { ...agentAGUI, - ...networkAGUI, }; } @@ -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; -}