@mastra/core 0.10.4 → 0.10.5

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 (103) hide show
  1. package/dist/agent/index.cjs +4 -4
  2. package/dist/agent/index.d.cts +1 -1
  3. package/dist/agent/index.d.ts +1 -1
  4. package/dist/agent/index.js +2 -2
  5. package/dist/{base-icHjkcs-.d.ts → base-CmIdgTSq.d.ts} +37 -31
  6. package/dist/{base-Bdc5hWla.d.cts → base-_mZ6e_qo.d.cts} +37 -31
  7. package/dist/chunk-2RZXEVWT.js +68 -0
  8. package/dist/{chunk-UFQERGWG.js → chunk-32XBQVNY.js} +117 -28
  9. package/dist/{chunk-TRJIWZKM.js → chunk-3SY7GRSA.js} +1 -1
  10. package/dist/{chunk-PUG7THT5.cjs → chunk-6EMFDXAQ.cjs} +4 -4
  11. package/dist/{chunk-36UICULV.js → chunk-6PQRSQZF.js} +35 -5
  12. package/dist/{chunk-VB4S54R3.cjs → chunk-7L56W43N.cjs} +118 -29
  13. package/dist/{chunk-62ZSDIUK.js → chunk-BMED2N3R.js} +1 -1
  14. package/dist/{chunk-I2KL5KMY.js → chunk-CMEK3A3W.js} +2 -2
  15. package/dist/{chunk-HGPLTKJA.cjs → chunk-D2ULEJL3.cjs} +2 -2
  16. package/dist/{chunk-AX6IHSGY.js → chunk-DPKEVI6Q.js} +1 -1
  17. package/dist/{chunk-ZKUUYDOQ.cjs → chunk-EFJIVMMM.cjs} +21 -21
  18. package/dist/{chunk-SI2ENZ3O.js → chunk-F2DBWJK3.js} +1 -1
  19. package/dist/{chunk-Z37B4W7B.js → chunk-HIQ3FPBN.js} +1 -1
  20. package/dist/{chunk-RO5VPM3P.cjs → chunk-HVI3SKIH.cjs} +278 -55
  21. package/dist/{chunk-GV6P24NY.cjs → chunk-ISRXIKDS.cjs} +4 -4
  22. package/dist/{chunk-QVROTSA5.cjs → chunk-J7MLMW6O.cjs} +2 -2
  23. package/dist/{chunk-PVGSY24V.js → chunk-LDNCERLU.js} +7 -0
  24. package/dist/{chunk-S6WRT7GI.cjs → chunk-LRMKKZ6M.cjs} +2 -2
  25. package/dist/{chunk-BBAQW23O.cjs → chunk-OLSQRA2V.cjs} +7 -0
  26. package/dist/chunk-Q65UGFQK.cjs +70 -0
  27. package/dist/{chunk-ZAXPU6F2.cjs → chunk-QQ3KHYKE.cjs} +35 -5
  28. package/dist/{chunk-ZWYZGIV3.cjs → chunk-QQT4XTOG.cjs} +279 -73
  29. package/dist/{chunk-XUODQRSL.cjs → chunk-TGK6JO2D.cjs} +3 -3
  30. package/dist/{chunk-JYLH5IY3.cjs → chunk-VRDDTY4O.cjs} +87 -16
  31. package/dist/{chunk-SWJKOFCU.js → chunk-VZDPK54I.js} +262 -56
  32. package/dist/{chunk-HFEELWJO.js → chunk-YDGX5LRI.js} +274 -51
  33. package/dist/{chunk-7UNDRBOU.js → chunk-YLCFUSJ4.js} +86 -15
  34. package/dist/{chunk-IZGRJXUQ.js → chunk-Z7SBZ7XB.js} +1 -1
  35. package/dist/error/index.cjs +5 -5
  36. package/dist/error/index.d.cts +7 -0
  37. package/dist/error/index.d.ts +7 -0
  38. package/dist/error/index.js +1 -1
  39. package/dist/eval/index.d.cts +1 -1
  40. package/dist/eval/index.d.ts +1 -1
  41. package/dist/index.cjs +48 -48
  42. package/dist/index.d.cts +2 -2
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.js +12 -12
  45. package/dist/integration/index.d.cts +1 -1
  46. package/dist/integration/index.d.ts +1 -1
  47. package/dist/llm/index.d.cts +1 -1
  48. package/dist/llm/index.d.ts +1 -1
  49. package/dist/mastra/index.cjs +2 -2
  50. package/dist/mastra/index.d.cts +1 -1
  51. package/dist/mastra/index.d.ts +1 -1
  52. package/dist/mastra/index.js +1 -1
  53. package/dist/mcp/index.d.cts +1 -1
  54. package/dist/mcp/index.d.ts +1 -1
  55. package/dist/memory/index.cjs +4 -4
  56. package/dist/memory/index.d.cts +1 -1
  57. package/dist/memory/index.d.ts +1 -1
  58. package/dist/memory/index.js +1 -1
  59. package/dist/network/index.cjs +11 -5
  60. package/dist/network/index.d.cts +1 -1
  61. package/dist/network/index.d.ts +1 -1
  62. package/dist/network/index.js +10 -4
  63. package/dist/relevance/index.cjs +4 -4
  64. package/dist/relevance/index.d.cts +1 -1
  65. package/dist/relevance/index.d.ts +1 -1
  66. package/dist/relevance/index.js +1 -1
  67. package/dist/server/index.cjs +9 -3
  68. package/dist/server/index.d.cts +2 -2
  69. package/dist/server/index.d.ts +2 -2
  70. package/dist/server/index.js +8 -2
  71. package/dist/storage/index.cjs +12 -12
  72. package/dist/storage/index.d.cts +2 -2
  73. package/dist/storage/index.d.ts +2 -2
  74. package/dist/storage/index.js +4 -4
  75. package/dist/telemetry/index.cjs +7 -7
  76. package/dist/telemetry/index.d.cts +1 -1
  77. package/dist/telemetry/index.d.ts +1 -1
  78. package/dist/telemetry/index.js +1 -1
  79. package/dist/tools/index.d.cts +2 -2
  80. package/dist/tools/index.d.ts +2 -2
  81. package/dist/tts/index.cjs +2 -2
  82. package/dist/tts/index.js +1 -1
  83. package/dist/utils.cjs +14 -14
  84. package/dist/utils.d.cts +2 -2
  85. package/dist/utils.d.ts +2 -2
  86. package/dist/utils.js +1 -1
  87. package/dist/vector/index.cjs +2 -2
  88. package/dist/vector/index.js +1 -1
  89. package/dist/voice/index.cjs +4 -4
  90. package/dist/voice/index.d.cts +1 -1
  91. package/dist/voice/index.d.ts +1 -1
  92. package/dist/voice/index.js +1 -1
  93. package/dist/workflows/index.cjs +9 -9
  94. package/dist/workflows/index.d.cts +14 -7
  95. package/dist/workflows/index.d.ts +14 -7
  96. package/dist/workflows/index.js +1 -1
  97. package/dist/workflows/legacy/index.cjs +22 -22
  98. package/dist/workflows/legacy/index.d.cts +2 -2
  99. package/dist/workflows/legacy/index.d.ts +2 -2
  100. package/dist/workflows/legacy/index.js +1 -1
  101. package/package.json +2 -2
  102. package/dist/chunk-IM7CLVLZ.js +0 -43
  103. package/dist/chunk-LEK3J7YN.cjs +0 -45
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkZWYZGIV3_cjs = require('../chunk-ZWYZGIV3.cjs');
4
- var chunkXUODQRSL_cjs = require('../chunk-XUODQRSL.cjs');
3
+ var chunkQQT4XTOG_cjs = require('../chunk-QQT4XTOG.cjs');
4
+ var chunkTGK6JO2D_cjs = require('../chunk-TGK6JO2D.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkZWYZGIV3_cjs.Agent; }
10
+ get: function () { return chunkQQT4XTOG_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "MessageList", {
13
13
  enumerable: true,
14
- get: function () { return chunkXUODQRSL_cjs.MessageList; }
14
+ get: function () { return chunkTGK6JO2D_cjs.MessageList; }
15
15
  });
@@ -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, bU as AgentGenerateOptions, bV as AgentStreamOptions, bT as DynamicArgument, br as MastraLanguageModel, bW as MastraMessageContentV2, s as MastraMessageV2, bR as MessageList, T as ToolsInput, bS as ToolsetsInput } from '../base-Bdc5hWla.cjs';
4
+ export { A as Agent, at as AgentConfig, bV as AgentGenerateOptions, bW as AgentStreamOptions, bU as DynamicArgument, bs as MastraLanguageModel, bX as MastraMessageContentV2, s as MastraMessageV2, bS as MessageList, T as ToolsInput, bT as ToolsetsInput } from '../base-_mZ6e_qo.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, bU as AgentGenerateOptions, bV as AgentStreamOptions, bT as DynamicArgument, br as MastraLanguageModel, bW as MastraMessageContentV2, s as MastraMessageV2, bR as MessageList, T as ToolsInput, bS as ToolsetsInput } from '../base-icHjkcs-.js';
4
+ export { A as Agent, at as AgentConfig, bV as AgentGenerateOptions, bW as AgentStreamOptions, bU as DynamicArgument, bs as MastraLanguageModel, bX as MastraMessageContentV2, s as MastraMessageV2, bS as MessageList, T as ToolsInput, bT as ToolsetsInput } from '../base-CmIdgTSq.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-SWJKOFCU.js';
2
- export { MessageList } from '../chunk-AX6IHSGY.js';
1
+ export { Agent } from '../chunk-VZDPK54I.js';
2
+ export { MessageList } from '../chunk-DPKEVI6Q.js';
@@ -1040,7 +1040,7 @@ declare class LegacyWorkflow<TSteps extends LegacyStep<string, any, any>[] = Leg
1040
1040
  toStep(): LegacyStep<TStepId, TTriggerSchema, z.ZodType<LegacyWorkflowRunResult<TTriggerSchema, TSteps, TResultSchema>>, any>;
