@mastra/server 0.0.0-vnextAgentNetwork-20250602134426 → 0.0.0-vnextAgentNetwork-20250616162946

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.
@@ -29,6 +29,7 @@ import { StepExecutionContext } from '@mastra/core/workflows/legacy';
29
29
  import { StepGraph } from '@mastra/core/workflows/legacy';
30
30
  import { StepResult } from '@mastra/core/workflows';
31
31
  import { StorageThreadType } from '@mastra/core/memory';
32
+ import { StreamEvent } from '@mastra/core/workflows';
32
33
  import { Task } from '@mastra/core/a2a';
33
34
  import { TaskAndHistory } from '@mastra/core/a2a';
34
35
  import type { TaskContext } from '@mastra/core/a2a';
@@ -39,7 +40,6 @@ import type { TaskStatus } from '@mastra/core/a2a';
39
40
  import type { ToolAction } from '@mastra/core/tools';
40
41
  import { UIMessage } from 'ai';
41
42
  import type { VercelTool } from '@mastra/core/tools';
42
- import { WatchEvent } from '@mastra/core/workflows';
43
43
  import type { Workflow } from '@mastra/core/workflows';
44
44
  import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
45
45
  import { WorkflowResult } from '@mastra/core/workflows';
@@ -778,7 +778,7 @@ export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, b
778
778
  message: string;
779
779
  };
