@mastra/server 0.0.0-default-storage-virtual-file-20250410035748 → 0.0.0-extend-clickhouse-20250418135620

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.
Files changed (32) hide show
  1. package/{LICENSE → LICENSE.md} +3 -1
  2. package/dist/_tsup-dts-rollup.d.cts +33 -24
  3. package/dist/_tsup-dts-rollup.d.ts +33 -24
  4. package/dist/{chunk-2JQC6JWP.js → chunk-3EJZQ6TQ.js} +4 -1
  5. package/dist/{chunk-ILW7XYNJ.js → chunk-4B7OUZXW.js} +17 -8
  6. package/dist/{chunk-GV52BII2.cjs → chunk-4WJ5GHRG.cjs} +13 -9
  7. package/dist/{chunk-QH6XWSXP.cjs → chunk-5SWCVTNL.cjs} +38 -38
  8. package/dist/{chunk-CWSDZEZG.cjs → chunk-7IWQE76Z.cjs} +2 -2
  9. package/dist/{chunk-4C3EPMMF.cjs → chunk-HABV7TZK.cjs} +12 -8
  10. package/dist/{chunk-5JOF627H.cjs → chunk-JLDXUWK7.cjs} +6 -3
  11. package/dist/{chunk-VK6FX47H.js → chunk-OMN3UI6X.js} +38 -38
  12. package/dist/{chunk-X37I6GZT.cjs → chunk-RNU4JMLM.cjs} +23 -14
  13. package/dist/{chunk-VB7KH62D.cjs → chunk-SKBVVI24.cjs} +4 -1
  14. package/dist/{chunk-BMA2ORRT.js → chunk-TFFNX7FI.js} +9 -5
  15. package/dist/{chunk-DVPP5S6I.js → chunk-WTHDCRMY.js} +2 -2
  16. package/dist/{chunk-YNSGUC2O.js → chunk-XISBMH56.js} +8 -4
  17. package/dist/{chunk-2YONKUWB.js → chunk-YANVFOYA.js} +6 -3
  18. package/dist/server/handlers/agents.cjs +7 -7
  19. package/dist/server/handlers/agents.js +1 -1
  20. package/dist/server/handlers/logs.cjs +4 -4
  21. package/dist/server/handlers/logs.js +1 -1
  22. package/dist/server/handlers/network.cjs +5 -5
  23. package/dist/server/handlers/network.js +1 -1
  24. package/dist/server/handlers/telemetry.cjs +3 -3
  25. package/dist/server/handlers/telemetry.js +1 -1
  26. package/dist/server/handlers/tools.cjs +5 -5
  27. package/dist/server/handlers/tools.js +1 -1
  28. package/dist/server/handlers/workflows.cjs +11 -11
  29. package/dist/server/handlers/workflows.js +1 -1
  30. package/dist/server/handlers.cjs +12 -12
  31. package/dist/server/handlers.js +6 -6
  32. package/package.json +5 -5
@@ -1,4 +1,6 @@
1
- Elastic License 2.0 (ELv2)
1
+ # Elastic License 2.0 (ELv2)
2
+
3
+ Copyright (c) 2025 Mastra AI, Inc.
2
4
 
3
5
  **Acceptance**
4
6
  By using the software, you agree to all of the terms and conditions below.
@@ -1,27 +1,27 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
+ import type { Container } from '@mastra/core/di';
4
5
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
6
+ import { EvalRow } from '@mastra/core/storage';
6
7
  import { GenerateObjectResult } from 'ai';
7
8
  import { GenerateTextResult } from 'ai';
8
9
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
10
  import type { MastraMemory } from '@mastra/core/memory';
11
11
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
12
+ import { MessageType } from '@mastra/core/memory';
13
13
  import type { QueryResult } from '@mastra/core/vector';
