@mastra/core 0.10.6 → 0.10.7-alpha.0

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 (59) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.d.cts +1 -1
  3. package/dist/agent/index.d.ts +1 -1
  4. package/dist/agent/index.js +1 -1
  5. package/dist/{base-DE2hOc0_.d.ts → base-3zbJmq45.d.ts} +53 -14
  6. package/dist/{base-Bgm3ALU_.d.cts → base-CX6uD7yR.d.cts} +53 -14
  7. package/dist/{chunk-7SHAFG4W.js → chunk-42YZQOIR.js} +1 -1
  8. package/dist/{chunk-E7QDFGWS.cjs → chunk-5ETY3Q3F.cjs} +2 -2
  9. package/dist/{chunk-3SZLJIPE.cjs → chunk-7KWHHSK5.cjs} +1 -0
  10. package/dist/{chunk-RFGZJIMI.js → chunk-ATXD4775.js} +1 -0
  11. package/dist/{chunk-5KUEAJII.cjs → chunk-GSMJGWQS.cjs} +242 -13
  12. package/dist/{chunk-BCDHHEFP.js → chunk-OYNUZURI.js} +241 -12
  13. package/dist/eval/index.d.cts +1 -1
  14. package/dist/eval/index.d.ts +1 -1
  15. package/dist/index.cjs +15 -15
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +4 -4
  19. package/dist/integration/index.d.cts +1 -1
  20. package/dist/integration/index.d.ts +1 -1
  21. package/dist/llm/index.d.cts +1 -1
  22. package/dist/llm/index.d.ts +1 -1
  23. package/dist/mastra/index.d.cts +1 -1
  24. package/dist/mastra/index.d.ts +1 -1
  25. package/dist/mcp/index.d.cts +1 -1
  26. package/dist/mcp/index.d.ts +1 -1
  27. package/dist/memory/index.d.cts +1 -1
  28. package/dist/memory/index.d.ts +1 -1
  29. package/dist/network/index.cjs +2 -2
  30. package/dist/network/index.d.cts +1 -1
  31. package/dist/network/index.d.ts +1 -1
  32. package/dist/network/index.js +1 -1
  33. package/dist/relevance/index.cjs +4 -4
  34. package/dist/relevance/index.d.cts +1 -1
  35. package/dist/relevance/index.d.ts +1 -1
  36. package/dist/relevance/index.js +1 -1
  37. package/dist/server/index.d.cts +2 -2
  38. package/dist/server/index.d.ts +2 -2
  39. package/dist/storage/index.cjs +5 -0
  40. package/dist/storage/index.d.cts +7 -2
  41. package/dist/storage/index.d.ts +7 -2
  42. package/dist/storage/index.js +5 -0
  43. package/dist/telemetry/index.d.cts +1 -1
  44. package/dist/telemetry/index.d.ts +1 -1
  45. package/dist/tools/index.d.cts +2 -2
  46. package/dist/tools/index.d.ts +2 -2
  47. package/dist/utils.d.cts +1 -1
  48. package/dist/utils.d.ts +1 -1
  49. package/dist/voice/index.d.cts +1 -1
  50. package/dist/voice/index.d.ts +1 -1
  51. package/dist/workflows/index.cjs +9 -9
  52. package/dist/workflows/index.d.cts +17 -28
  53. package/dist/workflows/index.d.ts +17 -28
  54. package/dist/workflows/index.js +1 -1
  55. package/dist/workflows/legacy/index.cjs +22 -22
  56. package/dist/workflows/legacy/index.d.cts +2 -2
  57. package/dist/workflows/legacy/index.d.ts +2 -2
  58. package/dist/workflows/legacy/index.js +1 -1
  59. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk3SZLJIPE_cjs = require('../chunk-3SZLJIPE.cjs');