780
780
  }): Promise<{
781
- stream: ReadableStream<WatchEvent>;
781
+ stream: ReadableStream<StreamEvent>;
782
782
  getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
783
783
  task: ZodString;
784
784
  resourceId: ZodString;
@@ -814,7 +814,7 @@ export declare function streamWorkflowHandler({ mastra, runtimeContext, workflow
814
814
  runtimeContext?: RuntimeContext_2;
815
815
  runtimeContextFromRequest?: Record<string, unknown>;
816
816
  }): {
817
- stream: globalThis.ReadableStream<WatchEvent>;
817
+ stream: globalThis.ReadableStream<StreamEvent>;
818
818
  getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
819
819
  };
820
820
 
@@ -29,6 +29,7 @@ import { StepExecutionContext } from '@mastra/core/workflows/legacy';
29
29
  import { StepGraph } from '@mastra/core/workflows/legacy';
30
30
  import { StepResult } from '@mastra/core/workflows';
31
31
  import { StorageThreadType } from '@mastra/core/memory';
32
+ import { StreamEvent } from '@mastra/core/workflows';
32
33
  import { Task } from '@mastra/core/a2a';
33
34
  import { TaskAndHistory } from '@mastra/core/a2a';
34
35
  import type { TaskContext } from '@mastra/core/a2a';
@@ -39,7 +40,6 @@ import type { TaskStatus } from '@mastra/core/a2a';
39
40
  import type { ToolAction } from '@mastra/core/tools';
40
41
  import { UIMessage } from 'ai';
41
42
  import type { VercelTool } from '@mastra/core/tools';
42
- import { WatchEvent } from '@mastra/core/workflows';
43
43
  import type { Workflow } from '@mastra/core/workflows';
44
44
  import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows/legacy';
45
45
  import { WorkflowResult } from '@mastra/core/workflows';
@@ -778,7 +778,7 @@ export declare function streamGenerateVNextNetworkHandler({ mastra, networkId, b
778
778
  message: string;
779
779
  };
780
780
  }): Promise<{
781
- stream: ReadableStream<WatchEvent>;
781
+ stream: ReadableStream<StreamEvent>;
782
782
  getWorkflowState: () => Promise<WorkflowResult<ZodObject< {
783
783
  task: ZodString;
784
784
  resourceId: ZodString;
@@ -814,7 +814,7 @@ export declare function streamWorkflowHandler({ mastra, runtimeContext, workflow
814
814
  runtimeContext?: RuntimeContext_2;
815
815
  runtimeContextFromRequest?: Record<string, unknown>;
816
816
  }): {
817
- stream: globalThis.ReadableStream<WatchEvent>;
817
+ stream: globalThis.ReadableStream<StreamEvent>;
818
818
  getWorkflowState: () => Promise<WorkflowResult<ZodType<any, ZodTypeDef, any>, Step<string, any, any, any, any>[]>>;
819
819
  };
820
820
 
@@ -204,7 +204,7 @@ async function getMessagesHandler({
204
204
  threadId,
205
205
  ...limit && { selectBy: { last: limit } }
206
206
  });
207
- return result;
207
+ return { messages: result.messages, uiMessages: result.uiMessages };
208
208
  } catch (error) {
209
209
  return chunk64U3UDTH_cjs.handleError(error, "Error getting messages");
210
210
  }
@@ -108,7 +108,8 @@ async function executeAgentToolHandler({
108
108
  if (!agent) {
109
109
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Tool not found" });
110
110
  }
111
- const tool = Object.values(agent?.tools || {}).find((tool2) => tool2.id === toolId);
111
+ const agentTools = await agent.getTools({ runtimeContext });
112
+ const tool = Object.values(agentTools || {}).find((tool2) => tool2.id === toolId);
112
113
  if (!tool) {
113
114
  throw new chunkOCWPVYNI_cjs.HTTPException(404, { message: "Tool not found" });
114
115
  }
@@ -106,7 +106,8 @@ async function executeAgentToolHandler({
106
106
  if (!agent) {
107
107
  throw new HTTPException(404, { message: "Tool not found" });
108
108
  }
109
- const tool = Object.values(agent?.tools || {}).find((tool2) => tool2.id === toolId);
109
+ const agentTools = await agent.getTools({ runtimeContext });
110
+ const tool = Object.values(agentTools || {}).find((tool2) => tool2.id === toolId);
110
111
  if (!tool) {
111
112
  throw new HTTPException(404, { message: "Tool not found" });
112
113
  }
@@ -202,7 +202,7 @@ async function getMessagesHandler({
202
202
  threadId,
203
203
  ...limit && { selectBy: { last: limit } }
204
204
  });
205
- return result;
205
+ return { messages: result.messages, uiMessages: result.uiMessages };
206
206
  } catch (error) {
207
207
  return handleError(error, "Error getting messages");
208
208
  }
@@ -1,38 +1,38 @@
1
1
  'use strict';
2
2
 
3
- var chunkY7UWRW5X_cjs = require('../../chunk-Y7UWRW5X.cjs');
3
+ var chunk6TJSHFCJ_cjs = require('../../chunk-6TJSHFCJ.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "createThreadHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunkY7UWRW5X_cjs.createThreadHandler; }
9
+ get: function () { return chunk6TJSHFCJ_cjs.createThreadHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "deleteThreadHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkY7UWRW5X_cjs.deleteThreadHandler; }
13
+ get: function () { return chunk6TJSHFCJ_cjs.deleteThreadHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getMemoryStatusHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkY7UWRW5X_cjs.getMemoryStatusHandler; }
17
+ get: function () { return chunk6TJSHFCJ_cjs.getMemoryStatusHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getMessagesHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunkY7UWRW5X_cjs.getMessagesHandler; }
21
+ get: function () { return chunk6TJSHFCJ_cjs.getMessagesHandler; }
22
22
  });
23
23
  Object.defineProperty(exports, "getThreadByIdHandler", {
24
24
  enumerable: true,
25
- get: function () { return chunkY7UWRW5X_cjs.getThreadByIdHandler; }
25
+ get: function () { return chunk6TJSHFCJ_cjs.getThreadByIdHandler; }
26
26
  });
27
27
  Object.defineProperty(exports, "getThreadsHandler", {
28
28
  enumerable: true,
29
- get: function () { return chunkY7UWRW5X_cjs.getThreadsHandler; }
29
+ get: function () { return chunk6TJSHFCJ_cjs.getThreadsHandler; }
30
30
  });
31
31
  Object.defineProperty(exports, "saveMessagesHandler", {
32
32
  enumerable: true,
33
- get: function () { return chunkY7UWRW5X_cjs.saveMessagesHandler; }
33
+ get: function () { return chunk6TJSHFCJ_cjs.saveMessagesHandler; }
34
34
  });
35
35
  Object.defineProperty(exports, "updateThreadHandler", {
36
36
  enumerable: true,
37
- get: function () { return chunkY7UWRW5X_cjs.updateThreadHandler; }
37
+ get: function () { return chunk6TJSHFCJ_cjs.updateThreadHandler; }
38
38
  });
@@ -1 +1 @@
1
- export { createThreadHandler, deleteThreadHandler, getMemoryStatusHandler, getMessagesHandler, getThreadByIdHandler, getThreadsHandler, saveMessagesHandler, updateThreadHandler } from '../../chunk-DJJIUEL2.js';
1
+ export { createThreadHandler, deleteThreadHandler, getMemoryStatusHandler, getMessagesHandler, getThreadByIdHandler, getThreadsHandler, saveMessagesHandler, updateThreadHandler } from '../../chunk-I7KJZNX5.js';
@@ -1,22 +1,22 @@
1
1
  'use strict';
2
2
 
3
- var chunkZE5AAC4I_cjs = require('../../chunk-ZE5AAC4I.cjs');
3
+ var chunk7VOSGHNC_cjs = require('../../chunk-7VOSGHNC.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "executeAgentToolHandler", {
8
8
  enumerable: true,
9
- get: function () { return chunkZE5AAC4I_cjs.executeAgentToolHandler; }
9
+ get: function () { return chunk7VOSGHNC_cjs.executeAgentToolHandler; }
10
10
  });
11
11
  Object.defineProperty(exports, "executeToolHandler", {
12
12
  enumerable: true,
13
- get: function () { return chunkZE5AAC4I_cjs.executeToolHandler; }
13
+ get: function () { return chunk7VOSGHNC_cjs.executeToolHandler; }
14
14
  });
15
15
  Object.defineProperty(exports, "getToolByIdHandler", {
16
16
  enumerable: true,
17
- get: function () { return chunkZE5AAC4I_cjs.getToolByIdHandler; }
17
+ get: function () { return chunk7VOSGHNC_cjs.getToolByIdHandler; }
18
18
  });
19
19
  Object.defineProperty(exports, "getToolsHandler", {
20
20
  enumerable: true,
21
- get: function () { return chunkZE5AAC4I_cjs.getToolsHandler; }
21
+ get: function () { return chunk7VOSGHNC_cjs.getToolsHandler; }
22
22
  });
@@ -1 +1 @@
1
- export { executeAgentToolHandler, executeToolHandler, getToolByIdHandler, getToolsHandler } from '../../chunk-TJKLBTFB.js';
1
+ export { executeAgentToolHandler, executeToolHandler, getToolByIdHandler, getToolsHandler } from '../../chunk-B6AYBJUA.js';
@@ -2,7 +2,7 @@
2
2
 
3
3
  var chunkVPNDC2DI_cjs = require('../chunk-VPNDC2DI.cjs');
4
4
  var chunkB4MQFJ7G_cjs = require('../chunk-B4MQFJ7G.cjs');
5
- var chunkZE5AAC4I_cjs = require('../chunk-ZE5AAC4I.cjs');
5
+ var chunk7VOSGHNC_cjs = require('../chunk-7VOSGHNC.cjs');
6
6
  var chunkBNEY4P4P_cjs = require('../chunk-BNEY4P4P.cjs');
7
7
  var chunkCMMOIUFC_cjs = require('../chunk-CMMOIUFC.cjs');
8
8
  var chunkMMO2HDM6_cjs = require('../chunk-MMO2HDM6.cjs');
@@ -10,7 +10,7 @@ var chunkSDPGVWQJ_cjs = require('../chunk-SDPGVWQJ.cjs');
10
10
  var chunkA3KDUGS7_cjs = require('../chunk-A3KDUGS7.cjs');
11
11
  var chunkYIOVBYZH_cjs = require('../chunk-YIOVBYZH.cjs');
12
12
  var chunkNEOOQUKW_cjs = require('../chunk-NEOOQUKW.cjs');
13
- var chunkY7UWRW5X_cjs = require('../chunk-Y7UWRW5X.cjs');
13
+ var chunk6TJSHFCJ_cjs = require('../chunk-6TJSHFCJ.cjs');
14
14
 
15
15
 
16
16
 
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "telemetry", {
24
24
  });
25
25
  Object.defineProperty(exports, "tools", {
26
26
  enumerable: true,
27
- get: function () { return chunkZE5AAC4I_cjs.tools_exports; }
27
+ get: function () { return chunk7VOSGHNC_cjs.tools_exports; }
28
28
  });
29
29
  Object.defineProperty(exports, "vector", {
30
30
  enumerable: true,
@@ -56,5 +56,5 @@ Object.defineProperty(exports, "logs", {
56
56
  });
57
57
  Object.defineProperty(exports, "memory", {
58
58
  enumerable: true,
59
- get: function () { return chunkY7UWRW5X_cjs.memory_exports; }
59
+ get: function () { return chunk6TJSHFCJ_cjs.memory_exports; }
60
60
  });
@@ -1,6 +1,6 @@
1
1
  export { network_exports as network } from '../chunk-C7564HUT.js';
2
2
  export { telemetry_exports as telemetry } from '../chunk-BFOA2QQY.js';
3
- export { tools_exports as tools } from '../chunk-TJKLBTFB.js';
3
+ export { tools_exports as tools } from '../chunk-B6AYBJUA.js';
4
4
  export { vector_exports as vector } from '../chunk-55DOQLP6.js';
5
5
  export { voice_exports as voice } from '../chunk-CP55EVBK.js';
6
6
  export { workflows_exports as workflows } from '../chunk-KUNQFY2W.js';
@@ -8,4 +8,4 @@ export { a2a_exports as a2a } from '../chunk-GHC4YV6R.js';
8
8
  export { agents_exports as agents } from '../chunk-J3PKLB3A.js';
9
9
  export { legacyWorkflows_exports as legacyWorkflows } from '../chunk-W7VCKPAD.js';
10
10
  export { logs_exports as logs } from '../chunk-DQLE3DVM.js';
11
- export { memory_exports as memory } from '../chunk-DJJIUEL2.js';
11
+ export { memory_exports as memory } from '../chunk-I7KJZNX5.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/server",
3
- "version": "0.0.0-vnextAgentNetwork-20250602134426",
3
+ "version": "0.0.0-vnextAgentNetwork-20250616162946",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
@@ -60,8 +60,8 @@
60
60
  "vitest": "^2.1.9",
61
61
  "zod": "^3.24.3",
62
62
  "zod-to-json-schema": "^3.24.5",
63
- "@internal/lint": "0.0.0-vnextAgentNetwork-20250602134426",
64
- "@mastra/core": "0.0.0-vnextAgentNetwork-20250602134426"
63
+ "@internal/lint": "0.0.0-vnextAgentNetwork-20250616162946",
64
+ "@mastra/core": "0.0.0-vnextAgentNetwork-20250616162946"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsup src/index.ts src/server/handlers.ts src/server/handlers/*.ts !src/server/handlers/*.test.ts --format esm,cjs --clean --experimental-dts --treeshake=smallest --splitting",