14
14
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
15
+ import { Step } from '@mastra/core/workflows';
16
+ import { StepExecutionContext } from '@mastra/core/workflows';
17
+ import { StepGraph } from '@mastra/core/workflows';
18
+ import { StorageThreadType } from '@mastra/core/memory';
19
19
  import type { ToolAction } from '@mastra/core/tools';
20
20
  import type { VercelTool } from '@mastra/core/tools';
21
21
  import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
22
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
23
+ import { WorkflowRunResult } from '@mastra/core/workflows';
24
+ import type { WorkflowRuns } from '@mastra/core/storage';
25
25
 
26
26
  export declare namespace agents {
27
27
  export {
@@ -87,23 +87,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
87
  metric: string | undefined;
88
88
  }>;
89
89
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
90
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, container, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
91
  agentId?: string;
92
92
  data: any;
93
+ container: Container;
93
94
  }): Promise<any>;
94
95
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, container, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
97
  data?: unknown;
98
+ container: Container;
97
99
  }) => Promise<any>;
98
100
 
99
- export declare function generateHandler({ mastra, agentId, body, }: Context & {
101
+ export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
102
+ container: Container;
100
103
  agentId: string;
101
104
  body: GetBody<'generate'> & {
102
105
  resourceid?: string;
103
106
  };
104
107
  }): Promise<GenerateTextResult<any, any>>;
105
108
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
109
+ export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
110
+ container: Container;
107
111
  body: {
108
112
  messages?: Parameters<AgentNetwork['generate']>[0];
109
113
  } & Parameters<AgentNetwork['generate']>[1];
@@ -159,7 +163,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
163
 
160
164
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
165
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
166
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
167
 
164
168
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
169
  transports: string[];
@@ -362,18 +366,20 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
366
 
363
367
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
368
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
369
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
366
370
  body: {
367
371
  stepId: string;
368
372
  context: any;
369
373
  };
374
+ container: Container;
370
375
  }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
371
376
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
377
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
373
378
  body: {
374
379
  stepId: string;
375
380
  context: any;
376
381
  };
382
+ container: Container;
377
383
  }): Promise<{
378
384
  message: string;
379
385
  }>;
@@ -386,12 +392,14 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
392
 
387
393
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
394
 
389
- export declare function startAsyncWorkflowHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
395
+ export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
390
396
  triggerData?: unknown;
397
+ container: Container;
391
398
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
399
 
393
- export declare function startWorkflowRunHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
400
+ export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
401
  triggerData?: unknown;
402
+ container: Container;
395
403
  }): Promise<{
396
404
  message: string;
397
405
  }>;
@@ -415,14 +423,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
423
  traceCount: number;
416
424
  }>;
417
425
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
426
+ export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
+ container: Container;
419
428
  agentId: string;
420
429
  body: GetBody<'stream'> & {
421
430
  resourceid?: string;
422
431
  };
423
432
  }): Promise<Response | undefined>;
424
433
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
434
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
+ container: Container;
426
436
  body: {
427
437
  messages?: Parameters<AgentNetwork['stream']>[0];
428
438
  } & Parameters<AgentNetwork['stream']>[1];
