@mastra/core 0.2.0-alpha.95 → 0.2.0-alpha.96

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.
@@ -1,5 +1,5 @@
1
1
  import 'zod';
2
- export { I as IAction, ah as IExecutionContext, c as MastraPrimitives } from '../index-CBxGSZZE.js';
2
+ export { I as IAction, ah as IExecutionContext, c as MastraPrimitives } from '../index-M8e8RIkM.js';
3
3
  import '../index-CBZ2mk2H.js';
4
4
  import '../telemetry-oCUM52DG.js';
5
5
  import '../vector/index.js';
@@ -1,7 +1,7 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent } from '../index-CBxGSZZE.js';
4
+ export { A as Agent } from '../index-M8e8RIkM.js';
5
5
  import '../base.js';
6
6
  import '../metric-D2V4CR8D.js';
7
7
  import '../telemetry-oCUM52DG.js';
@@ -1,7 +1,7 @@
1
- export { Agent } from '../chunk-JY322VLW.js';
1
+ export { Agent } from '../chunk-UTOZGI4D.js';
2
2
  import '../chunk-4ZUSEHLH.js';
3
3
  import '../chunk-KNPBNSJ7.js';
4
- import '../chunk-HBTQNIAX.js';
5
4
  import '../chunk-G4MCO7XF.js';
6
5
  import '../chunk-ICMEXHKD.js';
6
+ import '../chunk-HBTQNIAX.js';
7
7
  import '../chunk-AJJZUHB4.js';
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-JY322VLW.js';
1
+ import { Agent } from './chunk-UTOZGI4D.js';
2
2
  import { __name, __publicField } from './chunk-AJJZUHB4.js';
3
3
  import { CohereClient } from 'cohere-ai';
4
4
 
@@ -18,7 +18,7 @@ function isVariableReference(value) {
18
18
  }
19
19
  __name(isVariableReference, "isVariableReference");
20
20
  function getStepResult(result) {
21
- if (result?.status === "success") return result.payload;
21
+ if (result?.status === "success") return result.output;
22
22
  return undefined;
23
23
  }
24
24
  __name(getStepResult, "getStepResult");
@@ -184,8 +184,8 @@ var _Workflow = class _Workflow extends MastraBase {
184
184
  });
185
185
  }