1041
1041
  }
1042
1042
 
1043
- type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (params: {
1043
+ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, EngineType> = (params: {
1044
1044
  runId: string;
1045
1045
  mastra: Mastra;
1046
1046
  runtimeContext: RuntimeContext;
@@ -1057,15 +1057,16 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (
1057
1057
  [EMITTER_SYMBOL]: {
1058
1058
  emit: (event: string, data: any) => Promise<void>;
1059
1059
  };
1060
+ engine: EngineType;
1060
1061
  }) => Promise<TStepOutput>;
1061
- 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>> {
1062
+ 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> {
1062
1063
  id: TStepId;
1063
1064
  description?: string;
1064
1065
  inputSchema: TSchemaIn;
1065
1066
  outputSchema: TSchemaOut;
1066
1067
  resumeSchema?: TResumeSchema;
1067
1068
  suspendSchema?: TSuspendSchema;
1068
- execute: ExecuteFunction<z.infer<TSchemaIn>, z.infer<TSchemaOut>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>>;
1069
+ execute: ExecuteFunction<z.infer<TSchemaIn>, z.infer<TSchemaOut>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, TEngineType>;
1069
1070
  retries?: number;
1070
1071
  }
1071
1072
 
@@ -1114,7 +1115,7 @@ type StepsRecord<T extends readonly Step<any, any, any>[]> = {
1114
1115
  }>;
1115
1116
  };
1116
1117
  type DynamicMapping<TPrevSchema extends z.ZodTypeAny, TSchemaOut extends z.ZodTypeAny> = {
1117
- fn: ExecuteFunction<z.infer<TPrevSchema>, z.infer<TSchemaOut>, any, any>;
1118
+ fn: ExecuteFunction<z.infer<TPrevSchema>, z.infer<TSchemaOut>, any, any, any>;
1118
1119
  schema: TSchemaOut;
1119
1120
  };
1120
1121
  type PathsToStringProps<T> = T extends object ? {
@@ -1158,7 +1159,7 @@ type WatchEvent = {
1158
1159
  suspendedAt?: number;
1159
1160
  resumedAt?: number;
1160
1161
  }>;
1161
- output?: Record<string, any>;
1162
+ result?: Record<string, any>;
1162
1163
  payload?: Record<string, any>;
1163
1164
  error?: string | Error;
1164
1165
  };
@@ -1168,6 +1169,9 @@ type WatchEvent = {
1168
1169
  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;
1169
1170
  interface WorkflowRunState {
1170
1171
  runId: string;
1172
+ status: 'success' | 'failed' | 'suspended' | 'running';
1173
+ result?: Record<string, any>;
1174
+ error?: string | Error;
1171
1175
  value: Record<string, string>;
1172
1176
  context: {
1173
1177
  input?: Record<string, any>;
@@ -1224,7 +1228,8 @@ declare abstract class ExecutionEngine extends MastraBase {
1224
1228
  }): Promise<TOutput>;
1225
1229
  }
1226
1230
 
1227
- type StepFlowEntry = {
1231
+ type DefaultEngineType = {};
1232
+ type StepFlowEntry<TEngineType = DefaultEngineType> = {
1228
1233
  type: 'step';
1229
1234
  step: Step;
1230
1235
  } | {
@@ -1233,7 +1238,7 @@ type StepFlowEntry = {
1233
1238
  } | {
1234
1239
  type: 'conditional';
1235
1240
  steps: StepFlowEntry[];
1236
- conditions: ExecuteFunction<any, any, any, any>[];
1241
+ conditions: ExecuteFunction<any, any, any, any, TEngineType>[];
1237
1242
  serializedConditions: {
1238
1243
  id: string;
1239
1244
  fn: string;
@@ -1241,7 +1246,7 @@ type StepFlowEntry = {
1241
1246
  } | {
1242
1247
  type: 'loop';
1243
1248
  step: Step;
1244
- condition: ExecuteFunction<any, any, any, any>;
1249
+ condition: ExecuteFunction<any, any, any, any, any>;
1245
1250
  serializedCondition: {
1246
1251
  id: string;
1247
1252
  fn: string;
@@ -1254,7 +1259,7 @@ type StepFlowEntry = {
1254
1259
  concurrency: number;
1255
1260
  };
1256
1261
  };
1257
- type SerializedStep = Pick<Step, 'id' | 'description'> & {
1262
+ type SerializedStep<TEngineType = DefaultEngineType> = Pick<Step<any, any, any, any, any, TEngineType>, 'id' | 'description'> & {
1258
1263
  component?: string;
1259
1264
  serializedStepFlow?: SerializedStepFlowEntry[];
1260
1265
  mapConfig?: string;
@@ -1297,32 +1302,32 @@ type SerializedStepFlowEntry = {
1297
1302
  * @param params.execute Function that performs the step's operations
1298
1303
  * @returns A Step object that can be added to the workflow
1299
1304
  */
1300
- declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(params: {
1305
+ declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>, TEngineType = DefaultEngineType>(params: {
1301
1306
  id: TStepId;
1302
1307
  description?: string;
1303
1308
  inputSchema: TStepInput;
1304
1309
  outputSchema: TStepOutput;
1305
1310
  resumeSchema?: TResumeSchema;
1306
1311
  suspendSchema?: TSuspendSchema;
1307
- execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>>;
1308
- }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema>;
1312
+ execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, TEngineType>;
1313
+ }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, TEngineType>;
1309
1314
  declare function createStep<TStepId extends string, TStepInput extends z.ZodObject<{
1310
1315
  prompt: z.ZodString;
1311
1316
  }>, TStepOutput extends z.ZodObject<{
1312
1317
  text: z.ZodString;
1313
- }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema>;
1318
+ }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, DefaultEngineType>;
1314
1319
  declare function createStep<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn>>(tool: Tool<TSchemaIn, TSchemaOut, TContext> & {
1315
1320
  inputSchema: TSchemaIn;
1316
1321
  outputSchema: TSchemaOut;
1317
1322
  execute: (context: TContext) => Promise<any>;
1318
- }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>>;
1323
+ }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, DefaultEngineType>;
1319
1324
  declare function cloneStep<TStepId extends string>(step: Step<string, any, any>, opts: {
1320
1325
  id: TStepId;
1321
1326
  }): Step<TStepId, any, any>;
1322
- declare function createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
1323
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: Workflow<TSteps, string, TInput, TOutput>, opts: {
1327
+ declare function createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TEngineType = DefaultEngineType, TSteps extends Step<string, any, any, any, any, TEngineType>[] = Step<string, any, any, any, any, TEngineType>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): Workflow<TSteps, TWorkflowId, TInput, TOutput, DefaultEngineType, TInput>;
1328
+ declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any, DefaultEngineType>[] = Step<string, any, any, any, any, DefaultEngineType>[]>(workflow: Workflow<TSteps, string, TInput, TOutput, DefaultEngineType>, opts: {
1324
1329
  id: TWorkflowId;
1325
- }): Workflow<TSteps, TWorkflowId, TInput, TOutput>;
1330
+ }): Workflow<TSteps, TWorkflowId, TInput, TOutput, DefaultEngineType>;
1326
1331
  type WorkflowResult<TOutput extends z.ZodType<any>, TSteps extends Step<string, any, any>[]> = {
1327
1332
  status: 'success';
1328
1333
  result: z.infer<TOutput>;
@@ -1355,7 +1360,7 @@ type WorkflowConfig<TWorkflowId extends string = string, TInput extends z.ZodTyp
1355
1360
  delay?: number;
1356
1361
  };
1357
1362
  };
1358
- declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends MastraBase implements Step<TWorkflowId, TInput, TOutput> {
1363
+ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TEngineType = DefaultEngineType, TPrevSchema extends z.ZodType<any> = TInput> extends MastraBase implements Step<TWorkflowId, TInput, TOutput, any, any, TEngineType> {
1359
1364
  #private;
1360
1365
  id: TWorkflowId;
1361
1366
  description?: string | undefined;
@@ -1373,7 +1378,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1373
1378
  };
1374
1379
  constructor({ mastra, id, inputSchema, outputSchema, description, executionEngine, retryConfig, steps, }: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>);
1375
1380
  get runs(): Map<string, Run<TSteps, TInput, TOutput>>;
1376
- get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<Step<string, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, MCPServerBase>> | undefined;
1381
+ get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, DefaultEngineType, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, MCPServerBase>> | undefined;
1377
1382
  __registerMastra(mastra: Mastra): void;
1378
1383
  __registerPrimitives(p: MastraPrimitives): void;
1379
1384
  setStepFlow(stepFlow: StepFlowEntry[]): void;
@@ -1382,7 +1387,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1382
1387
  * @param step The step to add to the workflow
1383
1388
  * @returns The workflow instance for chaining
1384
1389
  */
1385
- then<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1390
+ then<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, TSchemaOut>;
1386
1391
  map<TSteps extends Step<string, any, any>[], TMapping extends {
1387
1392
  [K in keyof TMapping]: {
1388
1393
  step: TSteps[number] | TSteps[number][];
@@ -1397,17 +1402,17 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1397
1402
  runtimeContextPath: string;
1398
1403
  schema: z.ZodTypeAny;
1399
1404
  } | DynamicMapping<TPrevSchema, z.ZodTypeAny>;
1400
- }>(mappingConfig: TMapping | ExecuteFunction<z.infer<TPrevSchema>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, any>;
1401
- parallel<TParallelSteps extends Step<string, TPrevSchema, any, any, any>[]>(steps: TParallelSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<TParallelSteps>]: StepsRecord<TParallelSteps>[K]["outputSchema"]["path"]; }, any, z.ZodTypeAny>>;
1405
+ }>(mappingConfig: TMapping | ExecuteFunction<z.infer<TPrevSchema>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, TInput>;
1406
+ parallel<TParallelSteps extends Step<string, TPrevSchema, any, any, any, TEngineType>[]>(steps: TParallelSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<TParallelSteps>]: StepsRecord<TParallelSteps>[K]["outputSchema"]["path"]; }, any, z.ZodTypeAny>>;
1402
1407
  branch<TBranchSteps extends Array<[
1403
- ExecuteFunction<z.infer<TPrevSchema>, any, any, any>,
1404
- Step<string, TPrevSchema, any, any, any>
1405
- ]>>(steps: TBranchSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>]: StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>[K]["outputSchema"]; }, any, z.ZodTypeAny>>;
1406
- dowhile<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1407
- dountil<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1408
- foreach<TPrevIsArray extends TPrevSchema extends z.ZodArray<any> ? true : false, TStepInputSchema extends TPrevSchema extends z.ZodArray<infer TElement> ? TElement : never, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: TPrevIsArray extends true ? Step<TStepId, TStepInputSchema, TSchemaOut, any, any> : 'Previous step must return an array type', opts?: {
1408
+ ExecuteFunction<z.infer<TPrevSchema>, any, any, any, any>,
1409
+ Step<string, TPrevSchema, any, any, any, TEngineType>
1410
+ ]>>(steps: TBranchSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>]: StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>[K]["outputSchema"]; }, any, z.ZodTypeAny, TEngineType>>;
1411
+ dowhile<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1412
+ dountil<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1413
+ foreach<TPrevIsArray extends TPrevSchema extends z.ZodArray<any> ? true : false, TStepInputSchema extends TPrevSchema extends z.ZodArray<infer TElement> ? TElement : never, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: TPrevIsArray extends true ? Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType> : 'Previous step must return an array type', opts?: {
1409
1414
  concurrency: number;
1410
- }): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodArray<TSchemaOut>>;
1415
+ }): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, z.ZodArray<TSchemaOut>>;
1411
1416
  /**
1412
1417
  * Builds the execution graph for this workflow
1413
1418
  * @returns The execution graph that can be used to execute the workflow
@@ -1419,7 +1424,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1419
1424
  * @returns A built workflow instance ready for execution
1420
1425
  */
1421
1426
  commit(): Workflow<TSteps, TWorkflowId, TInput, TOutput, TOutput>;
1422
- get stepGraph(): StepFlowEntry[];
1427
+ get stepGraph(): StepFlowEntry<DefaultEngineType>[];
1423
1428
  get serializedStepGraph(): SerializedStepFlowEntry[];
1424
1429
  /**
1425
1430
  * Creates a new workflow run instance
@@ -1444,6 +1449,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1444
1449
  };
1445
1450
  mastra: Mastra;
1446
1451
  runtimeContext?: RuntimeContext;
1452
+ engine: TEngineType;
1447
1453
  }): Promise<z.infer<TOutput>>;
1448
1454
  getWorkflowRuns(args?: {
1449
1455
  fromDate?: Date;
@@ -3521,4 +3527,4 @@ declare abstract class MastraStorage extends MastraBase {
3521
3527
  }>;
3522
3528
  }
3523
3529
 
3524
- 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, memoryDefaultOptions 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 EmbedResult as aA, type EmbedManyResult as aB, type BaseStructuredOutputType as aC, type StructuredOutputType as aD, type StructuredOutputArrayItem as aE, type StructuredOutput as aF, type GenerateReturn as aG, type StreamReturn as aH, type OutputType as aI, type DefaultLLMTextOptions as aJ, type DefaultLLMTextObjectOptions as aK, type DefaultLLMStreamOptions as aL, type DefaultLLMStreamObjectOptions as aM, type LLMTextOptions as aN, type LLMTextObjectOptions as aO, type LLMStreamOptions as aP, type LLMInnerStreamOptions as aQ, type LLMStreamObjectOptions as aR, createMockModel as aS, type Config as aT, type MessageType as aU, type MessageResponse as aV, type MemoryConfig as aW, type SharedMemoryConfig as aX, type TraceType as aY, type MemoryProcessorOpts as aZ, MemoryProcessor 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 WorkflowConfig as at, type LanguageModel as au, type CoreMessage as av, type CoreSystemMessage as aw, type CoreAssistantMessage as ax, type CoreUserMessage as ay, type CoreToolMessage as az, MastraMemory as b, type StepFlowEntry as b0, type SerializedStep as b1, type SerializedStepFlowEntry as b2, createStep as b3, cloneStep as b4, createWorkflow as b5, cloneWorkflow as b6, type WorkflowResult as b7, Run as b8, type ExecutionGraph as b9, type MCPServerSSEOptions as bA, type MCPServerHonoSSEOptions as bB, type MCPServerHTTPOptions as bC, type Repository as bD, type VersionDetail as bE, type ArgumentInfo as bF, type PositionalArgumentInfo as bG, type NamedArgumentInfo as bH, type SubcommandInfo as bI, type CommandInfo as bJ, type EnvironmentVariableInfo as bK, type PackageInfo as bL, type RemoteInfo as bM, type MCPServerConfig as bN, type ServerInfo as bO, type ServerDetailInfo as bP, type MCPToolType as bQ, MessageList as bR, type ToolsetsInput as bS, type DynamicArgument as bT, type AgentGenerateOptions as bU, type AgentStreamOptions as bV, type MastraMessageContentV2 as bW, ExecutionEngine as ba, type ExecuteFunction as bb, type StepSuccess as bc, type StepFailure as bd, type StepSuspended as be, type StepRunning as bf, type StepResult as bg, type StepsRecord as bh, type DynamicMapping as bi, type PathsToStringProps as bj, type ExtractSchemaType as bk, type ExtractSchemaFromStep as bl, type VariableReference as bm, type StreamEvent as bn, type WatchEvent as bo, type ZodPathType as bp, type WorkflowRunState as bq, type MastraLanguageModel as br, type VoiceEventType as bs, type VoiceEventMap as bt, type VoiceConfig as bu, MastraVoice as bv, CompositeVoice as bw, DefaultVoice as bx, type AgentNetworkConfig as by, type ConvertedTool 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 };
3530
+ export { type BaseCondition as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, type DefaultEngineType as D, type EvalRow as E, TABLE_WORKFLOW_SNAPSHOT as F, TABLE_EVALS as G, TABLE_MESSAGES as H, TABLE_THREADS as I, TABLE_TRACES as J, TABLE_SCHEMAS as K, LegacyWorkflow as L, Mastra as M, type VariableReference$1 as N, type StepResult$1 as O, type PaginationInfo as P, type StepAction as Q, type LegacyWorkflowRunResult as R, type StepExecutionContext as S, type ToolsInput as T, type WorkflowOptions as U, type VercelTool as V, type WorkflowContext as W, type StepVariableType as X, type StepNode as Y, type StepGraph as Z, type RetryConfig as _, type MastraPrimitives as a, MemoryProcessor as a$, type ActionContext as a0, WhenConditionReturnValue as a1, type StepDef as a2, type StepCondition as a3, type StepConfig as a4, type StepsRecord$1 as a5, type WorkflowLogMessage as a6, type WorkflowEvent as a7, type ResolverFunctionInput as a8, type ResolverFunctionOutput 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 MemoryConfig as aX, type SharedMemoryConfig as aY, type TraceType as aZ, type MemoryProcessorOpts as a_, type SubscriberFunctionOutput as aa, type DependencyCheckOutput as ab, type StepResolverOutput as ac, type WorkflowActors as ad, type WorkflowActionParams as ae, type WorkflowActions as af, type LegacyWorkflowState as ag, type StepId as ah, type ExtractSchemaFromStep$1 as ai, type ExtractStepResult as aj, type StepInputType as ak, type ExtractSchemaType$1 as al, type PathsToStringProps$1 as am, type LegacyWorkflowRunState as an, type WorkflowResumeResult as ao, Tool as ap, createTool as aq, type InternalCoreTool as ar, type ToolExecutionContext as as, type AgentConfig 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, memoryDefaultOptions as b0, type StepFlowEntry as b1, type SerializedStep as b2, type SerializedStepFlowEntry as b3, createStep as b4, cloneStep as b5, createWorkflow as b6, cloneWorkflow as b7, type WorkflowResult as b8, Run as b9, type ConvertedTool as bA, type MCPServerSSEOptions as bB, type MCPServerHonoSSEOptions as bC, type MCPServerHTTPOptions as bD, type Repository as bE, type VersionDetail as bF, type ArgumentInfo as bG, type PositionalArgumentInfo as bH, type NamedArgumentInfo as bI, type SubcommandInfo as bJ, type CommandInfo as bK, type EnvironmentVariableInfo as bL, type PackageInfo as bM, type RemoteInfo as bN, type MCPServerConfig as bO, type ServerInfo as bP, type ServerDetailInfo as bQ, type MCPToolType as bR, MessageList as bS, type ToolsetsInput as bT, type DynamicArgument as bU, type AgentGenerateOptions as bV, type AgentStreamOptions as bW, type MastraMessageContentV2 as bX, type ExecutionGraph as ba, ExecutionEngine as bb, type ExecuteFunction as bc, type StepSuccess as bd, type StepFailure as be, type StepSuspended as bf, type StepRunning as bg, type StepResult as bh, type StepsRecord as bi, type DynamicMapping as bj, type PathsToStringProps as bk, type ExtractSchemaType as bl, type ExtractSchemaFromStep as bm, type VariableReference as bn, type StreamEvent as bo, type WatchEvent as bp, type ZodPathType as bq, type WorkflowRunState as br, type MastraLanguageModel as bs, type VoiceEventType as bt, type VoiceEventMap as bu, type VoiceConfig as bv, MastraVoice as bw, CompositeVoice as bx, DefaultVoice as by, type AgentNetworkConfig 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 };
@@ -1040,7 +1040,7 @@ declare class LegacyWorkflow<TSteps extends LegacyStep<string, any, any>[] = Leg
1040
1040
  toStep(): LegacyStep<TStepId, TTriggerSchema, z.ZodType<LegacyWorkflowRunResult<TTriggerSchema, TSteps, TResultSchema>>, any>;
1041
1041
  }
1042
1042
 
1043
- type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (params: {
1043
+ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, EngineType> = (params: {
1044
1044
  runId: string;
1045
1045
  mastra: Mastra;
1046
1046
  runtimeContext: RuntimeContext;
@@ -1057,15 +1057,16 @@ type ExecuteFunction<TStepInput, TStepOutput, TResumeSchema, TSuspendSchema> = (
1057
1057
  [EMITTER_SYMBOL]: {
1058
1058
  emit: (event: string, data: any) => Promise<void>;
1059
1059
  };
1060
+ engine: EngineType;
1060
1061
  }) => Promise<TStepOutput>;
1061
- 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>> {
1062
+ 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> {
1062
1063
  id: TStepId;
1063
1064
  description?: string;
1064
1065
  inputSchema: TSchemaIn;
1065
1066
  outputSchema: TSchemaOut;
1066
1067
  resumeSchema?: TResumeSchema;
1067
1068
  suspendSchema?: TSuspendSchema;
1068
- execute: ExecuteFunction<z.infer<TSchemaIn>, z.infer<TSchemaOut>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>>;
1069
+ execute: ExecuteFunction<z.infer<TSchemaIn>, z.infer<TSchemaOut>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, TEngineType>;
1069
1070
  retries?: number;
1070
1071
  }
1071
1072
 
@@ -1114,7 +1115,7 @@ type StepsRecord<T extends readonly Step<any, any, any>[]> = {
1114
1115
  }>;
1115
1116
  };
1116
1117
  type DynamicMapping<TPrevSchema extends z.ZodTypeAny, TSchemaOut extends z.ZodTypeAny> = {
1117
- fn: ExecuteFunction<z.infer<TPrevSchema>, z.infer<TSchemaOut>, any, any>;
1118
+ fn: ExecuteFunction<z.infer<TPrevSchema>, z.infer<TSchemaOut>, any, any, any>;
1118
1119
  schema: TSchemaOut;
1119
1120
  };
1120
1121
  type PathsToStringProps<T> = T extends object ? {
@@ -1158,7 +1159,7 @@ type WatchEvent = {
1158
1159
  suspendedAt?: number;
1159
1160
  resumedAt?: number;
1160
1161
  }>;
1161
- output?: Record<string, any>;
1162
+ result?: Record<string, any>;
1162
1163
  payload?: Record<string, any>;
1163
1164
  error?: string | Error;
1164
1165
  };
@@ -1168,6 +1169,9 @@ type WatchEvent = {
1168
1169
  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;
1169
1170
  interface WorkflowRunState {
1170
1171
  runId: string;
1172
+ status: 'success' | 'failed' | 'suspended' | 'running';
1173
+ result?: Record<string, any>;
1174
+ error?: string | Error;
1171
1175
  value: Record<string, string>;
1172
1176
  context: {
1173
1177
  input?: Record<string, any>;
@@ -1224,7 +1228,8 @@ declare abstract class ExecutionEngine extends MastraBase {
1224
1228
  }): Promise<TOutput>;
1225
1229
  }
1226
1230
 
1227
- type StepFlowEntry = {
1231
+ type DefaultEngineType = {};
1232
+ type StepFlowEntry<TEngineType = DefaultEngineType> = {
1228
1233
  type: 'step';
1229
1234
  step: Step;
1230
1235
  } | {
@@ -1233,7 +1238,7 @@ type StepFlowEntry = {
1233
1238
  } | {
1234
1239
  type: 'conditional';
1235
1240
  steps: StepFlowEntry[];
1236
- conditions: ExecuteFunction<any, any, any, any>[];
1241
+ conditions: ExecuteFunction<any, any, any, any, TEngineType>[];
1237
1242
  serializedConditions: {
1238
1243
  id: string;
1239
1244
  fn: string;
@@ -1241,7 +1246,7 @@ type StepFlowEntry = {
1241
1246
  } | {
1242
1247
  type: 'loop';
1243
1248
  step: Step;
1244
- condition: ExecuteFunction<any, any, any, any>;
1249
+ condition: ExecuteFunction<any, any, any, any, any>;
1245
1250
  serializedCondition: {
1246
1251
  id: string;
1247
1252
  fn: string;
@@ -1254,7 +1259,7 @@ type StepFlowEntry = {
1254
1259
  concurrency: number;
1255
1260
  };
1256
1261
  };
1257
- type SerializedStep = Pick<Step, 'id' | 'description'> & {
1262
+ type SerializedStep<TEngineType = DefaultEngineType> = Pick<Step<any, any, any, any, any, TEngineType>, 'id' | 'description'> & {
1258
1263
  component?: string;
1259
1264
  serializedStepFlow?: SerializedStepFlowEntry[];
1260
1265
  mapConfig?: string;
@@ -1297,32 +1302,32 @@ type SerializedStepFlowEntry = {
1297
1302
  * @param params.execute Function that performs the step's operations
1298
1303
  * @returns A Step object that can be added to the workflow
1299
1304
  */
1300
- declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(params: {
1305
+ declare function createStep<TStepId extends string, TStepInput extends z.ZodType<any>, TStepOutput extends z.ZodType<any>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>, TEngineType = DefaultEngineType>(params: {
1301
1306
  id: TStepId;
1302
1307
  description?: string;
1303
1308
  inputSchema: TStepInput;
1304
1309
  outputSchema: TStepOutput;
1305
1310
  resumeSchema?: TResumeSchema;
1306
1311
  suspendSchema?: TSuspendSchema;
1307
- execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>>;
1308
- }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema>;
1312
+ execute: ExecuteFunction<z.infer<TStepInput>, z.infer<TStepOutput>, z.infer<TResumeSchema>, z.infer<TSuspendSchema>, TEngineType>;
1313
+ }): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, TEngineType>;
1309
1314
  declare function createStep<TStepId extends string, TStepInput extends z.ZodObject<{
1310
1315
  prompt: z.ZodString;
1311
1316
  }>, TStepOutput extends z.ZodObject<{
1312
1317
  text: z.ZodString;
1313
- }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema>;
1318
+ }>, TResumeSchema extends z.ZodType<any>, TSuspendSchema extends z.ZodType<any>>(agent: Agent<TStepId, any, any>): Step<TStepId, TStepInput, TStepOutput, TResumeSchema, TSuspendSchema, DefaultEngineType>;
1314
1319
  declare function createStep<TSchemaIn extends z.ZodType<any>, TSchemaOut extends z.ZodType<any>, TContext extends ToolExecutionContext<TSchemaIn>>(tool: Tool<TSchemaIn, TSchemaOut, TContext> & {
1315
1320
  inputSchema: TSchemaIn;
1316
1321
  outputSchema: TSchemaOut;
1317
1322
  execute: (context: TContext) => Promise<any>;
1318
- }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>>;
1323
+ }): Step<string, TSchemaIn, TSchemaOut, z.ZodType<any>, z.ZodType<any>, DefaultEngineType>;
1319
1324
  declare function cloneStep<TStepId extends string>(step: Step<string, any, any>, opts: {
1320
1325
  id: TStepId;
1321
1326
  }): Step<TStepId, any, any>;
1322
- declare function createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TInput>;
1323
- declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[]>(workflow: Workflow<TSteps, string, TInput, TOutput>, opts: {
1327
+ declare function createWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TEngineType = DefaultEngineType, TSteps extends Step<string, any, any, any, any, TEngineType>[] = Step<string, any, any, any, any, TEngineType>[]>(params: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>): Workflow<TSteps, TWorkflowId, TInput, TOutput, DefaultEngineType, TInput>;
1328
+ declare function cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TSteps extends Step<string, any, any, any, any, DefaultEngineType>[] = Step<string, any, any, any, any, DefaultEngineType>[]>(workflow: Workflow<TSteps, string, TInput, TOutput, DefaultEngineType>, opts: {
1324
1329
  id: TWorkflowId;
1325
- }): Workflow<TSteps, TWorkflowId, TInput, TOutput>;
1330
+ }): Workflow<TSteps, TWorkflowId, TInput, TOutput, DefaultEngineType>;
1326
1331
  type WorkflowResult<TOutput extends z.ZodType<any>, TSteps extends Step<string, any, any>[]> = {
1327
1332
  status: 'success';
1328
1333
  result: z.infer<TOutput>;
@@ -1355,7 +1360,7 @@ type WorkflowConfig<TWorkflowId extends string = string, TInput extends z.ZodTyp
1355
1360
  delay?: number;
1356
1361
  };
1357
1362
  };
1358
- declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends MastraBase implements Step<TWorkflowId, TInput, TOutput> {
1363
+ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<string, any, any, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TEngineType = DefaultEngineType, TPrevSchema extends z.ZodType<any> = TInput> extends MastraBase implements Step<TWorkflowId, TInput, TOutput, any, any, TEngineType> {
1359
1364
  #private;
1360
1365
  id: TWorkflowId;
1361
1366
  description?: string | undefined;
@@ -1373,7 +1378,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1373
1378
  };
1374
1379
  constructor({ mastra, id, inputSchema, outputSchema, description, executionEngine, retryConfig, steps, }: WorkflowConfig<TWorkflowId, TInput, TOutput, TSteps>);
1375
1380
  get runs(): Map<string, Run<TSteps, TInput, TOutput>>;
1376
- get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<Step<string, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, MCPServerBase>> | undefined;
1381
+ get mastra(): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, DefaultEngineType, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, MCPServerBase>> | undefined;
1377
1382
  __registerMastra(mastra: Mastra): void;
1378
1383
  __registerPrimitives(p: MastraPrimitives): void;
1379
1384
  setStepFlow(stepFlow: StepFlowEntry[]): void;
@@ -1382,7 +1387,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1382
1387
  * @param step The step to add to the workflow
1383
1388
  * @returns The workflow instance for chaining
1384
1389
  */
1385
- then<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1390
+ then<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, TSchemaOut>;
1386
1391
  map<TSteps extends Step<string, any, any>[], TMapping extends {
1387
1392
  [K in keyof TMapping]: {
1388
1393
  step: TSteps[number] | TSteps[number][];
@@ -1397,17 +1402,17 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1397
1402
  runtimeContextPath: string;
1398
1403
  schema: z.ZodTypeAny;
1399
1404
  } | DynamicMapping<TPrevSchema, z.ZodTypeAny>;
1400
- }>(mappingConfig: TMapping | ExecuteFunction<z.infer<TPrevSchema>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, any>;
1401
- parallel<TParallelSteps extends Step<string, TPrevSchema, any, any, any>[]>(steps: TParallelSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<TParallelSteps>]: StepsRecord<TParallelSteps>[K]["outputSchema"]["path"]; }, any, z.ZodTypeAny>>;
1405
+ }>(mappingConfig: TMapping | ExecuteFunction<z.infer<TPrevSchema>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, TInput>;
1406
+ parallel<TParallelSteps extends Step<string, TPrevSchema, any, any, any, TEngineType>[]>(steps: TParallelSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<TParallelSteps>]: StepsRecord<TParallelSteps>[K]["outputSchema"]["path"]; }, any, z.ZodTypeAny>>;
1402
1407
  branch<TBranchSteps extends Array<[
1403
- ExecuteFunction<z.infer<TPrevSchema>, any, any, any>,
1404
- Step<string, TPrevSchema, any, any, any>
1405
- ]>>(steps: TBranchSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>]: StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>[K]["outputSchema"]; }, any, z.ZodTypeAny>>;
1406
- dowhile<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1407
- dountil<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1408
- foreach<TPrevIsArray extends TPrevSchema extends z.ZodArray<any> ? true : false, TStepInputSchema extends TPrevSchema extends z.ZodArray<infer TElement> ? TElement : never, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: TPrevIsArray extends true ? Step<TStepId, TStepInputSchema, TSchemaOut, any, any> : 'Previous step must return an array type', opts?: {
1408
+ ExecuteFunction<z.infer<TPrevSchema>, any, any, any, any>,
1409
+ Step<string, TPrevSchema, any, any, any, TEngineType>
1410
+ ]>>(steps: TBranchSteps): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodObject<{ [K in keyof StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>]: StepsRecord<{ [K_1 in keyof TBranchSteps]: TBranchSteps[K_1][1]; }[number][]>[K]["outputSchema"]; }, any, z.ZodTypeAny, TEngineType>>;
1411
+ dowhile<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1412
+ dountil<TStepInputSchema extends TPrevSchema, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType>, condition: ExecuteFunction<z.infer<TSchemaOut>, any, any, any, TEngineType>): Workflow<TSteps, TWorkflowId, TInput, TOutput, TSchemaOut>;
1413
+ foreach<TPrevIsArray extends TPrevSchema extends z.ZodArray<any> ? true : false, TStepInputSchema extends TPrevSchema extends z.ZodArray<infer TElement> ? TElement : never, TStepId extends string, TSchemaOut extends z.ZodType<any>>(step: TPrevIsArray extends true ? Step<TStepId, TStepInputSchema, TSchemaOut, any, any, TEngineType> : 'Previous step must return an array type', opts?: {
1409
1414
  concurrency: number;
1410
- }): Workflow<TSteps, TWorkflowId, TInput, TOutput, z.ZodArray<TSchemaOut>>;
1415
+ }): Workflow<TSteps, TWorkflowId, TInput, TOutput, TEngineType, z.ZodArray<TSchemaOut>>;
1411
1416
  /**
1412
1417
  * Builds the execution graph for this workflow
1413
1418
  * @returns The execution graph that can be used to execute the workflow
@@ -1419,7 +1424,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1419
1424
  * @returns A built workflow instance ready for execution
1420
1425
  */