@@ -540,8 +550,7 @@ declare interface VoiceContext extends Context {
540
550
 
541
551
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
552
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
553
+ declare interface WorkflowContext extends Context {
545
554
  workflowId?: string;
546
555
  runId?: string;
547
556
  }
@@ -1,27 +1,27 @@
1
1
  import type { Agent } from '@mastra/core/agent';
2
2
  import type { AgentNetwork } from '@mastra/core/network';
3
- import { BaseLogMessage } from '@mastra/core';
3
+ import type { BaseLogMessage } from '@mastra/core/logger';
4
+ import type { Container } from '@mastra/core/di';
4
5
  import { CoreMessage } from 'ai';
5
- import { EvalRow } from '@mastra/core';
6
+ import { EvalRow } from '@mastra/core/storage';
6
7
  import { GenerateObjectResult } from 'ai';
7
8
  import { GenerateTextResult } from 'ai';
8
9
  import type { Mastra } from '@mastra/core/mastra';
9
- import type { Mastra as Mastra_2 } from '@mastra/core';
10
10
  import type { MastraMemory } from '@mastra/core/memory';
11
11
  import { Message } from 'ai';
12
- import { MessageType } from '@mastra/core';
12
+ import { MessageType } from '@mastra/core/memory';
13
13
  import type { QueryResult } from '@mastra/core/vector';
14
14
  import { ReadableStream as ReadableStream_2 } from 'node:stream/web';
15
- import { Step } from '@mastra/core';
16
- import { StepExecutionContext } from '@mastra/core';
17
- import { StepGraph } from '@mastra/core';
18
- import { StorageThreadType } from '@mastra/core';
15
+ import { Step } from '@mastra/core/workflows';
16
+ import { StepExecutionContext } from '@mastra/core/workflows';
17
+ import { StepGraph } from '@mastra/core/workflows';
18
+ import { StorageThreadType } from '@mastra/core/memory';
19
19
  import type { ToolAction } from '@mastra/core/tools';
20
20
  import type { VercelTool } from '@mastra/core/tools';
21
21
  import type { Workflow } from '@mastra/core/workflows';
22
- import { WorkflowContext as WorkflowContext_2 } from '@mastra/core';
23
- import { WorkflowRunResult } from '@mastra/core';
24
- import { WorkflowRuns } from '@mastra/core';
22
+ import { WorkflowContext as WorkflowContext_2 } from '@mastra/core/workflows';
23
+ import { WorkflowRunResult } from '@mastra/core/workflows';
24
+ import type { WorkflowRuns } from '@mastra/core/storage';
25
25
 
26
26
  export declare namespace agents {
27
27
  export {
@@ -87,23 +87,27 @@ export declare function describeIndex({ mastra, vectorName, indexName, }: Pick<V
87
87
  metric: string | undefined;
88
88
  }>;
89
89
 
90
- export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
90
+ export declare function executeAgentToolHandler({ mastra, agentId, toolId, data, container, }: Pick<ToolsContext, 'mastra' | 'toolId'> & {
91
91
  agentId?: string;
92
92
  data: any;
93
+ container: Container;
93
94
  }): Promise<any>;
94
95
 
95
- export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
+ export declare function executeToolHandler(tools: ToolsContext['tools']): ({ mastra, runId, toolId, data, container, }: Pick<ToolsContext, "mastra" | "toolId" | "runId"> & {
96
97
  data?: unknown;
98
+ container: Container;
97
99
  }) => Promise<any>;
98
100
 
99
- export declare function generateHandler({ mastra, agentId, body, }: Context & {
101
+ export declare function generateHandler({ mastra, container, agentId, body, }: Context & {
102
+ container: Container;
100
103
  agentId: string;
101
104
  body: GetBody<'generate'> & {
102
105
  resourceid?: string;
103
106
  };
104
107
  }): Promise<GenerateTextResult<any, any>>;
105
108
 
106
- export declare function generateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
109
+ export declare function generateHandler_alias_1({ mastra, container, networkId, body, }: NetworkContext & {
110
+ container: Container;
107
111
  body: {
108
112
  messages?: Parameters<AgentNetwork['generate']>[0];
109
113
  } & Parameters<AgentNetwork['generate']>[1];
@@ -159,7 +163,7 @@ export declare function getLiveEvalsByAgentIdHandler({ mastra, agentId }: Contex
159
163
 
160
164
  export declare function getLogsByRunIdHandler({ mastra, runId, transportId, }: Pick<LogsContext, 'mastra' | 'runId' | 'transportId'>): Promise<BaseLogMessage[] | undefined>;
161
165
 
162
- export declare function getLogsHandler({ mastra, transportId }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
166
+ export declare function getLogsHandler({ mastra, transportId, }: Pick<LogsContext, 'mastra' | 'transportId'>): Promise<BaseLogMessage[]>;
163
167
 
164
168
  export declare function getLogTransports({ mastra }: Pick<LogsContext, 'mastra'>): Promise<{
165
169
  transports: string[];
@@ -362,18 +366,20 @@ export declare function queryVectors({ mastra, vectorName, query, }: Pick<Vector
362
366
 
363
367
  declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308;
364
368
 
365
- export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
369
+ export declare function resumeAsyncWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
366
370
  body: {
367
371
  stepId: string;
368
372
  context: any;
369
373
  };
374
+ container: Container;
370
375
  }): Promise<Omit<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>, "runId"> | undefined>;
371
376
 
372
- export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, }: WorkflowContext & {
377
+ export declare function resumeWorkflowHandler({ mastra, workflowId, runId, body, container, }: WorkflowContext & {
373
378
  body: {
374
379
  stepId: string;
375
380
  context: any;
376
381
  };
382
+ container: Container;
377
383
  }): Promise<{
378
384
  message: string;
379
385
  }>;
@@ -386,12 +392,14 @@ export declare function saveMessagesHandler({ mastra, agentId, body, }: Pick<Mem
386
392
 
387
393
  declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
388
394
 
389
- export declare function startAsyncWorkflowHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
395
+ export declare function startAsyncWorkflowHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
390
396
  triggerData?: unknown;
397
+ container: Container;
391
398
  }): Promise<WorkflowRunResult<any, Step<string, any, any, StepExecutionContext<any, WorkflowContext_2<any, Step<string, any, any, any>[], Record<string, any>>>>[], any>>;
392
399
 
393
- export declare function startWorkflowRunHandler({ mastra, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
400
+ export declare function startWorkflowRunHandler({ mastra, container, workflowId, runId, triggerData, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'> & {
394
401
  triggerData?: unknown;
402
+ container: Container;
395
403
  }): Promise<{
396
404
  message: string;
397
405
  }>;
@@ -415,14 +423,16 @@ export declare function storeTelemetryHandler({ mastra, body }: Context & {
415
423
  traceCount: number;
416
424
  }>;
417
425
 
418
- export declare function streamGenerateHandler({ mastra, agentId, body, }: Context & {
426
+ export declare function streamGenerateHandler({ mastra, container, agentId, body, }: Context & {
427
+ container: Container;
419
428
  agentId: string;
420
429
  body: GetBody<'stream'> & {
421
430
  resourceid?: string;
422
431
  };
423
432
  }): Promise<Response | undefined>;
424
433
 
425
- export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, }: NetworkContext & {
434
+ export declare function streamGenerateHandler_alias_1({ mastra, networkId, body, container, }: NetworkContext & {
435
+ container: Container;
426
436
  body: {
427
437
  messages?: Parameters<AgentNetwork['stream']>[0];
428
438
  } & Parameters<AgentNetwork['stream']>[1];
@@ -540,8 +550,7 @@ declare interface VoiceContext extends Context {
540
550
 
541
551
  export declare function watchWorkflowHandler({ mastra, workflowId, runId, }: Pick<WorkflowContext, 'mastra' | 'workflowId' | 'runId'>): Promise<ReadableStream_2<string>>;
542
552
 
543
- declare interface WorkflowContext {
544
- mastra: Mastra_2;
553
+ declare interface WorkflowContext extends Context {
545
554
  workflowId?: string;
546
555
  runId?: string;
547
556
  }
@@ -9,7 +9,10 @@ __export(logs_exports, {
9
9
  getLogsByRunIdHandler: () => getLogsByRunIdHandler,
10
10
  getLogsHandler: () => getLogsHandler
11
11
  });
12
- async function getLogsHandler({ mastra, transportId }) {
12
+ async function getLogsHandler({
13
+ mastra,
14
+ transportId
15
+ }) {
13
16
  try {
14
17
  validateBody({ transportId });
15
18
  const logs = await mastra.getLogs(transportId);
@@ -1,4 +1,4 @@
1
- import { stringify, esm_default } from './chunk-VK6FX47H.js';
1
+ import { stringify, esm_default } from './chunk-OMN3UI6X.js';
2
2
  import { handleError } from './chunk-3AHQ5RGN.js';
3
3
  import { __export, HTTPException } from './chunk-TRDNDNGQ.js';
4
4
  import { ReadableStream } from 'node:stream/web';
@@ -78,6 +78,7 @@ async function getWorkflowByIdHandler({ mastra, workflowId }) {
78
78
  }
79
79
  async function startAsyncWorkflowHandler({
80
80
  mastra,
81
+ container,
81
82
  workflowId,
82
83
  runId,
83
84
  triggerData
@@ -93,7 +94,8 @@ async function startAsyncWorkflowHandler({
93
94
  if (!runId) {
94
95
  const { start } = workflow.createRun();
95
96
  const result2 = await start({
96
- triggerData
97
+ triggerData,
98
+ container
97
99
  });
98
100
  return result2;
99
101
  }
@@ -102,7 +104,8 @@ async function startAsyncWorkflowHandler({
102
104
  throw new HTTPException(404, { message: "Workflow run not found" });
103
105
  }
104
106
  const result = await run.start({
105
- triggerData
107
+ triggerData,
108
+ container
106
109
  });
107
110
  return result;
108
111
  } catch (error) {
@@ -155,6 +158,7 @@ async function createRunHandler({
155
158
  }
156
159
  async function startWorkflowRunHandler({
157
160
  mastra,
161
+ container,
158
162
  workflowId,
159
163
  runId,
160
164
  triggerData
@@ -172,7 +176,8 @@ async function startWorkflowRunHandler({
172
176
  throw new HTTPException(404, { message: "Workflow run not found" });
173
177
  }
174
178
  await run.start({
175
- triggerData
179
+ triggerData,
180
+ container
176
181
  });
177
182
  return { message: "Workflow run started" };
178
183
  } catch (e) {
@@ -227,7 +232,8 @@ async function resumeAsyncWorkflowHandler({
227
232
  mastra,
228
233
  workflowId,
229
234
  runId,
230
- body
235
+ body,
236
+ container
231
237
  }) {
232
238
  try {
233
239
  if (!workflowId) {
@@ -243,7 +249,8 @@ async function resumeAsyncWorkflowHandler({
243
249
  }
244
250
  const result = await run.resume({
245
251
  stepId: body.stepId,
246
- context: body.context
252
+ context: body.context,
253
+ container
247
254
  });
248
255
  return result;
249
256
  } catch (error) {
@@ -254,7 +261,8 @@ async function resumeWorkflowHandler({
254
261
  mastra,
255
262
  workflowId,
256
263
  runId,
257
- body
264
+ body,
265
+ container
258
266
  }) {
259
267
  try {
260
268
  if (!workflowId) {
@@ -270,7 +278,8 @@ async function resumeWorkflowHandler({
270
278
  }
271
279
  await run.resume({
272
280
  stepId: body.stepId,
273
- context: body.context
281
+ context: body.context,
282
+ container
274
283
  });
275
284
  return { message: "Workflow run resumed" };
276
285
  } catch (error) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkQH6XWSXP_cjs = require('./chunk-QH6XWSXP.cjs');
3
+ var chunk5SWCVTNL_cjs = require('./chunk-5SWCVTNL.cjs');
4
4
  var chunkQN4KF3BH_cjs = require('./chunk-QN4KF3BH.cjs');
5
5
  var chunkZLBRQFDD_cjs = require('./chunk-ZLBRQFDD.cjs');
6
6
  var chunkFV45V6WC_cjs = require('./chunk-FV45V6WC.cjs');
@@ -24,8 +24,8 @@ async function getAgentsHandler({ mastra }) {
24
24
  const _tool = tool;
25
25
  acc2[key] = {
26
26
  ..._tool,
27
- inputSchema: _tool.inputSchema ? chunkQH6XWSXP_cjs.stringify(chunkQH6XWSXP_cjs.esm_default(_tool.inputSchema)) : void 0,
28
- outputSchema: _tool.outputSchema ? chunkQH6XWSXP_cjs.stringify(chunkQH6XWSXP_cjs.esm_default(_tool.outputSchema)) : void 0
27
+ inputSchema: _tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.inputSchema)) : void 0,
28
+ outputSchema: _tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.outputSchema)) : void 0
29
29
  };
30
30
  return acc2;
31
31
  }, {});
@@ -53,8 +53,8 @@ async function getAgentByIdHandler({ mastra, agentId }) {
53
53
  const _tool = tool;
54
54
  acc[key] = {
55
55
  ..._tool,
56
- inputSchema: _tool.inputSchema ? chunkQH6XWSXP_cjs.stringify(chunkQH6XWSXP_cjs.esm_default(_tool.inputSchema)) : void 0,
57
- outputSchema: _tool.outputSchema ? chunkQH6XWSXP_cjs.stringify(chunkQH6XWSXP_cjs.esm_default(_tool.outputSchema)) : void 0
56
+ inputSchema: _tool.inputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.inputSchema)) : void 0,
57
+ outputSchema: _tool.outputSchema ? chunk5SWCVTNL_cjs.stringify(chunk5SWCVTNL_cjs.esm_default(_tool.outputSchema)) : void 0
58
58
  };
59
59
  return acc;
60
60
  }, {});
@@ -72,7 +72,7 @@ async function getAgentByIdHandler({ mastra, agentId }) {
72
72
  async function getEvalsByAgentIdHandler({ mastra, agentId }) {
73
73
  try {
74
74
  const agent = mastra.getAgent(agentId);
75
- const evals = await mastra.getStorage()?.__getEvalsByAgentName?.(agent.name, "test") || [];
75
+ const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "test") || [];
76
76
  return {
77
77
  id: agentId,
78
78
  name: agent.name,
@@ -86,7 +86,7 @@ async function getEvalsByAgentIdHandler({ mastra, agentId }) {
86
86
  async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
87
87
  try {
88
88
  const agent = mastra.getAgent(agentId);
89
- const evals = await mastra.getStorage()?.__getEvalsByAgentName?.(agent.name, "live") || [];
89
+ const evals = await mastra.getStorage()?.getEvalsByAgentName?.(agent.name, "live") || [];
90
90
  return {
91
91
  id: agentId,
92
92
  name: agent.name,
@@ -99,6 +99,7 @@ async function getLiveEvalsByAgentIdHandler({ mastra, agentId }) {
99
99
  }
100
100
  async function generateHandler({
101
101
  mastra,
102
+ container,
102
103
  agentId,
103
104
  body
104
105
  }) {
@@ -113,7 +114,8 @@ async function generateHandler({
113
114
  const result = await agent.generate(messages, {
114
115
  ...rest,
115
116
  // @ts-expect-error TODO fix types
116
- resourceId: finalResourceId
117
+ resourceId: finalResourceId,
118
+ container
117
119
  });
118
120
  return result;
119
121
  } catch (error) {
@@ -122,6 +124,7 @@ async function generateHandler({
122
124
  }
123
125
  async function streamGenerateHandler({
124
126
  mastra,
127
+ container,
125
128
  agentId,
126
129
  body
127
130
  }) {
@@ -136,7 +139,8 @@ async function streamGenerateHandler({
136
139
  const streamResult = await agent.stream(messages, {
137
140
  ...rest,
138
141
  // @ts-expect-error TODO fix types
139
- resourceId: finalResourceId
142
+ resourceId: finalResourceId,
143
+ container
140
144
  });
141
145
  const streamResponse = rest.output ? streamResult.toTextStreamResponse() : streamResult.toDataStreamResponse({
142
146
  sendUsage: true,