186
186
  const machineInput = snapshot ? snapshot.context : {
187
- // Maintain the original step results and their payloads
188
- stepResults: {},
187
+ // Maintain the original step results and their output
188
+ steps: {},
189
189
  triggerData: triggerData || {},
190
190
  attempts: Object.keys(__privateGet(this, _steps)).reduce((acc, stepKey) => {
191
191
  acc[stepKey] = __privateGet(this, _steps)[stepKey]?.retryConfig?.attempts || __privateGet(this, _retryConfig)?.attempts || 3;
@@ -256,7 +256,7 @@ var _Workflow = class _Workflow extends MastraBase {
256
256
  __privateMethod(this, _Workflow_instances, cleanup_fn).call(this);
257
257
  resolve({
258
258
  triggerData,
259
- results: state.context.stepResults,
259
+ results: state.context.steps,
260
260
  runId: __privateGet(this, _runId)
261
261
  });
262
262
  } catch (error) {
@@ -266,7 +266,7 @@ var _Workflow = class _Workflow extends MastraBase {
266
266
  __privateMethod(this, _Workflow_instances, cleanup_fn).call(this);
267
267
  resolve({
268
268
  triggerData,
269
- results: state.context.stepResults,
269
+ results: state.context.steps,
270
270
  runId: __privateGet(this, _runId)
271
271
  });
272
272
  }
@@ -355,7 +355,7 @@ var _Workflow = class _Workflow extends MastraBase {
355
355
  }
356
356
  let parsedSnapshot;
357
357
  try {
358
- parsedSnapshot = JSON.parse(snapshot);
358
+ parsedSnapshot = typeof snapshot === "string" ? JSON.parse(snapshot) : snapshot;
359
359
  } catch (error) {
360
360
  this.logger.debug("Failed to parse workflow snapshot for resume", {
361
361
  error,
@@ -364,10 +364,10 @@ var _Workflow = class _Workflow extends MastraBase {
364
364
  throw new Error("Failed to parse workflow snapshot");
365
365
  }
366
366
  if (resumeContext) {
367
- parsedSnapshot.context.stepResults[stepId] = {
367
+ parsedSnapshot.context.steps[stepId] = {
368
368
  status: "success",
369
- payload: {
370
- ...parsedSnapshot?.context?.stepResults?.[stepId]?.payload || {},
369
+ output: {
370
+ ...parsedSnapshot?.context?.steps?.[stepId]?.output || {},
371
371
  ...resumeContext
372
372
  }
373
373
  };
@@ -506,16 +506,16 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
506
506
  target: "suspended",
507
507
  actions: [
508
508
  assign({
509
- stepResults: /* @__PURE__ */ __name(({ context, event }) => {
510
- if (event.output.type !== "SUSPENDED") return context.stepResults;
509
+ steps: /* @__PURE__ */ __name(({ context, event }) => {
510
+ if (event.output.type !== "SUSPENDED") return context.steps;
511
511
  return {
512
- ...context.stepResults,
512
+ ...context.steps,
513
513
  [stepNode.step.id]: {
514
514
  status: "suspended",
515
- ...context.stepResults?.[stepNode.step.id] || {}
515
+ ...context.steps?.[stepNode.step.id] || {}
516
516
  }
517
517
  };
518
- }, "stepResults"),
518
+ }, "steps"),
519
519
  attempts: /* @__PURE__ */ __name(({ context, event }) => {
520
520
  if (event.output.type !== "SUSPENDED") return context.attempts;
521
521
  return {
@@ -539,15 +539,15 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
539
539
  }
540
540
  },
541
541
  assign({
542
- stepResults: /* @__PURE__ */ __name(({ context, event }) => {
543
- if (event.output.type !== "WAITING") return context.stepResults;
542
+ steps: /* @__PURE__ */ __name(({ context, event }) => {
543
+ if (event.output.type !== "WAITING") return context.steps;
544
544
  return {
545
- ...context.stepResults,
545
+ ...context.steps,
546
546
  [stepNode.step.id]: {
547
547
  status: "waiting"
548
548
  }
549
549
  };
550
- }, "stepResults")
550
+ }, "steps")
551
551
  })
552
552
  ]
553
553
  },
@@ -563,20 +563,20 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
563
563
  }, "guard"),
564
564
  target: "failed",
565
565
  actions: assign({
566
- stepResults: /* @__PURE__ */ __name(({ context, event }) => {
567
- if (event.output.type !== "CONDITION_FAILED") return context.stepResults;
566
+ steps: /* @__PURE__ */ __name(({ context, event }) => {
567
+ if (event.output.type !== "CONDITION_FAILED") return context.steps;
568
568
  this.logger.debug(`workflow condition check failed`, {
569
569
  error: event.output.error,
570
570
  stepId: stepNode.step.id
571
571
  });
572
572
  return {
573
- ...context.stepResults,
573
+ ...context.steps,
574
574
  [stepNode.step.id]: {
575
575
  status: "failed",
576
576
  error: event.output.error
577
577
  }
578
578
  };
579
- }, "stepResults")
579
+ }, "steps")
580
580
  })
581
581
  }
582
582
  ]
@@ -602,13 +602,13 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
602
602
  this.logger.debug(`Step ${stepNode.step.id} suspended`);
603
603
  },
604
604
  assign({
605
- stepResults: /* @__PURE__ */ __name(({ context }) => ({
606
- ...context.stepResults,
605
+ steps: /* @__PURE__ */ __name(({ context }) => ({
606
+ ...context.steps,
607
607
  [stepNode.step.id]: {
608
- ...context?.stepResults?.[stepNode.step.id] || {},
608
+ ...context?.steps?.[stepNode.step.id] || {},
609
609
  status: "suspended"
610
610
  }
611
- }), "stepResults")
611
+ }), "steps")
612
612
  })
613
613
  ]
614
614
  },
@@ -621,12 +621,12 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
621
621
  target: "suspended",
622
622
  actions: [
623
623
  assign({
624
- stepResults: /* @__PURE__ */ __name(({ context }) => ({
625
- ...context.stepResults,
624
+ steps: /* @__PURE__ */ __name(({ context }) => ({
625
+ ...context.steps,
626
626
  [stepNode.step.id]: {
627
627
  status: "suspended"
628
628
  }
629
- }), "stepResults")
629
+ }), "steps")
630
630
  })
631
631
  ]
632
632
  }
@@ -687,10 +687,10 @@ buildBaseState_fn = /* @__PURE__ */ __name(function(stepNode, nextSteps = []) {
687
687
  target: nextStep ? nextStep.step.id : "completed",
688
688
  actions: [
689
689
  assign({
690
- stepResults: /* @__PURE__ */ __name(({ context, event }) => ({
691
- ...context.stepResults,
692
- ...event.output.stepResults
693
- }), "stepResults")
690
+ steps: /* @__PURE__ */ __name(({ context, event }) => ({
691
+ ...context.steps,
692
+ ...event.output.steps
693
+ }), "steps")
694
694
  }),
695
695
  () => this.logger.debug(`Subscriber execution completed`, {
696
696
  stepId: stepNode.step.id
@@ -779,31 +779,31 @@ buildStateHierarchy_fn = /* @__PURE__ */ __name(function(stepGraph) {
779
779
  getDefaultActions_fn = /* @__PURE__ */ __name(function() {
780
780
  return {
781
781
  updateStepResult: assign({
782
- stepResults: /* @__PURE__ */ __name(({ context, event }) => {
783
- if (!isTransitionEvent(event)) return context.stepResults;
782
+ steps: /* @__PURE__ */ __name(({ context, event }) => {
783
+ if (!isTransitionEvent(event)) return context.steps;
784
784
  const { stepId, result } = event.output;
785
785
  return {
786
- ...context.stepResults,
786
+ ...context.steps,
787
787
  [stepId]: {
788
788
  status: "success",
789
- payload: result
789
+ output: result
790
790
  }
791
791
  };
792
- }, "stepResults")
792
+ }, "steps")
793
793
  }),
794
794
  setStepError: assign({
795
- stepResults: /* @__PURE__ */ __name(({ context, event }, params) => {
796
- if (!isErrorEvent(event)) return context.stepResults;
795
+ steps: /* @__PURE__ */ __name(({ context, event }, params) => {
796
+ if (!isErrorEvent(event)) return context.steps;
797
797
  const { stepId } = params;
798
- if (!stepId) return context.stepResults;
798
+ if (!stepId) return context.steps;
799
799
  return {
800
- ...context.stepResults,
800
+ ...context.steps,
801
801
  [stepId]: {
802
802
  status: "failed",
803
803
  error: event.error.message
804
804
  }
805
805
  };
806
- }, "stepResults")
806
+ }, "steps")
807
807
  }),
808
808
  notifyStepCompletion: /* @__PURE__ */ __name(async (_, params) => {
809
809
  const { stepId } = params;
@@ -858,13 +858,10 @@ getDefaultActors_fn = /* @__PURE__ */ __name(function() {
858
858
  runId: __privateGet(this, _runId)
859
859
  });
860
860
  const result = await stepNode.config.handler({
861
- context: {
862
- machineContext: context,
863
- ...resolvedData
864
- },
861
+ context: resolvedData,
865
862
  suspend: /* @__PURE__ */ __name(async () => {
866
863
  if (__privateGet(this, _actor)) {
867
- context.stepResults[stepNode.step.id] = {
864
+ context.steps[stepNode.step.id] = {
868
865
  status: "suspended"
869
866
  };
870
867
  await __privateMethod(this, _Workflow_instances, persistWorkflowSnapshot_fn).call(this);
@@ -958,7 +955,7 @@ getDefaultActors_fn = /* @__PURE__ */ __name(function() {
958
955
  const stepGraph = __privateGet(this, _stepSubscriberGraph)[parentStepId];
959
956
  if (!stepGraph) {
960
957
  return {
961
- stepResults: {}
958
+ steps: {}
962
959
  };
963
960
  }
964
961
  const subscriberMachine = setup({
@@ -993,7 +990,7 @@ getDefaultActors_fn = /* @__PURE__ */ __name(function() {
993
990
  if (allStatesComplete) {
994
991
  actor.stop();
995
992
  resolve({
996
- stepResults: state.context.stepResults
993
+ steps: state.context.steps
997
994
  });
998
995
  }
999
996
  });
@@ -1043,25 +1040,24 @@ loadWorkflowSnapshot_fn = /* @__PURE__ */ __name(async function(runId) {
1043
1040
  * @returns Object containing resolved variable values
1044
1041
  */
1045
1042
  resolveVariables_fn = /* @__PURE__ */ __name(function({ stepConfig, context, stepId }) {
1046
- const resolvedData = {};
1047
1043
  this.logger.debug(`Resolving variables for ${stepId}`, {
1048
1044
  runId: __privateGet(this, _runId)
1049
1045
  });
1050
- resolvedData.machineContext = {
1046
+ const resolvedData = {
1051
1047
  ...context,
1052
1048
  getStepPayload: /* @__PURE__ */ __name((stepId2) => {
1053
1049
  if (stepId2 === "trigger") {
1054
1050
  return context.triggerData;
1055
1051
  }
1056
- const result = context.stepResults[stepId2];
1052
+ const result = context.steps[stepId2];
1057
1053
  if (result && result.status === "success") {
1058
- return result.payload;
1054
+ return result.output;
1059
1055
  }
1060
1056
  return undefined;
1061
1057
  }, "getStepPayload")
1062
1058
  };
1063
1059
  for (const [key, variable] of Object.entries(stepConfig.data)) {
1064
- const sourceData = variable.step === "trigger" ? context.triggerData : getStepResult(context.stepResults[variable.step.id]);
1060
+ const sourceData = variable.step === "trigger" ? context.triggerData : getStepResult(context.steps[variable.step.id]);
1065
1061
  this.logger.debug(`Got source data for ${key} variable from ${variable.step === "trigger" ? "trigger" : variable.step.id}`, {
1066
1062
  sourceData,
1067
1063
  path: variable.path,
@@ -1092,7 +1088,7 @@ evaluateCondition_fn = /* @__PURE__ */ __name(function(condition, context) {
1092
1088
  const [key, queryValue] = simpleCondition;
1093
1089
  const [stepId, ...pathParts] = key.split(".");
1094
1090
  const path = pathParts.join(".");
1095
- const sourceData = stepId === "trigger" ? context.triggerData : getStepResult(context.stepResults[stepId]);
1091
+ const sourceData = stepId === "trigger" ? context.triggerData : getStepResult(context.steps[stepId]);
1096
1092
  this.logger.debug(`Got condition data from ${stepId}`, {
1097
1093
  sourceData,
1098
1094
  runId: __privateGet(this, _runId)
@@ -1112,7 +1108,7 @@ evaluateCondition_fn = /* @__PURE__ */ __name(function(condition, context) {
1112
1108
  }
1113
1109
  if ("ref" in condition) {
1114
1110
  const { ref, query } = condition;
1115
- const sourceData = ref.step === "trigger" ? context.triggerData : getStepResult(context.stepResults[ref.step.id]);
1111
+ const sourceData = ref.step === "trigger" ? context.triggerData : getStepResult(context.steps[ref.step.id]);
1116
1112
  this.logger.debug(`Got condition data from ${ref.step === "trigger" ? "trigger" : ref.step.id}`, {
1117
1113
  sourceData,
1118
1114
  runId: __privateGet(this, _runId)
@@ -1226,7 +1222,7 @@ hasStateChanged_fn = /* @__PURE__ */ __name(function(previous, current) {
1226
1222
  if (JSON.stringify(prevPath?.stepPath) !== JSON.stringify(currPath?.stepPath)) return true;
1227
1223
  if (prevPath?.status !== currPath?.status) return true;
1228
1224
  }
1229
- if (JSON.stringify(previous.context.stepResults) !== JSON.stringify(current.context.stepResults)) return true;
1225
+ if (JSON.stringify(previous.context.steps) !== JSON.stringify(current.context.steps)) return true;
1230
1226
  return false;
1231
1227
  }, "#hasStateChanged");
1232
1228
  getDeepestState_fn = /* @__PURE__ */ __name(function(value) {
@@ -1,5 +1,5 @@
1
1
  import { M as Metric, a as MetricResult } from '../metric-D2V4CR8D.js';
2
- import { A as Agent } from '../index-CBxGSZZE.js';
2
+ import { A as Agent } from '../index-M8e8RIkM.js';
3
3
  import 'ai';
4
4
  import 'json-schema';
5
5
  import 'zod';
@@ -96,7 +96,7 @@ interface StepConfig<TStep extends IAction<any, any, any, any>, CondStep extends
96
96
  }
97
97
  type StepSuccess<T> = {
98
98
  status: 'success';
99
- payload: T;
99
+ output: T;
100
100
  };
101
101
  type StepSuspended = {
102
102
  status: 'suspended';
@@ -110,7 +110,7 @@ type StepFailure = {
110
110
  };
111
111
  type StepResult<T> = StepSuccess<T> | StepFailure | StepSuspended | StepWaiting;
112
112
  interface WorkflowContext<TTrigger extends z.ZodType<any> = any> {
113
- stepResults: Record<string, StepResult<any>>;
113
+ steps: Record<string, StepResult<any>>;
114
114
  triggerData: z.infer<TTrigger>;
115
115
  attempts: Record<string, number>;
116
116
  getStepPayload: <T = unknown>(stepId: string) => T | undefined;
@@ -271,7 +271,7 @@ type PathsToStringProps<T> = T extends object ? {
271
271
  interface WorkflowRunState {
272
272
  value: Record<string, string>;
273
273
  context: {
274
- stepResults: Record<string, {
274
+ steps: Record<string, {
275
275
  status: 'success' | 'failed' | 'suspended' | 'waiting';
276
276
  payload?: any;
277
277
  error?: string;
@@ -570,11 +570,7 @@ type MastraPrimitives = {
570
570
  memory?: MastraMemory;
571
571
  };
572
572
  interface IExecutionContext<TSchemaIn extends z.ZodSchema | undefined = undefined, TContext extends WorkflowContext = WorkflowContext> {
573
- context: TSchemaIn extends z.ZodSchema ? z.infer<TSchemaIn> & {
574
- machineContext?: TContext;
575
- } : {
576
- machineContext?: TContext;
577
- };
573
+ context: TSchemaIn extends z.ZodSchema ? z.infer<TSchemaIn> & TContext : TContext;
578
574
  runId?: string;
579
575
  mastra?: MastraPrimitives;
580
576
  suspend: () => Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { M as Metric } from './metric-D2V4CR8D.js';
2
2
  export { a as MetricResult } from './metric-D2V4CR8D.js';
3
- import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './index-CBxGSZZE.js';
4
- export { Z as ActionContext, H as AiMessageType, Y as BaseCondition, B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, U as CoreTool, r as CoreToolMessage, q as CoreUserMessage, a6 as DependencyCheckOutput, s as EmbedManyResult, E as EmbedResult, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, P as MemoryConfig, N as MessageResponse, J as MessageType, O as OutputType, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, Q as SharedMemoryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, f as StepResult, d as StepVariableType, l as StorageColumn, n as StorageGetMessagesArg, K as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a5 as SubscriberFunctionOutput, k as TABLE_NAMES, X as VariableReference, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, m as WorkflowRow, g as WorkflowRunState, aa as WorkflowState } from './index-CBxGSZZE.js';
3
+ import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './index-M8e8RIkM.js';
4
+ export { Z as ActionContext, H as AiMessageType, Y as BaseCondition, B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, U as CoreTool, r as CoreToolMessage, q as CoreUserMessage, a6 as DependencyCheckOutput, s as EmbedManyResult, E as EmbedResult, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, P as MemoryConfig, N as MessageResponse, J as MessageType, O as OutputType, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, Q as SharedMemoryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, f as StepResult, d as StepVariableType, l as StorageColumn, n as StorageGetMessagesArg, K as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a5 as SubscriberFunctionOutput, k as TABLE_NAMES, X as VariableReference, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, m as WorkflowRow, g as WorkflowRunState, aa as WorkflowState } from './index-M8e8RIkM.js';
5
5
  export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './telemetry-oCUM52DG.js';
6
6
  import { MastraBase as MastraBase$1 } from './base.js';
7
7
  import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-CBZ2mk2H.js';
@@ -20,8 +20,8 @@ import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
20
20
  export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
21
21
  import { MastraVector as MastraVector$1 } from './vector/index.js';
22
22
  export { IndexStats, QueryResult } from './vector/index.js';
23
- import { S as Step, W as Workflow$1 } from './workflow-BA2Pnq90.js';
24
- export { c as createStep } from './workflow-BA2Pnq90.js';
23
+ import { S as Step, W as Workflow$1 } from './workflow-DaKNLC8e.js';
24
+ export { c as createStep } from './workflow-DaKNLC8e.js';
25
25
  export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
26
26
  export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
27
27
  export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { MastraStorage, DefaultStorage } from './chunk-EULBQ77C.js';
2
2
  export { DefaultStorage } from './chunk-EULBQ77C.js';
3
3
  import { MastraTTS } from './chunk-K3N7KJHH.js';
4
- import { Workflow } from './chunk-E3TBVBIO.js';
5
- export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-E3TBVBIO.js';
4
+ import { Workflow } from './chunk-MDM2JS2U.js';
5
+ export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-MDM2JS2U.js';
6
6
  export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-5DZIXJRV.js';
7
7
  import { MastraVector } from './chunk-MBOUQZQT.js';
8
8
  export { BaseFilterTranslator } from './chunk-4LJFWC2Q.js';
@@ -12,17 +12,17 @@ export { createTool } from './chunk-VOUPGVRD.js';
12
12
  import './chunk-AE3H2QEY.js';
13
13
  export { Mastra } from './chunk-TYIBRZOY.js';
14
14
  import { MastraMemory } from './chunk-G4LP2IJU.js';
15
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-N44BCOWP.js';
16
- import { Agent } from './chunk-JY322VLW.js';
15
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-43VWZDGE.js';
16
+ import { Agent } from './chunk-UTOZGI4D.js';
17
17
  export { InstrumentClass, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZUSEHLH.js';
18
18
  export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-KNPBNSJ7.js';
19
19
  import { MastraDeployer } from './chunk-JJ57BXQR.js';
20
- export { Metric, evaluate } from './chunk-QLN26TPI.js';
21
- export { AvailableHooks, executeHook, registerHook } from './chunk-HBTQNIAX.js';
22
20
  import './chunk-MCB4M5W4.js';
23
21
  import { MastraBase } from './chunk-G4MCO7XF.js';
24
22
  import { createLogger } from './chunk-ICMEXHKD.js';
25
23
  export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-ICMEXHKD.js';
24
+ export { Metric, evaluate } from './chunk-QLN26TPI.js';
25
+ export { AvailableHooks, executeHook, registerHook } from './chunk-HBTQNIAX.js';
26
26
  import { __name } from './chunk-AJJZUHB4.js';
27
27
 
28
28
  // src/agent/index.warning.ts
@@ -1,6 +1,6 @@
1
1
  import '../telemetry-oCUM52DG.js';
2
- import { W as Workflow } from '../workflow-BA2Pnq90.js';
3
- import { T as ToolAction } from '../index-CBxGSZZE.js';
2
+ import { W as Workflow } from '../workflow-DaKNLC8e.js';
3
+ import { T as ToolAction } from '../index-M8e8RIkM.js';
4
4
  import '@opentelemetry/api';
5
5
  import '@opentelemetry/sdk-node';
6
6
  import '@opentelemetry/sdk-trace-base';
@@ -1,7 +1,7 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, r as CoreToolMessage, q as CoreUserMessage, s as EmbedManyResult, E as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../index-CBxGSZZE.js';
4
+ export { B as BaseStructuredOutputType, p as CoreAssistantMessage, C as CoreMessage, o as CoreSystemMessage, r as CoreToolMessage, q as CoreUserMessage, s as EmbedManyResult, E as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../index-M8e8RIkM.js';
5
5
  import '../index-CBZ2mk2H.js';
6
6
  import '../base.js';
7
7
  import '@opentelemetry/api';
@@ -1,6 +1,6 @@
1
- import { A as Agent, M as MastraStorage, a as MastraMemory } from '../index-CBxGSZZE.js';
1
+ import { A as Agent, M as MastraStorage, a as MastraMemory } from '../index-M8e8RIkM.js';
2
2
  import { L as Logger, B as BaseLogMessage } from '../index-CBZ2mk2H.js';
3
- import { W as Workflow } from '../workflow-BA2Pnq90.js';
3
+ import { W as Workflow } from '../workflow-DaKNLC8e.js';
4
4
  import { MastraVector } from '../vector/index.js';
5
5
  import { O as OtelConfig, T as Telemetry } from '../telemetry-oCUM52DG.js';
6
6
  import { MastraTTS } from '../tts/index.js';
@@ -1,6 +1,6 @@
1
1
  import 'ai';
2
2
  import '../base.js';
3
- export { H as AiMessageType, a as MastraMemory, P as MemoryConfig, N as MessageResponse, J as MessageType, Q as SharedMemoryConfig, K as StorageThreadType } from '../index-CBxGSZZE.js';
3
+ export { H as AiMessageType, a as MastraMemory, P as MemoryConfig, N as MessageResponse, J as MessageType, Q as SharedMemoryConfig, K as StorageThreadType } from '../index-M8e8RIkM.js';
4
4
  import '../vector/index.js';
5
5
  import '@opentelemetry/api';
6
6
  import '../index-CBZ2mk2H.js';
@@ -1,8 +1,8 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-N44BCOWP.js';
2
- import '../chunk-JY322VLW.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-43VWZDGE.js';
2
+ import '../chunk-UTOZGI4D.js';
3
3
  import '../chunk-4ZUSEHLH.js';
4
4
  import '../chunk-KNPBNSJ7.js';
5
- import '../chunk-HBTQNIAX.js';
6
5
  import '../chunk-G4MCO7XF.js';
7
6
  import '../chunk-ICMEXHKD.js';
7
+ import '../chunk-HBTQNIAX.js';
8
8
  import '../chunk-AJJZUHB4.js';
@@ -1,5 +1,5 @@
1
- import { M as MastraStorage, k as TABLE_NAMES, l as StorageColumn, K as StorageThreadType, J as MessageType, n as StorageGetMessagesArg } from '../index-CBxGSZZE.js';
2
- export { m as WorkflowRow } from '../index-CBxGSZZE.js';
1
+ import { M as MastraStorage, k as TABLE_NAMES, l as StorageColumn, K as StorageThreadType, J as MessageType, n as StorageGetMessagesArg } from '../index-M8e8RIkM.js';
2
+ export { m as WorkflowRow } from '../index-M8e8RIkM.js';
3
3
  import '../telemetry-oCUM52DG.js';
4
4
  export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
5
5
  import 'ai';
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../index-CBxGSZZE.js';
3
- export { U as CoreTool } from '../index-CBxGSZZE.js';
2
+ import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../index-M8e8RIkM.js';
3
+ export { U as CoreTool } from '../index-M8e8RIkM.js';
4
4
  import 'ai';
5
5
  import 'json-schema';
6
6
  import '../base.js';
@@ -1,6 +1,6 @@
1
1
  import { Snapshot } from 'xstate';
2
2
  import { z } from 'zod';
3
- import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './index-CBxGSZZE.js';
3
+ import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './index-M8e8RIkM.js';
4
4
  import { MastraBase } from './base.js';
5
5
 
6
6
  declare class Step<TStepId extends string = any, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends StepExecutionContext<TSchemaIn> = StepExecutionContext<TSchemaIn>> implements StepAction<TStepId, TSchemaIn, TSchemaOut, TContext> {
@@ -1,6 +1,6 @@
1
- export { S as Step, W as Workflow, c as createStep } from '../workflow-BA2Pnq90.js';
2
- import { X as VariableReference, f as StepResult } from '../index-CBxGSZZE.js';
3
- export { Z as ActionContext, Y as BaseCondition, a6 as DependencyCheckOutput, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, d as StepVariableType, a5 as SubscriberFunctionOutput, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, aa as WorkflowState } from '../index-CBxGSZZE.js';
1
+ export { S as Step, W as Workflow, c as createStep } from '../workflow-DaKNLC8e.js';
2
+ import { X as VariableReference, f as StepResult } from '../index-M8e8RIkM.js';
3
+ export { Z as ActionContext, Y as BaseCondition, a6 as DependencyCheckOutput, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, $ as StepCondition, e as StepConfig, _ as StepDef, S as StepExecutionContext, h as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, d as StepVariableType, a5 as SubscriberFunctionOutput, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, aa as WorkflowState } from '../index-M8e8RIkM.js';
4
4
  import 'xstate';
5
5
  import 'zod';
6
6
  import '../base.js';
@@ -1,4 +1,4 @@
1
- export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-E3TBVBIO.js';
1
+ export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-MDM2JS2U.js';
2
2
  import '../chunk-G4MCO7XF.js';
3
3
  import '../chunk-ICMEXHKD.js';
4
4
  import '../chunk-AJJZUHB4.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.2.0-alpha.95",
3
+ "version": "0.2.0-alpha.96",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/core.esm.js",
@@ -121,7 +121,7 @@
121
121
  "scripts": {
122
122
  "check": "tsc --noEmit",
123
123
  "analyze": "size-limit --why",
124
- "build": "tsup-node src/index.ts src/base.ts src/utils.ts src/*/index.ts src/vector/libsql/index.ts --format esm --clean --dts --treeshake",
124
+ "build": "pnpm check && tsup-node src/index.ts src/base.ts src/utils.ts src/*/index.ts src/vector/libsql/index.ts --format esm --clean --dts --treeshake",
125
125
  "build:dev": "pnpm build --watch",
126
126
  "size": "size-limit",
127
127
  "test": "vitest run"
@@ -1,8 +1,8 @@
1
1
  import { InstrumentClass } from './chunk-4ZUSEHLH.js';
2
2
  import { delay } from './chunk-KNPBNSJ7.js';
3
- import { executeHook, AvailableHooks } from './chunk-HBTQNIAX.js';
4
3
  import { MastraBase } from './chunk-G4MCO7XF.js';
5
4
  import { RegisteredLogger, LogLevel } from './chunk-ICMEXHKD.js';
5
+ import { executeHook, AvailableHooks } from './chunk-HBTQNIAX.js';
6
6
  import { __name, __privateAdd, __privateSet, __privateGet, __publicField } from './chunk-AJJZUHB4.js';
7
7
  import { randomUUID } from 'crypto';
8
8
  import { z } from 'zod';