1421
1426
  commit(): Workflow<TSteps, TWorkflowId, TInput, TOutput, TOutput>;
1422
- get stepGraph(): StepFlowEntry[];
1427
+ get stepGraph(): StepFlowEntry<DefaultEngineType>[];
1423
1428
  get serializedStepGraph(): SerializedStepFlowEntry[];
1424
1429
  /**
1425
1430
  * Creates a new workflow run instance
@@ -1444,6 +1449,7 @@ declare class Workflow<TSteps extends Step<string, any, any, any, any>[] = Step<
1444
1449
  };
1445
1450
  mastra: Mastra;
1446
1451
  runtimeContext?: RuntimeContext;
1452
+ engine: TEngineType;
1447
1453
  }): Promise<z.infer<TOutput>>;
1448
1454
  getWorkflowRuns(args?: {
1449
1455
  fromDate?: Date;
@@ -3521,4 +3527,4 @@ declare abstract class MastraStorage extends MastraBase {
3521
3527
  }>;
3522
3528
  }
3523
3529
 
3524
- 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, memoryDefaultOptions 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 EmbedResult as aA, type EmbedManyResult as aB, type BaseStructuredOutputType as aC, type StructuredOutputType as aD, type StructuredOutputArrayItem as aE, type StructuredOutput as aF, type GenerateReturn as aG, type StreamReturn as aH, type OutputType as aI, type DefaultLLMTextOptions as aJ, type DefaultLLMTextObjectOptions as aK, type DefaultLLMStreamOptions as aL, type DefaultLLMStreamObjectOptions as aM, type LLMTextOptions as aN, type LLMTextObjectOptions as aO, type LLMStreamOptions as aP, type LLMInnerStreamOptions as aQ, type LLMStreamObjectOptions as aR, createMockModel as aS, type Config as aT, type MessageType as aU, type MessageResponse as aV, type MemoryConfig as aW, type SharedMemoryConfig as aX, type TraceType as aY, type MemoryProcessorOpts as aZ, MemoryProcessor 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 WorkflowConfig as at, type LanguageModel as au, type CoreMessage as av, type CoreSystemMessage as aw, type CoreAssistantMessage as ax, type CoreUserMessage as ay, type CoreToolMessage as az, MastraMemory as b, type StepFlowEntry as b0, type SerializedStep as b1, type SerializedStepFlowEntry as b2, createStep as b3, cloneStep as b4, createWorkflow as b5, cloneWorkflow as b6, type WorkflowResult as b7, Run as b8, type ExecutionGraph as b9, type MCPServerSSEOptions as bA, type MCPServerHonoSSEOptions as bB, type MCPServerHTTPOptions as bC, type Repository as bD, type VersionDetail as bE, type ArgumentInfo as bF, type PositionalArgumentInfo as bG, type NamedArgumentInfo as bH, type SubcommandInfo as bI, type CommandInfo as bJ, type EnvironmentVariableInfo as bK, type PackageInfo as bL, type RemoteInfo as bM, type MCPServerConfig as bN, type ServerInfo as bO, type ServerDetailInfo as bP, type MCPToolType as bQ, MessageList as bR, type ToolsetsInput as bS, type DynamicArgument as bT, type AgentGenerateOptions as bU, type AgentStreamOptions as bV, type MastraMessageContentV2 as bW, ExecutionEngine as ba, type ExecuteFunction as bb, type StepSuccess as bc, type StepFailure as bd, type StepSuspended as be, type StepRunning as bf, type StepResult as bg, type StepsRecord as bh, type DynamicMapping as bi, type PathsToStringProps as bj, type ExtractSchemaType as bk, type ExtractSchemaFromStep as bl, type VariableReference as bm, type StreamEvent as bn, type WatchEvent as bo, type ZodPathType as bp, type WorkflowRunState as bq, type MastraLanguageModel as br, type VoiceEventType as bs, type VoiceEventMap as bt, type VoiceConfig as bu, MastraVoice as bv, CompositeVoice as bw, DefaultVoice as bx, type AgentNetworkConfig as by, type ConvertedTool 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 };
3530
+ export { type BaseCondition as $, Agent as A, type StorageGetTracesArg as B, type CoreTool as C, type DefaultEngineType as D, type EvalRow as E, TABLE_WORKFLOW_SNAPSHOT as F, TABLE_EVALS as G, TABLE_MESSAGES as H, TABLE_THREADS as I, TABLE_TRACES as J, TABLE_SCHEMAS as K, LegacyWorkflow as L, Mastra as M, type VariableReference$1 as N, type StepResult$1 as O, type PaginationInfo as P, type StepAction as Q, type LegacyWorkflowRunResult as R, type StepExecutionContext as S, type ToolsInput as T, type WorkflowOptions as U, type VercelTool as V, type WorkflowContext as W, type StepVariableType as X, type StepNode as Y, type StepGraph as Z, type RetryConfig as _, type MastraPrimitives as a, MemoryProcessor as a$, type ActionContext as a0, WhenConditionReturnValue as a1, type StepDef as a2, type StepCondition as a3, type StepConfig as a4, type StepsRecord$1 as a5, type WorkflowLogMessage as a6, type WorkflowEvent as a7, type ResolverFunctionInput as a8, type ResolverFunctionOutput 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 MemoryConfig as aX, type SharedMemoryConfig as aY, type TraceType as aZ, type MemoryProcessorOpts as a_, type SubscriberFunctionOutput as aa, type DependencyCheckOutput as ab, type StepResolverOutput as ac, type WorkflowActors as ad, type WorkflowActionParams as ae, type WorkflowActions as af, type LegacyWorkflowState as ag, type StepId as ah, type ExtractSchemaFromStep$1 as ai, type ExtractStepResult as aj, type StepInputType as ak, type ExtractSchemaType$1 as al, type PathsToStringProps$1 as am, type LegacyWorkflowRunState as an, type WorkflowResumeResult as ao, Tool as ap, createTool as aq, type InternalCoreTool as ar, type ToolExecutionContext as as, type AgentConfig 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, memoryDefaultOptions as b0, type StepFlowEntry as b1, type SerializedStep as b2, type SerializedStepFlowEntry as b3, createStep as b4, cloneStep as b5, createWorkflow as b6, cloneWorkflow as b7, type WorkflowResult as b8, Run as b9, type ConvertedTool as bA, type MCPServerSSEOptions as bB, type MCPServerHonoSSEOptions as bC, type MCPServerHTTPOptions as bD, type Repository as bE, type VersionDetail as bF, type ArgumentInfo as bG, type PositionalArgumentInfo as bH, type NamedArgumentInfo as bI, type SubcommandInfo as bJ, type CommandInfo as bK, type EnvironmentVariableInfo as bL, type PackageInfo as bM, type RemoteInfo as bN, type MCPServerConfig as bO, type ServerInfo as bP, type ServerDetailInfo as bQ, type MCPToolType as bR, MessageList as bS, type ToolsetsInput as bT, type DynamicArgument as bU, type AgentGenerateOptions as bV, type AgentStreamOptions as bW, type MastraMessageContentV2 as bX, type ExecutionGraph as ba, ExecutionEngine as bb, type ExecuteFunction as bc, type StepSuccess as bd, type StepFailure as be, type StepSuspended as bf, type StepRunning as bg, type StepResult as bh, type StepsRecord as bi, type DynamicMapping as bj, type PathsToStringProps as bk, type ExtractSchemaType as bl, type ExtractSchemaFromStep as bm, type VariableReference as bn, type StreamEvent as bo, type WatchEvent as bp, type ZodPathType as bq, type WorkflowRunState as br, type MastraLanguageModel as bs, type VoiceEventType as bt, type VoiceEventMap as bu, type VoiceConfig as bv, MastraVoice as bw, CompositeVoice as bx, DefaultVoice as by, type AgentNetworkConfig 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 };
@@ -0,0 +1,68 @@
1
+ import { MastraError } from './chunk-LDNCERLU.js';
2
+ import { MastraBase } from './chunk-5IEKR756.js';
3
+
4
+ // src/vector/vector.ts
5
+ var MastraVector = class extends MastraBase {
6
+ constructor() {
7
+ super({ name: "MastraVector", component: "VECTOR" });
8
+ }
9
+ get indexSeparator() {
10
+ return "_";
11
+ }
12
+ async validateExistingIndex(indexName, dimension, metric) {
13
+ let info;
14
+ try {
15
+ info = await this.describeIndex({ indexName });
16
+ } catch (infoError) {
17
+ const mastraError = new MastraError(
18
+ {
19
+ id: "VECTOR_VALIDATE_INDEX_FETCH_FAILED",
20
+ text: `Index "${indexName}" already exists, but failed to fetch index info for dimension check.`,
21
+ domain: "MASTRA_VECTOR" /* MASTRA_VECTOR */,
22
+ category: "SYSTEM" /* SYSTEM */,
23
+ details: { indexName }
24
+ },
25
+ infoError
26
+ );
27
+ this.logger?.trackException(mastraError);
28
+ this.logger?.error(mastraError.toString());
29
+ throw mastraError;
30
+ }
31
+ const existingDim = info?.dimension;
32
+ const existingMetric = info?.metric;
33
+ if (existingDim === dimension) {
34
+ this.logger?.info(
35
+ `Index "${indexName}" already exists with ${existingDim} dimensions and metric ${existingMetric}, skipping creation.`
36
+ );
37
+ if (existingMetric !== metric) {
38
+ this.logger?.warn(
39
+ `Attempted to create index with metric "${metric}", but index already exists with metric "${existingMetric}". To use a different metric, delete and recreate the index.`
40
+ );
41
+ }
42
+ } else if (info) {
43
+ const mastraError = new MastraError({
44
+ id: "VECTOR_VALIDATE_INDEX_DIMENSION_MISMATCH",
45
+ text: `Index "${indexName}" already exists with ${existingDim} dimensions, but ${dimension} dimensions were requested`,
46
+ domain: "MASTRA_VECTOR" /* MASTRA_VECTOR */,
47
+ category: "USER" /* USER */,
48
+ details: { indexName, existingDim, requestedDim: dimension }
49
+ });
50
+ this.logger?.trackException(mastraError);
51
+ this.logger?.error(mastraError.toString());
52
+ throw mastraError;
53
+ } else {
54
+ const mastraError = new MastraError({
55
+ id: "VECTOR_VALIDATE_INDEX_NO_DIMENSION",
56
+ text: `Index "${indexName}" already exists, but could not retrieve its dimensions for validation.`,
57
+ domain: "MASTRA_VECTOR" /* MASTRA_VECTOR */,
58
+ category: "SYSTEM" /* SYSTEM */,
59
+ details: { indexName }
60
+ });
61
+ this.logger?.trackException(mastraError);
62
+ this.logger?.error(mastraError.toString());
63
+ throw mastraError;
64
+ }
65
+ }
66
+ };
67
+
68
+ export { MastraVector };