3
+ var chunk7KWHHSK5_cjs = require('../chunk-7KWHHSK5.cjs');
4
4
  var chunk6NCAW2KJ_cjs = require('../chunk-6NCAW2KJ.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunk3SZLJIPE_cjs.Agent; }
10
+ get: function () { return chunk7KWHHSK5_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "MessageList", {
13
13
  enumerable: true,
@@ -1,7 +1,7 @@
1
1
  export { Message as AiMessageType } from 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent, as as AgentConfig, bZ as AgentGenerateOptions, bY as AgentMemoryOption, b_ as AgentStreamOptions, bX as DynamicArgument, bv as MastraLanguageModel, b$ as MastraMessageContentV2, s as MastraMessageV2, bV as MessageList, T as ToolsInput, bW as ToolsetsInput } from '../base-Bgm3ALU_.cjs';
4
+ export { A as Agent, as as AgentConfig, b$ as AgentGenerateOptions, b_ as AgentMemoryOption, c0 as AgentStreamOptions, bZ as DynamicArgument, bx as MastraLanguageModel, c1 as MastraMessageContentV2, s as MastraMessageV2, bX as MessageList, T as ToolsInput, bY as ToolsetsInput } from '../base-CX6uD7yR.cjs';
5
5
  import '../base-DVVTzIQy.cjs';
6
6
  import '../types-Bo1uigWx.cjs';
7
7
  import '../runtime-context/index.cjs';
@@ -1,7 +1,7 @@
1
1
  export { Message as AiMessageType } from 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent, as as AgentConfig, bZ as AgentGenerateOptions, bY as AgentMemoryOption, b_ as AgentStreamOptions, bX as DynamicArgument, bv as MastraLanguageModel, b$ as MastraMessageContentV2, s as MastraMessageV2, bV as MessageList, T as ToolsInput, bW as ToolsetsInput } from '../base-DE2hOc0_.js';
4
+ export { A as Agent, as as AgentConfig, b$ as AgentGenerateOptions, b_ as AgentMemoryOption, c0 as AgentStreamOptions, bZ as DynamicArgument, bx as MastraLanguageModel, c1 as MastraMessageContentV2, s as MastraMessageV2, bX as MessageList, T as ToolsInput, bY as ToolsetsInput } from '../base-3zbJmq45.js';
5
5
  import '../base-BbdvunNJ.js';
6
6
  import '../types-Bo1uigWx.js';
7
7
  import '../runtime-context/index.js';
@@ -1,2 +1,2 @@
1
- export { Agent } from '../chunk-RFGZJIMI.js';
1
+ export { Agent } from '../chunk-ATXD4775.js';
2
2
  export { MessageList } from '../chunk-GTG6JWTV.js';
@@ -226,7 +226,7 @@ type StepSuspended$1<T> = {
226
226
  suspendPayload?: any;
227
227
  output?: T;
228
228
  };
229
- type StepWaiting = {
229
+ type StepWaiting$1 = {
230
230
  status: 'waiting';
231
231
  };
232
232
  type StepFailure$1 = {
@@ -236,7 +236,7 @@ type StepFailure$1 = {
236
236
  type StepSkipped = {
237
237
  status: 'skipped';
238
238
  };
239
- type StepResult$1<T> = StepSuccess$1<T> | StepFailure$1 | StepSuspended$1<T> | StepWaiting | StepSkipped;
239
+ type StepResult$1<T> = StepSuccess$1<T> | StepFailure$1 | StepSuspended$1<T> | StepWaiting$1 | StepSkipped;
240
240
  type StepsRecord$1<T extends readonly LegacyStep<any, any, z.ZodType<any> | undefined>[]> = {
241
241
  [K in T[number]['id']]: Extract<T[number], {
242
242
  id: K;
@@ -1054,9 +1054,7 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, Eng
1054
1054
  steps: string[];
1055
1055
  resumePayload: any;
1056
1056
  };
1057
- [EMITTER_SYMBOL]: {
1058
- emit: (event: string, data: any) => Promise<void>;
1059
- };
1057
+ [EMITTER_SYMBOL]: Emitter;
1060
1058
  engine: EngineType;
1061
1059
  }) => Promise<TStepOutput>;
1062
1060
  interface Step<TStepId extends string = string, TSchemaIn extends z.ZodType<any> = z.ZodType<any>, TSchemaOut extends z.ZodType<any> = z.ZodType<any>, TResumeSchema extends z.ZodType<any> = z.ZodType<any>, TSuspendSchema extends z.ZodType<any> = z.ZodType<any>, TEngineType = any> {
@@ -1070,6 +1068,12 @@ interface Step<TStepId extends string = string, TSchemaIn extends z.ZodType<any>
1070
1068
  retries?: number;
1071
1069
  }
1072
1070
 
1071
+ type Emitter = {
1072
+ emit: (event: string, data: any) => Promise<void>;
1073
+ on: (event: string, callback: (data: any) => void) => void;
1074
+ off: (event: string, callback: (data: any) => void) => void;
1075
+ once: (event: string, callback: (data: any) => void) => void;
1076
+ };
1073
1077
  type StepSuccess<P, R, S, T> = {
1074
1078
  status: 'success';
1075
1079
  output: T;
@@ -1108,7 +1112,14 @@ type StepRunning<P, R, S> = {
1108
1112
  suspendedAt?: number;
1109
1113
  resumedAt?: number;
1110
1114
  };
1111
- type StepResult<P, R, S, T> = StepSuccess<P, R, S, T> | StepFailure<P, R, S> | StepSuspended<P, S> | StepRunning<P, R, S>;
1115
+ type StepWaiting<P, R, S> = {
1116
+ status: 'waiting';
1117
+ payload: P;
1118
+ suspendPayload?: S;
1119
+ resumePayload?: R;
1120
+ startedAt: number;
1121
+ };
1122
+ type StepResult<P, R, S, T> = StepSuccess<P, R, S, T> | StepFailure<P, R, S> | StepSuspended<P, S> | StepRunning<P, R, S> | StepWaiting<P, R, S>;
1112
1123
  type StepsRecord<T extends readonly Step<any, any, any>[]> = {
1113
1124
  [K in T[number]['id']]: Extract<T[number], {
1114
1125
  id: K;
@@ -1134,22 +1145,26 @@ type StreamEvent = TextStreamPart<any> | {
1134
1145
  type: 'step-suspended';
1135
1146
  payload: any;
1136
1147
  id: string;
1148
+ } | {
1149
+ type: 'step-waiting';
1150
+ payload: any;
1151
+ id: string;
1137
1152
  };
1138
1153
  type WatchEvent = {
1139
1154
  type: 'watch';
1140
1155
  payload: {
1141
1156
  currentStep?: {
1142
1157
  id: string;
1143
- status: 'running' | 'success' | 'failed' | 'suspended';
1158
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1144
1159
  output?: Record<string, any>;
1145
1160
  resumePayload?: Record<string, any>;
1146
1161
  payload?: Record<string, any>;
1147
1162
  error?: string | Error;
1148
1163
  };
1149
1164
  workflowState: {
1150
- status: 'running' | 'success' | 'failed' | 'suspended';
1165
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1151
1166
  steps: Record<string, {
1152
- status: 'running' | 'success' | 'failed' | 'suspended';
1167
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1153
1168
  output?: Record<string, any>;
1154
1169
  payload?: Record<string, any>;
1155
1170
  resumePayload?: Record<string, any>;
@@ -1169,7 +1184,7 @@ type WatchEvent = {
1169
1184
  type ZodPathType<T extends z.ZodTypeAny, P extends string> = T extends z.ZodObject<infer Shape> ? P extends `${infer Key}.${infer Rest}` ? Key extends keyof Shape ? Shape[Key] extends z.ZodTypeAny ? ZodPathType<Shape[Key], Rest> : never : never : P extends keyof Shape ? Shape[P] : never : never;
1170
1185
  interface WorkflowRunState {
1171
1186
  runId: string;
1172
- status: 'success' | 'failed' | 'suspended' | 'running';
1187
+ status: 'success' | 'failed' | 'suspended' | 'running' | 'waiting';
1173
1188
  result?: Record<string, any>;
1174
1189
  error?: string | Error;
1175
1190
  value: Record<string, string>;
@@ -1217,9 +1232,7 @@ declare abstract class ExecutionEngine extends MastraBase {
1217
1232
  resumePayload: any;
1218
1233
  resumePath: number[];
1219
1234
  };
1220
- emitter: {
1221
- emit: (event: string, data: any) => Promise<void>;
1222
- };
1235
+ emitter: Emitter;
1223
1236
  runtimeContext: RuntimeContext;
1224
1237
  retryConfig?: {
1225
1238
  attempts?: number;
@@ -1240,6 +1253,11 @@ type StepFlowEntry<TEngineType = DefaultEngineType> = {
1240
1253
  type: 'sleepUntil';
1241
1254
  id: string;
1242
1255
  date: Date;
1256
+ } | {
1257
+ type: 'waitForEvent';
1258
+ event: string;
1259
+ step: Step;
1260
+ timeout?: number;
1243
1261
  } | {
1244
1262
  type: 'parallel';
1245
1263
  steps: StepFlowEntry[];
@@ -1283,6 +1301,11 @@ type SerializedStepFlowEntry = {
1283
1301
  type: 'sleepUntil';
1284
1302
  id: string;
1285
1303
  date: Date;
1304
+ } | {
1305
+ type: 'waitForEvent';
1306
+ event: string;
1307
+ step: SerializedStep;
1308
+ timeout?: number;
1286
1309
  } | {
1287
1310
  type: 'parallel';
1288
1311
  steps: SerializedStepFlowEntry[];
@@ -1416,6 +1439,9 @@ declare class Workflow<TEngineType = any, TSteps extends Step<string, any, any,
1416
1439
  * @returns The workflow instance for chaining
1417
1440
  */
1418
1441
  sleepUntil(date: Date): Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema>;
1442
+ waitForEvent<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(event: string, step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, opts?: {
1443
+ timeout?: number;
1444
+ }): Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1419
1445
  map<TSteps extends Step<string, any, any, any, any, TEngineType>[], TMapping extends {
1420
1446
  [K in keyof TMapping]: {
1421
1447
  step: TSteps[number] | TSteps[number][];
@@ -1519,6 +1545,8 @@ declare class Run<TEngineType = any, TSteps extends Step<string, any, any, any,
1519
1545
  * The serialized step graph for this run
1520
1546
  */
1521
1547
  serializedStepGraph: SerializedStepFlowEntry[];
1548
+ protected closeStreamAction?: () => Promise<void>;
1549
+ protected executionResults?: Promise<WorkflowResult<TOutput, TSteps>>;
1522
1550
  protected cleanup?: () => void;
1523
1551
  protected retryConfig?: {
1524
1552
  attempts?: number;
@@ -1537,6 +1565,7 @@ declare class Run<TEngineType = any, TSteps extends Step<string, any, any, any,
1537
1565
  cleanup?: () => void;
1538
1566
  serializedStepGraph: SerializedStepFlowEntry[];
1539
1567
  });
1568
+ sendEvent(event: string, data: any): void;
1540
1569
  /**
1541
1570
  * Starts the workflow execution with the provided input
1542
1571
  * @param input The input data for the workflow
@@ -1765,6 +1794,7 @@ type MastraMessageContentV2 = {
1765
1794
  toolInvocations?: UIMessage['toolInvocations'];
1766
1795
  reasoning?: UIMessage['reasoning'];
1767
1796
  annotations?: UIMessage['annotations'];
1797
+ metadata?: Record<string, unknown>;
1768
1798
  };
1769
1799
  type MastraMessageV2 = {
1770
1800
  id: string;
@@ -3605,6 +3635,15 @@ declare abstract class MastraStorage extends MastraBase {
3605
3635
  messages: MastraMessageV2[];
3606
3636
  format: 'v2';
3607
3637
  }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
3638
+ abstract updateMessages(args: {
3639
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
3640
+ id: string;
3641
+ content?: {
3642
+ metadata?: MastraMessageContentV2['metadata'];
3643
+ content?: MastraMessageContentV2['content'];
3644
+ };
3645
+ }[];
3646
+ }): Promise<MastraMessageV2[]>;
3608
3647
  abstract getTraces(args: StorageGetTracesArg): Promise<any[]>;
3609
3648
  init(): Promise<void>;
3610
3649
  persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
@@ -3646,4 +3685,4 @@ declare abstract class MastraStorage extends MastraBase {
3646
3685
  }>;
3647
3686
  }
3648
3687
 
3649
- export { type ActionContext as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, TABLE_WORKFLOW_SNAPSHOT as D, type EvalRow as E, TABLE_EVALS as F, TABLE_MESSAGES as G, TABLE_THREADS as H, TABLE_TRACES as I, TABLE_SCHEMAS as J, type VariableReference$1 as K, LegacyWorkflow as L, Mastra as M, type StepResult$1 as N, type StepAction as O, type PaginationInfo as P, type LegacyWorkflowRunResult as Q, type WorkflowOptions as R, type StepExecutionContext as S, type ToolsInput as T, type StepVariableType as U, type VercelTool as V, type WorkflowContext as W, type StepNode as X, type StepGraph as Y, type RetryConfig as Z, type BaseCondition as _, type MastraPrimitives as a, type WorkingMemoryFormat as a$, WhenConditionReturnValue as a0, type StepDef as a1, type StepCondition as a2, type StepConfig as a3, type StepsRecord$1 as a4, type WorkflowLogMessage as a5, type WorkflowEvent as a6, type ResolverFunctionInput as a7, type ResolverFunctionOutput as a8, type SubscriberFunctionOutput as a9, type CoreToolMessage as aA, type EmbedResult as aB, type EmbedManyResult as aC, type BaseStructuredOutputType as aD, type StructuredOutputType as aE, type StructuredOutputArrayItem as aF, type StructuredOutput as aG, type GenerateReturn as aH, type StreamReturn as aI, type OutputType as aJ, type DefaultLLMTextOptions as aK, type DefaultLLMTextObjectOptions as aL, type DefaultLLMStreamOptions as aM, type DefaultLLMStreamObjectOptions as aN, type LLMTextOptions as aO, type LLMTextObjectOptions as aP, type LLMStreamOptions as aQ, type LLMInnerStreamOptions as aR, type LLMStreamObjectOptions as aS, createMockModel as aT, type Config as aU, type MessageType as aV, type MessageResponse as aW, type WorkingMemory as aX, type MemoryConfig as aY, type SharedMemoryConfig as aZ, type TraceType as a_, type DependencyCheckOutput as aa, type StepResolverOutput as ab, type WorkflowActors as ac, type WorkflowActionParams as ad, type WorkflowActions as ae, type LegacyWorkflowState as af, type StepId as ag, type ExtractSchemaFromStep$1 as ah, type ExtractStepResult as ai, type StepInputType as aj, type ExtractSchemaType$1 as ak, type PathsToStringProps$1 as al, type LegacyWorkflowRunState as am, type WorkflowResumeResult as an, Tool as ao, createTool as ap, type InternalCoreTool as aq, type ToolExecutionContext as ar, type AgentConfig as as, type DefaultEngineType as at, type WorkflowConfig as au, type LanguageModel as av, type CoreMessage as aw, type CoreSystemMessage as ax, type CoreAssistantMessage as ay, type CoreUserMessage as az, MastraMemory as b, type MastraMessageContentV2 as b$, type WorkingMemoryTemplate as b0, type MemoryProcessorOpts as b1, MemoryProcessor as b2, memoryDefaultOptions as b3, type StepFlowEntry as b4, type SerializedStep as b5, type SerializedStepFlowEntry as b6, createStep as b7, cloneStep as b8, createWorkflow as b9, CompositeVoice as bA, DefaultVoice as bB, type AgentNetworkConfig as bC, type ConvertedTool as bD, type MCPServerSSEOptions as bE, type MCPServerHonoSSEOptions as bF, type MCPServerHTTPOptions as bG, type Repository as bH, type VersionDetail as bI, type ArgumentInfo as bJ, type PositionalArgumentInfo as bK, type NamedArgumentInfo as bL, type SubcommandInfo as bM, type CommandInfo as bN, type EnvironmentVariableInfo as bO, type PackageInfo as bP, type RemoteInfo as bQ, type MCPServerConfig as bR, type ServerInfo as bS, type ServerDetailInfo as bT, type MCPToolType as bU, MessageList as bV, type ToolsetsInput as bW, type DynamicArgument as bX, type AgentMemoryOption as bY, type AgentGenerateOptions as bZ, type AgentStreamOptions as b_, cloneWorkflow as ba, type WorkflowResult as bb, Run as bc, type ExecutionGraph as bd, ExecutionEngine as be, type ExecuteFunction as bf, type StepSuccess as bg, type StepFailure as bh, type StepSuspended as bi, type StepRunning as bj, type StepResult as bk, type StepsRecord as bl, type DynamicMapping as bm, type PathsToStringProps as bn, type ExtractSchemaType as bo, type ExtractSchemaFromStep as bp, type VariableReference as bq, type StreamEvent as br, type WatchEvent as bs, type ZodPathType as bt, type WorkflowRunState as bu, type MastraLanguageModel as bv, type VoiceEventType as bw, type VoiceEventMap as bx, type VoiceConfig as by, MastraVoice as bz, type ToolAction as c, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, type PaginationArgs as z };
3688
+ export { type ActionContext as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, TABLE_WORKFLOW_SNAPSHOT as D, type EvalRow as E, TABLE_EVALS as F, TABLE_MESSAGES as G, TABLE_THREADS as H, TABLE_TRACES as I, TABLE_SCHEMAS as J, type VariableReference$1 as K, LegacyWorkflow as L, Mastra as M, type StepResult$1 as N, type StepAction as O, type PaginationInfo as P, type LegacyWorkflowRunResult as Q, type WorkflowOptions as R, type StepExecutionContext as S, type ToolsInput as T, type StepVariableType as U, type VercelTool as V, type WorkflowContext as W, type StepNode as X, type StepGraph as Y, type RetryConfig as Z, type BaseCondition as _, type MastraPrimitives as a, type WorkingMemoryFormat as a$, WhenConditionReturnValue as a0, type StepDef as a1, type StepCondition as a2, type StepConfig as a3, type StepsRecord$1 as a4, type WorkflowLogMessage as a5, type WorkflowEvent as a6, type ResolverFunctionInput as a7, type ResolverFunctionOutput as a8, type SubscriberFunctionOutput as a9, type CoreToolMessage as aA, type EmbedResult as aB, type EmbedManyResult as aC, type BaseStructuredOutputType as aD, type StructuredOutputType as aE, type StructuredOutputArrayItem as aF, type StructuredOutput as aG, type GenerateReturn as aH, type StreamReturn as aI, type OutputType as aJ, type DefaultLLMTextOptions as aK, type DefaultLLMTextObjectOptions as aL, type DefaultLLMStreamOptions as aM, type DefaultLLMStreamObjectOptions as aN, type LLMTextOptions as aO, type LLMTextObjectOptions as aP, type LLMStreamOptions as aQ, type LLMInnerStreamOptions as aR, type LLMStreamObjectOptions as aS, createMockModel as aT, type Config as aU, type MessageType as aV, type MessageResponse as aW, type WorkingMemory as aX, type MemoryConfig as aY, type SharedMemoryConfig as aZ, type TraceType as a_, type DependencyCheckOutput as aa, type StepResolverOutput as ab, type WorkflowActors as ac, type WorkflowActionParams as ad, type WorkflowActions as ae, type LegacyWorkflowState as af, type StepId as ag, type ExtractSchemaFromStep$1 as ah, type ExtractStepResult as ai, type StepInputType as aj, type ExtractSchemaType$1 as ak, type PathsToStringProps$1 as al, type LegacyWorkflowRunState as am, type WorkflowResumeResult as an, Tool as ao, createTool as ap, type InternalCoreTool as aq, type ToolExecutionContext as ar, type AgentConfig as as, type DefaultEngineType as at, type WorkflowConfig as au, type LanguageModel as av, type CoreMessage as aw, type CoreSystemMessage as ax, type CoreAssistantMessage as ay, type CoreUserMessage as az, MastraMemory as b, type AgentGenerateOptions as b$, type WorkingMemoryTemplate as b0, type MemoryProcessorOpts as b1, MemoryProcessor as b2, memoryDefaultOptions as b3, type StepFlowEntry as b4, type SerializedStep as b5, type SerializedStepFlowEntry as b6, createStep as b7, cloneStep as b8, createWorkflow as b9, type VoiceConfig as bA, MastraVoice as bB, CompositeVoice as bC, DefaultVoice as bD, type AgentNetworkConfig as bE, type ConvertedTool as bF, type MCPServerSSEOptions as bG, type MCPServerHonoSSEOptions as bH, type MCPServerHTTPOptions as bI, type Repository as bJ, type VersionDetail as bK, type ArgumentInfo as bL, type PositionalArgumentInfo as bM, type NamedArgumentInfo as bN, type SubcommandInfo as bO, type CommandInfo as bP, type EnvironmentVariableInfo as bQ, type PackageInfo as bR, type RemoteInfo as bS, type MCPServerConfig as bT, type ServerInfo as bU, type ServerDetailInfo as bV, type MCPToolType as bW, MessageList as bX, type ToolsetsInput as bY, type DynamicArgument as bZ, type AgentMemoryOption as b_, cloneWorkflow as ba, type WorkflowResult as bb, Run as bc, type ExecutionGraph as bd, ExecutionEngine as be, type ExecuteFunction as bf, type Emitter as bg, type StepSuccess as bh, type StepFailure as bi, type StepSuspended as bj, type StepRunning as bk, type StepWaiting as bl, type StepResult as bm, type StepsRecord as bn, type DynamicMapping as bo, type PathsToStringProps as bp, type ExtractSchemaType as bq, type ExtractSchemaFromStep as br, type VariableReference as bs, type StreamEvent as bt, type WatchEvent as bu, type ZodPathType as bv, type WorkflowRunState as bw, type MastraLanguageModel as bx, type VoiceEventType as by, type VoiceEventMap as bz, type ToolAction as c, type AgentStreamOptions as c0, type MastraMessageContentV2 as c1, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, type PaginationArgs as z };
@@ -226,7 +226,7 @@ type StepSuspended$1<T> = {
226
226
  suspendPayload?: any;
227
227
  output?: T;
228
228
  };
229
- type StepWaiting = {
229
+ type StepWaiting$1 = {
230
230
  status: 'waiting';
231
231
  };
232
232
  type StepFailure$1 = {
@@ -236,7 +236,7 @@ type StepFailure$1 = {
236
236
  type StepSkipped = {
237
237
  status: 'skipped';
238
238
  };
239
- type StepResult$1<T> = StepSuccess$1<T> | StepFailure$1 | StepSuspended$1<T> | StepWaiting | StepSkipped;
239
+ type StepResult$1<T> = StepSuccess$1<T> | StepFailure$1 | StepSuspended$1<T> | StepWaiting$1 | StepSkipped;
240
240
  type StepsRecord$1<T extends readonly LegacyStep<any, any, z.ZodType<any> | undefined>[]> = {
241
241
  [K in T[number]['id']]: Extract<T[number], {
242
242
  id: K;
@@ -1054,9 +1054,7 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, Eng
1054
1054
  steps: string[];
1055
1055
  resumePayload: any;
1056
1056
  };
1057
- [EMITTER_SYMBOL]: {
1058
- emit: (event: string, data: any) => Promise<void>;
1059
- };
1057
+ [EMITTER_SYMBOL]: Emitter;
1060
1058
  engine: EngineType;
1061
1059
  }) => Promise<TStepOutput>;
1062
1060
  interface Step<TStepId extends string = string, TSchemaIn extends z.ZodType<any> = z.ZodType<any>, TSchemaOut extends z.ZodType<any> = z.ZodType<any>, TResumeSchema extends z.ZodType<any> = z.ZodType<any>, TSuspendSchema extends z.ZodType<any> = z.ZodType<any>, TEngineType = any> {
@@ -1070,6 +1068,12 @@ interface Step<TStepId extends string = string, TSchemaIn extends z.ZodType<any>
1070
1068
  retries?: number;
1071
1069
  }
1072
1070
 
1071
+ type Emitter = {
1072
+ emit: (event: string, data: any) => Promise<void>;
1073
+ on: (event: string, callback: (data: any) => void) => void;
1074
+ off: (event: string, callback: (data: any) => void) => void;
1075
+ once: (event: string, callback: (data: any) => void) => void;
1076
+ };
1073
1077
  type StepSuccess<P, R, S, T> = {
1074
1078
  status: 'success';
1075
1079
  output: T;
@@ -1108,7 +1112,14 @@ type StepRunning<P, R, S> = {
1108
1112
  suspendedAt?: number;
1109
1113
  resumedAt?: number;
1110
1114
  };
1111
- type StepResult<P, R, S, T> = StepSuccess<P, R, S, T> | StepFailure<P, R, S> | StepSuspended<P, S> | StepRunning<P, R, S>;
1115
+ type StepWaiting<P, R, S> = {
1116
+ status: 'waiting';
1117
+ payload: P;
1118
+ suspendPayload?: S;
1119
+ resumePayload?: R;
1120
+ startedAt: number;
1121
+ };
1122
+ type StepResult<P, R, S, T> = StepSuccess<P, R, S, T> | StepFailure<P, R, S> | StepSuspended<P, S> | StepRunning<P, R, S> | StepWaiting<P, R, S>;
1112
1123
  type StepsRecord<T extends readonly Step<any, any, any>[]> = {
1113
1124
  [K in T[number]['id']]: Extract<T[number], {
1114
1125
  id: K;
@@ -1134,22 +1145,26 @@ type StreamEvent = TextStreamPart<any> | {
1134
1145
  type: 'step-suspended';
1135
1146
  payload: any;
1136
1147
  id: string;
1148
+ } | {
1149
+ type: 'step-waiting';
1150
+ payload: any;
1151
+ id: string;
1137
1152
  };
1138
1153
  type WatchEvent = {
1139
1154
  type: 'watch';
1140
1155
  payload: {
1141
1156
  currentStep?: {
1142
1157
  id: string;
1143
- status: 'running' | 'success' | 'failed' | 'suspended';
1158
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1144
1159
  output?: Record<string, any>;
1145
1160
  resumePayload?: Record<string, any>;
1146
1161
  payload?: Record<string, any>;
1147
1162
  error?: string | Error;
1148
1163
  };
1149
1164
  workflowState: {
1150
- status: 'running' | 'success' | 'failed' | 'suspended';
1165
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1151
1166
  steps: Record<string, {
1152
- status: 'running' | 'success' | 'failed' | 'suspended';
1167
+ status: 'running' | 'success' | 'failed' | 'suspended' | 'waiting';
1153
1168
  output?: Record<string, any>;
1154
1169
  payload?: Record<string, any>;
1155
1170
  resumePayload?: Record<string, any>;
@@ -1169,7 +1184,7 @@ type WatchEvent = {
1169
1184
  type ZodPathType<T extends z.ZodTypeAny, P extends string> = T extends z.ZodObject<infer Shape> ? P extends `${infer Key}.${infer Rest}` ? Key extends keyof Shape ? Shape[Key] extends z.ZodTypeAny ? ZodPathType<Shape[Key], Rest> : never : never : P extends keyof Shape ? Shape[P] : never : never;
1170
1185
  interface WorkflowRunState {
1171
1186
  runId: string;
1172
- status: 'success' | 'failed' | 'suspended' | 'running';
1187
+ status: 'success' | 'failed' | 'suspended' | 'running' | 'waiting';
1173
1188
  result?: Record<string, any>;
1174
1189
  error?: string | Error;
1175
1190
  value: Record<string, string>;
@@ -1217,9 +1232,7 @@ declare abstract class ExecutionEngine extends MastraBase {
1217
1232
  resumePayload: any;
1218
1233
  resumePath: number[];
1219
1234
  };
1220
- emitter: {
1221
- emit: (event: string, data: any) => Promise<void>;
1222
- };
1235
+ emitter: Emitter;
1223
1236
  runtimeContext: RuntimeContext;
1224
1237
  retryConfig?: {
1225
1238
  attempts?: number;
@@ -1240,6 +1253,11 @@ type StepFlowEntry<TEngineType = DefaultEngineType> = {
1240
1253
  type: 'sleepUntil';
1241
1254
  id: string;
1242
1255
  date: Date;
1256
+ } | {
1257
+ type: 'waitForEvent';
1258
+ event: string;
1259
+ step: Step;
1260
+ timeout?: number;
1243
1261
  } | {
1244
1262
  type: 'parallel';
1245
1263
  steps: StepFlowEntry[];
@@ -1283,6 +1301,11 @@ type SerializedStepFlowEntry = {
1283
1301
  type: 'sleepUntil';
1284
1302
  id: string;
1285
1303
  date: Date;
1304
+ } | {
1305
+ type: 'waitForEvent';
1306
+ event: string;
1307
+ step: SerializedStep;
1308
+ timeout?: number;
1286
1309
  } | {
1287
1310
  type: 'parallel';
1288
1311
  steps: SerializedStepFlowEntry[];
@@ -1416,6 +1439,9 @@ declare class Workflow<TEngineType = any, TSteps extends Step<string, any, any,
1416
1439
  * @returns The workflow instance for chaining
1417
1440
  */
1418
1441
  sleepUntil(date: Date): Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema>;
1442
+ waitForEvent<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(event: string, step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, opts?: {
1443
+ timeout?: number;
1444
+ }): Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1419
1445
  map<TSteps extends Step<string, any, any, any, any, TEngineType>[], TMapping extends {
1420
1446
  [K in keyof TMapping]: {
1421
1447
  step: TSteps[number] | TSteps[number][];
@@ -1519,6 +1545,8 @@ declare class Run<TEngineType = any, TSteps extends Step<string, any, any, any,
1519
1545
  * The serialized step graph for this run
1520
1546
  */
1521
1547
  serializedStepGraph: SerializedStepFlowEntry[];
1548
+ protected closeStreamAction?: () => Promise<void>;
1549
+ protected executionResults?: Promise<WorkflowResult<TOutput, TSteps>>;
1522
1550
  protected cleanup?: () => void;
1523
1551
  protected retryConfig?: {
1524
1552
  attempts?: number;
@@ -1537,6 +1565,7 @@ declare class Run<TEngineType = any, TSteps extends Step<string, any, any, any,
1537
1565
  cleanup?: () => void;
1538
1566
  serializedStepGraph: SerializedStepFlowEntry[];
1539
1567
  });
1568
+ sendEvent(event: string, data: any): void;
1540
1569
  /**
1541
1570
  * Starts the workflow execution with the provided input
1542
1571
  * @param input The input data for the workflow
@@ -1765,6 +1794,7 @@ type MastraMessageContentV2 = {
1765
1794
  toolInvocations?: UIMessage['toolInvocations'];
1766
1795
  reasoning?: UIMessage['reasoning'];
1767
1796
  annotations?: UIMessage['annotations'];
1797
+ metadata?: Record<string, unknown>;
1768
1798
  };
1769
1799
  type MastraMessageV2 = {
1770
1800
  id: string;
@@ -3605,6 +3635,15 @@ declare abstract class MastraStorage extends MastraBase {
3605
3635
  messages: MastraMessageV2[];
3606
3636
  format: 'v2';
3607
3637
  }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
3638
+ abstract updateMessages(args: {
3639
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
3640
+ id: string;
3641
+ content?: {
3642
+ metadata?: MastraMessageContentV2['metadata'];
3643
+ content?: MastraMessageContentV2['content'];
3644
+ };
3645
+ }[];
3646
+ }): Promise<MastraMessageV2[]>;
3608
3647
  abstract getTraces(args: StorageGetTracesArg): Promise<any[]>;
3609
3648
  init(): Promise<void>;
3610
3649
  persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
@@ -3646,4 +3685,4 @@ declare abstract class MastraStorage extends MastraBase {
3646
3685
  }>;
3647
3686
  }
3648
3687
 
3649
- export { type ActionContext as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, TABLE_WORKFLOW_SNAPSHOT as D, type EvalRow as E, TABLE_EVALS as F, TABLE_MESSAGES as G, TABLE_THREADS as H, TABLE_TRACES as I, TABLE_SCHEMAS as J, type VariableReference$1 as K, LegacyWorkflow as L, Mastra as M, type StepResult$1 as N, type StepAction as O, type PaginationInfo as P, type LegacyWorkflowRunResult as Q, type WorkflowOptions as R, type StepExecutionContext as S, type ToolsInput as T, type StepVariableType as U, type VercelTool as V, type WorkflowContext as W, type StepNode as X, type StepGraph as Y, type RetryConfig as Z, type BaseCondition as _, type MastraPrimitives as a, type WorkingMemoryFormat as a$, WhenConditionReturnValue as a0, type StepDef as a1, type StepCondition as a2, type StepConfig as a3, type StepsRecord$1 as a4, type WorkflowLogMessage as a5, type WorkflowEvent as a6, type ResolverFunctionInput as a7, type ResolverFunctionOutput as a8, type SubscriberFunctionOutput as a9, type CoreToolMessage as aA, type EmbedResult as aB, type EmbedManyResult as aC, type BaseStructuredOutputType as aD, type StructuredOutputType as aE, type StructuredOutputArrayItem as aF, type StructuredOutput as aG, type GenerateReturn as aH, type StreamReturn as aI, type OutputType as aJ, type DefaultLLMTextOptions as aK, type DefaultLLMTextObjectOptions as aL, type DefaultLLMStreamOptions as aM, type DefaultLLMStreamObjectOptions as aN, type LLMTextOptions as aO, type LLMTextObjectOptions as aP, type LLMStreamOptions as aQ, type LLMInnerStreamOptions as aR, type LLMStreamObjectOptions as aS, createMockModel as aT, type Config as aU, type MessageType as aV, type MessageResponse as aW, type WorkingMemory as aX, type MemoryConfig as aY, type SharedMemoryConfig as aZ, type TraceType as a_, type DependencyCheckOutput as aa, type StepResolverOutput as ab, type WorkflowActors as ac, type WorkflowActionParams as ad, type WorkflowActions as ae, type LegacyWorkflowState as af, type StepId as ag, type ExtractSchemaFromStep$1 as ah, type ExtractStepResult as ai, type StepInputType as aj, type ExtractSchemaType$1 as ak, type PathsToStringProps$1 as al, type LegacyWorkflowRunState as am, type WorkflowResumeResult as an, Tool as ao, createTool as ap, type InternalCoreTool as aq, type ToolExecutionContext as ar, type AgentConfig as as, type DefaultEngineType as at, type WorkflowConfig as au, type LanguageModel as av, type CoreMessage as aw, type CoreSystemMessage as ax, type CoreAssistantMessage as ay, type CoreUserMessage as az, MastraMemory as b, type MastraMessageContentV2 as b$, type WorkingMemoryTemplate as b0, type MemoryProcessorOpts as b1, MemoryProcessor as b2, memoryDefaultOptions as b3, type StepFlowEntry as b4, type SerializedStep as b5, type SerializedStepFlowEntry as b6, createStep as b7, cloneStep as b8, createWorkflow as b9, CompositeVoice as bA, DefaultVoice as bB, type AgentNetworkConfig as bC, type ConvertedTool as bD, type MCPServerSSEOptions as bE, type MCPServerHonoSSEOptions as bF, type MCPServerHTTPOptions as bG, type Repository as bH, type VersionDetail as bI, type ArgumentInfo as bJ, type PositionalArgumentInfo as bK, type NamedArgumentInfo as bL, type SubcommandInfo as bM, type CommandInfo as bN, type EnvironmentVariableInfo as bO, type PackageInfo as bP, type RemoteInfo as bQ, type MCPServerConfig as bR, type ServerInfo as bS, type ServerDetailInfo as bT, type MCPToolType as bU, MessageList as bV, type ToolsetsInput as bW, type DynamicArgument as bX, type AgentMemoryOption as bY, type AgentGenerateOptions as bZ, type AgentStreamOptions as b_, cloneWorkflow as ba, type WorkflowResult as bb, Run as bc, type ExecutionGraph as bd, ExecutionEngine as be, type ExecuteFunction as bf, type StepSuccess as bg, type StepFailure as bh, type StepSuspended as bi, type StepRunning as bj, type StepResult as bk, type StepsRecord as bl, type DynamicMapping as bm, type PathsToStringProps as bn, type ExtractSchemaType as bo, type ExtractSchemaFromStep as bp, type VariableReference as bq, type StreamEvent as br, type WatchEvent as bs, type ZodPathType as bt, type WorkflowRunState as bu, type MastraLanguageModel as bv, type VoiceEventType as bw, type VoiceEventMap as bx, type VoiceConfig as by, MastraVoice as bz, type ToolAction as c, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, type PaginationArgs as z };
3688
+ export { type ActionContext as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, TABLE_WORKFLOW_SNAPSHOT as D, type EvalRow as E, TABLE_EVALS as F, TABLE_MESSAGES as G, TABLE_THREADS as H, TABLE_TRACES as I, TABLE_SCHEMAS as J, type VariableReference$1 as K, LegacyWorkflow as L, Mastra as M, type StepResult$1 as N, type StepAction as O, type PaginationInfo as P, type LegacyWorkflowRunResult as Q, type WorkflowOptions as R, type StepExecutionContext as S, type ToolsInput as T, type StepVariableType as U, type VercelTool as V, type WorkflowContext as W, type StepNode as X, type StepGraph as Y, type RetryConfig as Z, type BaseCondition as _, type MastraPrimitives as a, type WorkingMemoryFormat as a$, WhenConditionReturnValue as a0, type StepDef as a1, type StepCondition as a2, type StepConfig as a3, type StepsRecord$1 as a4, type WorkflowLogMessage as a5, type WorkflowEvent as a6, type ResolverFunctionInput as a7, type ResolverFunctionOutput as a8, type SubscriberFunctionOutput as a9, type CoreToolMessage as aA, type EmbedResult as aB, type EmbedManyResult as aC, type BaseStructuredOutputType as aD, type StructuredOutputType as aE, type StructuredOutputArrayItem as aF, type StructuredOutput as aG, type GenerateReturn as aH, type StreamReturn as aI, type OutputType as aJ, type DefaultLLMTextOptions as aK, type DefaultLLMTextObjectOptions as aL, type DefaultLLMStreamOptions as aM, type DefaultLLMStreamObjectOptions as aN, type LLMTextOptions as aO, type LLMTextObjectOptions as aP, type LLMStreamOptions as aQ, type LLMInnerStreamOptions as aR, type LLMStreamObjectOptions as aS, createMockModel as aT, type Config as aU, type MessageType as aV, type MessageResponse as aW, type WorkingMemory as aX, type MemoryConfig as aY, type SharedMemoryConfig as aZ, type TraceType as a_, type DependencyCheckOutput as aa, type StepResolverOutput as ab, type WorkflowActors as ac, type WorkflowActionParams as ad, type WorkflowActions as ae, type LegacyWorkflowState as af, type StepId as ag, type ExtractSchemaFromStep$1 as ah, type ExtractStepResult as ai, type StepInputType as aj, type ExtractSchemaType$1 as ak, type PathsToStringProps$1 as al, type LegacyWorkflowRunState as am, type WorkflowResumeResult as an, Tool as ao, createTool as ap, type InternalCoreTool as aq, type ToolExecutionContext as ar, type AgentConfig as as, type DefaultEngineType as at, type WorkflowConfig as au, type LanguageModel as av, type CoreMessage as aw, type CoreSystemMessage as ax, type CoreAssistantMessage as ay, type CoreUserMessage as az, MastraMemory as b, type AgentGenerateOptions as b$, type WorkingMemoryTemplate as b0, type MemoryProcessorOpts as b1, MemoryProcessor as b2, memoryDefaultOptions as b3, type StepFlowEntry as b4, type SerializedStep as b5, type SerializedStepFlowEntry as b6, createStep as b7, cloneStep as b8, createWorkflow as b9, type VoiceConfig as bA, MastraVoice as bB, CompositeVoice as bC, DefaultVoice as bD, type AgentNetworkConfig as bE, type ConvertedTool as bF, type MCPServerSSEOptions as bG, type MCPServerHonoSSEOptions as bH, type MCPServerHTTPOptions as bI, type Repository as bJ, type VersionDetail as bK, type ArgumentInfo as bL, type PositionalArgumentInfo as bM, type NamedArgumentInfo as bN, type SubcommandInfo as bO, type CommandInfo as bP, type EnvironmentVariableInfo as bQ, type PackageInfo as bR, type RemoteInfo as bS, type MCPServerConfig as bT, type ServerInfo as bU, type ServerDetailInfo as bV, type MCPToolType as bW, MessageList as bX, type ToolsetsInput as bY, type DynamicArgument as bZ, type AgentMemoryOption as b_, cloneWorkflow as ba, type WorkflowResult as bb, Run as bc, type ExecutionGraph as bd, ExecutionEngine as be, type ExecuteFunction as bf, type Emitter as bg, type StepSuccess as bh, type StepFailure as bi, type StepSuspended as bj, type StepRunning as bk, type StepWaiting as bl, type StepResult as bm, type StepsRecord as bn, type DynamicMapping as bo, type PathsToStringProps as bp, type ExtractSchemaType as bq, type ExtractSchemaFromStep as br, type VariableReference as bs, type StreamEvent as bt, type WatchEvent as bu, type ZodPathType as bv, type WorkflowRunState as bw, type MastraLanguageModel as bx, type VoiceEventType as by, type VoiceEventMap as bz, type ToolAction as c, type AgentStreamOptions as c0, type MastraMessageContentV2 as c1, LegacyStep as d, Workflow as e, type Step as f, AgentNetwork as g, MCPServerBase as h, type Methods as i, type ApiRoute as j, type MastraAuthConfig as k, type ContextWithMastra as l, MastraAuthProvider as m, type MastraAuthProviderOptions as n, MastraStorage as o, type TABLE_NAMES as p, type StorageColumn as q, type StorageThreadType as r, type MastraMessageV2 as s, type StorageGetMessagesArg as t, type MastraMessageV1 as u, type WorkflowRuns as v, type WorkflowRun as w, type LegacyWorkflowRuns as x, type LegacyWorkflowRun as y, type PaginationArgs as z };
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-RFGZJIMI.js';
1
+ import { Agent } from './chunk-ATXD4775.js';
2
2
  import { CohereClient } from 'cohere-ai';
3
3
 
4
4
  var CohereRelevanceScorer = class {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk3SZLJIPE_cjs = require('./chunk-3SZLJIPE.cjs');
3
+ var chunk7KWHHSK5_cjs = require('./chunk-7KWHHSK5.cjs');
4
4
  var cohereAi = require('cohere-ai');
5
5
 
6
6
  var CohereRelevanceScorer = class {
@@ -38,7 +38,7 @@ Relevance score (0-1):`;
38
38
  var MastraAgentRelevanceScorer = class {
39
39
  agent;
40
40
  constructor(name, model) {
41
- this.agent = new chunk3SZLJIPE_cjs.Agent({
41
+ this.agent = new chunk7KWHHSK5_cjs.Agent({
42
42
  name: `Relevance Scorer ${name}`,
43
43
  instructions: `You are a specialized agent for evaluating the relevance of text to queries.
44
44
  Your task is to rate how well a text passage answers a given query.
@@ -1326,6 +1326,7 @@ ${JSON.stringify(
1326
1326
  resourceId,
1327
1327
  memory: this.getMemory(),
1328
1328
  runtimeContext,
1329
+ telemetry,
1329
1330
  ...args
1330
1331
  });
1331
1332
  const outputText2 = result2.text;
@@ -1319,6 +1319,7 @@ ${JSON.stringify(
1319
1319
  resourceId,
1320
1320
  memory: this.getMemory(),
1321
1321
  runtimeContext,
1322
+ telemetry,
1322
1323
  ...args
1323
1324
  });
1324
1325
  const outputText2 = result2.text;