@mastra/core 0.10.2-alpha.3 → 0.10.2-alpha.4

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 (85) 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-BzojM-QS.d.ts → base-CJfljebX.d.ts} +58 -19
  6. package/dist/{base-BVk16Aam.d.cts → base-D3nqrhQw.d.cts} +58 -19
  7. package/dist/{chunk-BHZLIUY7.js → chunk-3YEDPVNU.js} +1 -1
  8. package/dist/{chunk-KSPHQSZX.cjs → chunk-4ETGZJWF.cjs} +2 -2
  9. package/dist/{chunk-CMJDDEFJ.js → chunk-4YCQPROE.js} +21 -1
  10. package/dist/{chunk-4I6LG5EO.cjs → chunk-52MCT5OL.cjs} +2 -2
  11. package/dist/{chunk-5YZ3UOVW.cjs → chunk-BCFBT6AN.cjs} +2 -2
  12. package/dist/{chunk-2SMCLROM.cjs → chunk-E4PVJAEL.cjs} +2 -2
  13. package/dist/{chunk-BFNYQFG2.js → chunk-EWDGXKOQ.js} +100 -2
  14. package/dist/{chunk-BYMMP6QW.cjs → chunk-EZDS6FFZ.cjs} +11 -11
  15. package/dist/{chunk-C3ICEF6E.js → chunk-JU3LCRM2.js} +1 -1
  16. package/dist/{chunk-AHLWW5GJ.js → chunk-KSJGZAMN.js} +1 -1
  17. package/dist/{chunk-75EMTCUM.js → chunk-L5ADXH5Q.js} +1 -1
  18. package/dist/{chunk-ZKN6HYYQ.js → chunk-MSJ24XNY.js} +1 -1
  19. package/dist/{chunk-XAO67QBR.cjs → chunk-OB2PB6SX.cjs} +15 -15
  20. package/dist/{chunk-2CK6E5UF.cjs → chunk-PD6WZC42.cjs} +4 -4
  21. package/dist/{chunk-5UFUPI3G.js → chunk-Q5L522HN.js} +1 -1
  22. package/dist/{chunk-MVW7B234.cjs → chunk-SE4RJNUA.cjs} +22 -2
  23. package/dist/{chunk-UVRGQEMD.cjs → chunk-TICDQWVJ.cjs} +106 -2
  24. package/dist/{chunk-P7BGXOQV.cjs → chunk-U3XKEE2T.cjs} +19 -19
  25. package/dist/{chunk-LCCQWUQP.js → chunk-U47X2EYV.js} +15 -15
  26. package/dist/{chunk-MZDYQ3I7.js → chunk-WCGRF63O.js} +5 -5
  27. package/dist/eval/index.d.cts +1 -1
  28. package/dist/eval/index.d.ts +1 -1
  29. package/dist/index.cjs +35 -35
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +10 -10
  33. package/dist/integration/index.d.cts +1 -1
  34. package/dist/integration/index.d.ts +1 -1
  35. package/dist/llm/index.d.cts +1 -1
  36. package/dist/llm/index.d.ts +1 -1
  37. package/dist/mastra/index.cjs +2 -2
  38. package/dist/mastra/index.d.cts +1 -1
  39. package/dist/mastra/index.d.ts +1 -1
  40. package/dist/mastra/index.js +1 -1
  41. package/dist/mcp/index.d.cts +1 -1
  42. package/dist/mcp/index.d.ts +1 -1
  43. package/dist/memory/index.cjs +4 -4
  44. package/dist/memory/index.d.cts +1 -1
  45. package/dist/memory/index.d.ts +1 -1
  46. package/dist/memory/index.js +1 -1
  47. package/dist/network/index.cjs +2 -2
  48. package/dist/network/index.d.cts +1 -1
  49. package/dist/network/index.d.ts +1 -1
  50. package/dist/network/index.js +1 -1
  51. package/dist/relevance/index.cjs +4 -4
  52. package/dist/relevance/index.d.cts +1 -1
  53. package/dist/relevance/index.d.ts +1 -1
  54. package/dist/relevance/index.js +1 -1
  55. package/dist/server/index.d.cts +2 -2
  56. package/dist/server/index.d.ts +2 -2
  57. package/dist/storage/index.cjs +16 -12
  58. package/dist/storage/index.d.cts +8 -3
  59. package/dist/storage/index.d.ts +8 -3
  60. package/dist/storage/index.js +9 -5
  61. package/dist/telemetry/index.cjs +7 -7
  62. package/dist/telemetry/index.d.cts +1 -1
  63. package/dist/telemetry/index.d.ts +1 -1
  64. package/dist/telemetry/index.js +1 -1
  65. package/dist/tools/index.d.cts +1 -1
  66. package/dist/tools/index.d.ts +1 -1
  67. package/dist/tts/index.cjs +2 -2
  68. package/dist/tts/index.js +1 -1
  69. package/dist/utils.d.cts +1 -1
  70. package/dist/utils.d.ts +1 -1
  71. package/dist/voice/index.cjs +4 -4
  72. package/dist/voice/index.d.cts +1 -1
  73. package/dist/voice/index.d.ts +1 -1
  74. package/dist/voice/index.js +1 -1
  75. package/dist/workflows/index.cjs +9 -9
  76. package/dist/workflows/index.d.cts +12 -7
  77. package/dist/workflows/index.d.ts +12 -7
  78. package/dist/workflows/index.js +1 -1
  79. package/dist/workflows/legacy/index.cjs +22 -22
  80. package/dist/workflows/legacy/index.d.cts +2 -2
  81. package/dist/workflows/legacy/index.d.ts +2 -2
  82. package/dist/workflows/legacy/index.js +1 -1
  83. package/package.json +1 -1
  84. package/dist/chunk-6KB5CPBV.cjs +0 -104
  85. package/dist/chunk-SEOWDGC2.js +0 -97
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkBYMMP6QW_cjs = require('../chunk-BYMMP6QW.cjs');
4
- var chunkXAO67QBR_cjs = require('../chunk-XAO67QBR.cjs');
3
+ var chunkEZDS6FFZ_cjs = require('../chunk-EZDS6FFZ.cjs');
4
+ var chunkOB2PB6SX_cjs = require('../chunk-OB2PB6SX.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkBYMMP6QW_cjs.Agent; }
10
+ get: function () { return chunkEZDS6FFZ_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "MessageList", {
13
13
  enumerable: true,
14
- get: function () { return chunkXAO67QBR_cjs.MessageList; }
14
+ get: function () { return chunkOB2PB6SX_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 { r as Agent, aa as AgentConfig, bN as AgentGenerateOptions, bO as AgentStreamOptions, bM as DynamicArgument, bh as MastraLanguageModel, bP as MastraMessageContentV2, e as MastraMessageV2, bK as MessageList, t as ToolsInput, bL as ToolsetsInput } from '../base-BVk16Aam.cjs';
4
+ export { s as Agent, ab as AgentConfig, bN as AgentGenerateOptions, bO as AgentStreamOptions, bM as DynamicArgument, bh as MastraLanguageModel, bP as MastraMessageContentV2, e as MastraMessageV2, bK as MessageList, u as ToolsInput, bL as ToolsetsInput } from '../base-D3nqrhQw.cjs';
5
5
  import '../base-aPYtPBT2.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 { r as Agent, aa as AgentConfig, bN as AgentGenerateOptions, bO as AgentStreamOptions, bM as DynamicArgument, bh as MastraLanguageModel, bP as MastraMessageContentV2, e as MastraMessageV2, bK as MessageList, t as ToolsInput, bL as ToolsetsInput } from '../base-BzojM-QS.js';
4
+ export { s as Agent, ab as AgentConfig, bN as AgentGenerateOptions, bO as AgentStreamOptions, bM as DynamicArgument, bh as MastraLanguageModel, bP as MastraMessageContentV2, e as MastraMessageV2, bK as MessageList, u as ToolsInput, bL as ToolsetsInput } from '../base-CJfljebX.js';
5
5
  import '../base-tc5kgDTD.js';
6
6
  import '../types-Bo1uigWx.js';
7
7
  import '../runtime-context/index.js';
@@ -1,2 +1,2 @@
1
- export { Agent } from '../chunk-MZDYQ3I7.js';
2
- export { MessageList } from '../chunk-LCCQWUQP.js';
1
+ export { Agent } from '../chunk-WCGRF63O.js';
2
+ export { MessageList } from '../chunk-U47X2EYV.js';
@@ -1167,6 +1167,7 @@ interface WorkflowRunState {
1167
1167
  context: {
1168
1168
  input?: Record<string, any>;
1169
1169
  } & Record<string, StepResult<any, any, any, any>>;
1170
+ serializedStepGraph: SerializedStepFlowEntry[];
1170
1171
  activePaths: Array<unknown>;
1171
1172
  suspendedPaths: Record<string, number[]>;
1172
1173
  timestamp: number;
@@ -1199,6 +1200,7 @@ declare abstract class ExecutionEngine extends MastraBase {
1199
1200
  workflowId: string;
1200
1201
  runId: string;
1201
1202
  graph: ExecutionGraph;
1203
+ serializedStepGraph: SerializedStepFlowEntry[];
1202
1204
  input?: TInput;
1203
1205
  resume?: {
1204
1206
  steps: string[];
@@ -1473,6 +1475,10 @@ declare class Run<TSteps extends Step<string, any, any>[] = Step<string, any, an
1473
1475
  * The execution graph for this run
1474
1476
  */
1475
1477
  executionGraph: ExecutionGraph;
1478
+ /**
1479
+ * The serialized step graph for this run
1480
+ */
1481
+ serializedStepGraph: SerializedStepFlowEntry[];
1476
1482
  protected cleanup?: () => void;
1477
1483
  protected retryConfig?: {
1478
1484
  attempts?: number;
@@ -1489,6 +1495,7 @@ declare class Run<TSteps extends Step<string, any, any>[] = Step<string, any, an
1489
1495
  delay?: number;
1490
1496
  };
1491
1497
  cleanup?: () => void;
1498
+ serializedStepGraph: SerializedStepFlowEntry[];
1492
1499
  });
1493
1500
  /**
1494
1501
  * Starts the workflow execution with the provided input
@@ -1599,16 +1606,17 @@ type MastraMessageV1 = {
1599
1606
  content: string | UserContent | AssistantContent | ToolContent;
1600
1607
  role: 'system' | 'user' | 'assistant' | 'tool';
1601
1608
  createdAt: Date;
1602
- threadId: string;
1603
- resourceId: string;
1609
+ threadId?: string;
1610
+ resourceId?: string;
1604
1611
  toolCallIds?: string[];
1605
1612
  toolCallArgs?: Record<string, unknown>[];
1606
1613
  toolNames?: string[];
1607
1614
  type: 'text' | 'tool-call' | 'tool-result';
1608
1615
  };
1609
- type MessageType = MastraMessageV2 & {
1610
- threadId: string;
1611
- };
1616
+ /**
1617
+ * @deprecated use MastraMessageV1 or MastraMessageV2
1618
+ */
1619
+ type MessageType = MastraMessageV1;
1612
1620
  type StorageThreadType = {
1613
1621
  id: string;
1614
1622
  title?: string;
@@ -1674,8 +1682,8 @@ declare class MessageList {
1674
1682
  private taggedSystemMessages;
1675
1683
  private memoryInfo;
1676
1684
  private memoryMessages;
1677
- private newMessages;
1678
- private responseMessages;
1685
+ private newUserMessages;
1686
+ private newResponseMessages;
1679
1687
  private generateMessageId?;
1680
1688
  constructor({ threadId, resourceId, generateMessageId, }?: {
1681
1689
  threadId?: string;
@@ -1686,26 +1694,26 @@ declare class MessageList {
1686
1694
  getLatestUserContent(): string | null;
1687
1695
  get get(): {
1688
1696
  all: {
1689
- mastra: () => MastraMessageV2[];
1697
+ v2: () => MastraMessageV2[];
1690
1698
  v1: () => MastraMessageV1[];
1691
1699
  ui: () => UIMessage[];
1692
1700
  core: () => CoreMessage$1[];
1693
1701
  prompt: () => CoreMessage$1[];
1694
1702
  };
1695
1703
  remembered: {
1696
- mastra: () => MastraMessageV2[];
1704
+ v2: () => MastraMessageV2[];
1697
1705
  v1: () => MastraMessageV1[];
1698
1706
  ui: () => UIMessage[];
1699
1707
  core: () => CoreMessage$1[];
1700
1708
  };
1701
1709
  input: {
1702
- mastra: () => MastraMessageV2[];
1710
+ v2: () => MastraMessageV2[];
1703
1711
  v1: () => MastraMessageV1[];
1704
1712
  ui: () => UIMessage[];
1705
1713
  core: () => CoreMessage$1[];
1706
1714
  };
1707
1715
  response: {
1708
- mastra: () => MastraMessageV2[];
1716
+ v2: () => MastraMessageV2[];
1709
1717
  };
1710
1718
  };
1711
1719
  private all;
@@ -1855,17 +1863,28 @@ declare abstract class MastraMemory extends MastraBase {
1855
1863
  * @param messages - Array of messages to save
1856
1864
  * @returns Promise resolving to the saved messages
1857
1865
  */
1858
- abstract saveMessages({ messages, memoryConfig, }: {
1859
- messages: (MastraMessageV1 | MastraMessageV2)[];
1860
- memoryConfig: MemoryConfig | undefined;
1866
+ abstract saveMessages(args: {
1867
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1868
+ memoryConfig?: MemoryConfig | undefined;
1869
+ format?: 'v1';
1870
+ }): Promise<MastraMessageV1[]>;
1871
+ abstract saveMessages(args: {
1872
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1873
+ memoryConfig?: MemoryConfig | undefined;
1874
+ format: 'v2';
1861
1875
  }): Promise<MastraMessageV2[]>;
1876
+ abstract saveMessages(args: {
1877
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1878
+ memoryConfig?: MemoryConfig | undefined;
1879
+ format?: 'v1' | 'v2';
1880
+ }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
1862
1881
  /**
1863
1882
  * Retrieves all messages for a specific thread
1864
1883
  * @param threadId - The unique identifier of the thread
1865
1884
  * @returns Promise resolving to array of messages and uiMessages
1866
1885
  */
1867
1886
  abstract query({ threadId, resourceId, selectBy, }: StorageGetMessagesArg): Promise<{
1868
- messages: MastraMessageV1[];
1887
+ messages: CoreMessage$1[];
1869
1888
  uiMessages: UIMessage[];
1870
1889
  }>;
1871
1890
  /**
@@ -3324,10 +3343,30 @@ declare abstract class MastraStorage extends MastraBase {
3324
3343
  abstract deleteThread({ threadId }: {
3325
3344
  threadId: string;
3326
3345
  }): Promise<void>;
3327
- abstract getMessages({ threadId, selectBy, threadConfig }: StorageGetMessagesArg): Promise<MastraMessageV2[]>;
3328
- abstract saveMessages({ messages }: {
3329
- messages: (MastraMessageV1 | MastraMessageV2)[];
3346
+ abstract getMessages(args: StorageGetMessagesArg & {
3347
+ format?: 'v1';
3348
+ }): Promise<MastraMessageV1[]>;
3349
+ abstract getMessages(args: StorageGetMessagesArg & {
3350
+ format: 'v2';
3330
3351
  }): Promise<MastraMessageV2[]>;
3352
+ abstract getMessages({ threadId, resourceId, selectBy, format, }: StorageGetMessagesArg & {
3353
+ format?: 'v1' | 'v2';
3354
+ }): Promise<MastraMessageV1[] | MastraMessageV2[]>;
3355
+ abstract saveMessages(args: {
3356
+ messages: MastraMessageV1[];
3357
+ format?: undefined | 'v1';
3358
+ }): Promise<MastraMessageV1[]>;
3359
+ abstract saveMessages(args: {
3360
+ messages: MastraMessageV2[];
3361
+ format: 'v2';
3362
+ }): Promise<MastraMessageV2[]>;
3363
+ abstract saveMessages(args: {
3364
+ messages: MastraMessageV1[];
3365
+ format?: undefined | 'v1';
3366
+ } | {
3367
+ messages: MastraMessageV2[];
3368
+ format: 'v2';
3369
+ }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
3331
3370
  abstract getTraces({ name, scope, page, perPage, attributes, filters, }: {
3332
3371
  name?: string;
3333
3372
  scope?: string;
@@ -3363,4 +3402,4 @@ declare abstract class MastraStorage extends MastraBase {
3363
3402
  }): Promise<WorkflowRun | null>;
3364
3403
  }
3365
3404
 
3366
- export { type WorkflowActions as $, type ApiRoute as A, type StepGraph as B, type ContextWithMastra as C, type BaseCondition as D, type EvalRow as E, type ActionContext as F, WhenConditionReturnValue as G, type StepDef as H, type StepCondition as I, type StepConfig as J, type StepsRecord$1 as K, type LegacyWorkflowRuns as L, type Methods as M, type WorkflowLogMessage as N, type WorkflowEvent as O, type ResolverFunctionInput as P, type ResolverFunctionOutput as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type SubscriberFunctionOutput as U, type VariableReference$1 as V, type WorkflowRuns as W, type DependencyCheckOutput as X, type StepResolverOutput as Y, type WorkflowActors as Z, type WorkflowActionParams as _, Mastra as a, Run as a$, type LegacyWorkflowState as a0, type StepId as a1, type ExtractSchemaFromStep$1 as a2, type ExtractStepResult as a3, type StepInputType as a4, type ExtractSchemaType$1 as a5, type PathsToStringProps$1 as a6, type LegacyWorkflowRunState as a7, type WorkflowResumeResult as a8, type ToolAction as a9, type LLMTextOptions as aA, type LLMTextObjectOptions as aB, type LLMStreamOptions as aC, type LLMInnerStreamOptions as aD, type LLMStreamObjectOptions as aE, createMockModel as aF, type Config as aG, type MastraMessageV1 as aH, type MessageType as aI, type MessageResponse as aJ, type MemoryConfig as aK, type SharedMemoryConfig as aL, type MemoryProcessorOpts as aM, MemoryProcessor as aN, memoryDefaultOptions as aO, createTool as aP, type VercelTool as aQ, type CoreTool as aR, type InternalCoreTool as aS, type StepFlowEntry as aT, type SerializedStep as aU, type SerializedStepFlowEntry as aV, createStep as aW, cloneStep as aX, createWorkflow as aY, cloneWorkflow as aZ, type WorkflowResult as a_, type AgentConfig as aa, MastraMemory as ab, type ToolExecutionContext as ac, Tool as ad, type Step as ae, Workflow as af, type WorkflowConfig as ag, type LanguageModel as ah, type CoreMessage as ai, type CoreSystemMessage as aj, type CoreAssistantMessage as ak, type CoreUserMessage as al, type CoreToolMessage as am, type EmbedResult as an, type EmbedManyResult as ao, type BaseStructuredOutputType as ap, type StructuredOutputType as aq, type StructuredOutputArrayItem as ar, type StructuredOutput as as, type GenerateReturn as at, type StreamReturn as au, type OutputType as av, type DefaultLLMTextOptions as aw, type DefaultLLMTextObjectOptions as ax, type DefaultLLMStreamOptions as ay, type DefaultLLMStreamObjectOptions as az, type MastraAuthConfig as b, type ExecutionGraph as b0, ExecutionEngine as b1, type ExecuteFunction as b2, type StepSuccess as b3, type StepFailure as b4, type StepSuspended as b5, type StepRunning as b6, type StepResult as b7, type StepsRecord as b8, type DynamicMapping as b9, type NamedArgumentInfo as bA, type SubcommandInfo as bB, type CommandInfo as bC, type EnvironmentVariableInfo as bD, type PackageInfo as bE, type RemoteInfo as bF, type MCPServerConfig as bG, type ServerInfo as bH, type ServerDetailInfo as bI, type MCPToolType as bJ, MessageList as bK, type ToolsetsInput as bL, type DynamicArgument as bM, type AgentGenerateOptions as bN, type AgentStreamOptions as bO, type MastraMessageContentV2 as bP, type PathsToStringProps as ba, type ExtractSchemaType as bb, type ExtractSchemaFromStep as bc, type VariableReference as bd, type WatchEvent as be, type ZodPathType as bf, type WorkflowRunState as bg, type MastraLanguageModel as bh, type MastraPrimitives as bi, AgentNetwork as bj, MCPServerBase as bk, type VoiceEventType as bl, type VoiceEventMap as bm, type VoiceConfig as bn, MastraVoice as bo, CompositeVoice as bp, DefaultVoice as bq, type AgentNetworkConfig as br, type ConvertedTool as bs, type MCPServerSSEOptions as bt, type MCPServerHonoSSEOptions as bu, type MCPServerHTTPOptions as bv, type Repository as bw, type VersionDetail as bx, type ArgumentInfo as by, type PositionalArgumentInfo as bz, MastraStorage as c, type StorageThreadType as d, type MastraMessageV2 as e, type StorageGetMessagesArg as f, type WorkflowRun as g, type LegacyWorkflowRun as h, TABLE_WORKFLOW_SNAPSHOT as i, TABLE_EVALS as j, TABLE_MESSAGES as k, TABLE_THREADS as l, TABLE_TRACES as m, TABLE_SCHEMAS as n, type StepResult$1 as o, LegacyStep as p, LegacyWorkflow as q, Agent as r, type WorkflowContext as s, type ToolsInput as t, type StepAction as u, type LegacyWorkflowRunResult as v, type WorkflowOptions as w, type StepExecutionContext as x, type StepVariableType as y, type StepNode as z };
3405
+ export { type WorkflowActionParams as $, type ApiRoute as A, type StepNode as B, type ContextWithMastra as C, type StepGraph as D, type EvalRow as E, type BaseCondition as F, type ActionContext as G, WhenConditionReturnValue as H, type StepDef as I, type StepCondition as J, type StepConfig as K, type LegacyWorkflowRuns as L, type Methods as M, type StepsRecord$1 as N, type WorkflowLogMessage as O, type WorkflowEvent as P, type ResolverFunctionInput as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type ResolverFunctionOutput as U, type VariableReference$1 as V, type WorkflowRuns as W, type SubscriberFunctionOutput as X, type DependencyCheckOutput as Y, type StepResolverOutput as Z, type WorkflowActors as _, Mastra as a, Run as a$, type WorkflowActions as a0, type LegacyWorkflowState as a1, type StepId as a2, type ExtractSchemaFromStep$1 as a3, type ExtractStepResult as a4, type StepInputType as a5, type ExtractSchemaType$1 as a6, type PathsToStringProps$1 as a7, type LegacyWorkflowRunState as a8, type WorkflowResumeResult as a9, type DefaultLLMStreamObjectOptions as aA, type LLMTextOptions as aB, type LLMTextObjectOptions as aC, type LLMStreamOptions as aD, type LLMInnerStreamOptions as aE, type LLMStreamObjectOptions as aF, createMockModel as aG, type Config as aH, type MessageType as aI, type MessageResponse as aJ, type MemoryConfig as aK, type SharedMemoryConfig as aL, type MemoryProcessorOpts as aM, MemoryProcessor as aN, memoryDefaultOptions as aO, createTool as aP, type VercelTool as aQ, type CoreTool as aR, type InternalCoreTool as aS, type StepFlowEntry as aT, type SerializedStep as aU, type SerializedStepFlowEntry as aV, createStep as aW, cloneStep as aX, createWorkflow as aY, cloneWorkflow as aZ, type WorkflowResult as a_, type ToolAction as aa, type AgentConfig as ab, MastraMemory as ac, type ToolExecutionContext as ad, Tool as ae, type Step as af, Workflow as ag, type WorkflowConfig as ah, type LanguageModel as ai, type CoreMessage as aj, type CoreSystemMessage as ak, type CoreAssistantMessage as al, type CoreUserMessage as am, type CoreToolMessage as an, type EmbedResult as ao, type EmbedManyResult as ap, type BaseStructuredOutputType as aq, type StructuredOutputType as ar, type StructuredOutputArrayItem as as, type StructuredOutput as at, type GenerateReturn as au, type StreamReturn as av, type OutputType as aw, type DefaultLLMTextOptions as ax, type DefaultLLMTextObjectOptions as ay, type DefaultLLMStreamOptions as az, type MastraAuthConfig as b, type ExecutionGraph as b0, ExecutionEngine as b1, type ExecuteFunction as b2, type StepSuccess as b3, type StepFailure as b4, type StepSuspended as b5, type StepRunning as b6, type StepResult as b7, type StepsRecord as b8, type DynamicMapping as b9, type NamedArgumentInfo as bA, type SubcommandInfo as bB, type CommandInfo as bC, type EnvironmentVariableInfo as bD, type PackageInfo as bE, type RemoteInfo as bF, type MCPServerConfig as bG, type ServerInfo as bH, type ServerDetailInfo as bI, type MCPToolType as bJ, MessageList as bK, type ToolsetsInput as bL, type DynamicArgument as bM, type AgentGenerateOptions as bN, type AgentStreamOptions as bO, type MastraMessageContentV2 as bP, type PathsToStringProps as ba, type ExtractSchemaType as bb, type ExtractSchemaFromStep as bc, type VariableReference as bd, type WatchEvent as be, type ZodPathType as bf, type WorkflowRunState as bg, type MastraLanguageModel as bh, type MastraPrimitives as bi, AgentNetwork as bj, MCPServerBase as bk, type VoiceEventType as bl, type VoiceEventMap as bm, type VoiceConfig as bn, MastraVoice as bo, CompositeVoice as bp, DefaultVoice as bq, type AgentNetworkConfig as br, type ConvertedTool as bs, type MCPServerSSEOptions as bt, type MCPServerHonoSSEOptions as bu, type MCPServerHTTPOptions as bv, type Repository as bw, type VersionDetail as bx, type ArgumentInfo as by, type PositionalArgumentInfo as bz, MastraStorage as c, type StorageThreadType as d, type MastraMessageV2 as e, type StorageGetMessagesArg as f, type MastraMessageV1 as g, type WorkflowRun as h, type LegacyWorkflowRun as i, TABLE_WORKFLOW_SNAPSHOT as j, TABLE_EVALS as k, TABLE_MESSAGES as l, TABLE_THREADS as m, TABLE_TRACES as n, TABLE_SCHEMAS as o, type StepResult$1 as p, LegacyStep as q, LegacyWorkflow as r, Agent as s, type WorkflowContext as t, type ToolsInput as u, type StepAction as v, type LegacyWorkflowRunResult as w, type WorkflowOptions as x, type StepExecutionContext as y, type StepVariableType as z };
@@ -1167,6 +1167,7 @@ interface WorkflowRunState {
1167
1167
  context: {
1168
1168
  input?: Record<string, any>;
1169
1169
  } & Record<string, StepResult<any, any, any, any>>;
1170
+ serializedStepGraph: SerializedStepFlowEntry[];
1170
1171
  activePaths: Array<unknown>;
1171
1172
  suspendedPaths: Record<string, number[]>;
1172
1173
  timestamp: number;
@@ -1199,6 +1200,7 @@ declare abstract class ExecutionEngine extends MastraBase {
1199
1200
  workflowId: string;
1200
1201
  runId: string;
1201
1202
  graph: ExecutionGraph;
1203
+ serializedStepGraph: SerializedStepFlowEntry[];
1202
1204
  input?: TInput;
1203
1205
  resume?: {
1204
1206
  steps: string[];
@@ -1473,6 +1475,10 @@ declare class Run<TSteps extends Step<string, any, any>[] = Step<string, any, an
1473
1475
  * The execution graph for this run
1474
1476
  */
1475
1477
  executionGraph: ExecutionGraph;
1478
+ /**
1479
+ * The serialized step graph for this run
1480
+ */
1481
+ serializedStepGraph: SerializedStepFlowEntry[];
1476
1482
  protected cleanup?: () => void;
1477
1483
  protected retryConfig?: {
1478
1484
  attempts?: number;
@@ -1489,6 +1495,7 @@ declare class Run<TSteps extends Step<string, any, any>[] = Step<string, any, an
1489
1495
  delay?: number;
1490
1496
  };
1491
1497
  cleanup?: () => void;
1498
+ serializedStepGraph: SerializedStepFlowEntry[];
1492
1499
  });
1493
1500
  /**
1494
1501
  * Starts the workflow execution with the provided input
@@ -1599,16 +1606,17 @@ type MastraMessageV1 = {
1599
1606
  content: string | UserContent | AssistantContent | ToolContent;
1600
1607
  role: 'system' | 'user' | 'assistant' | 'tool';
1601
1608
  createdAt: Date;
1602
- threadId: string;
1603
- resourceId: string;
1609
+ threadId?: string;
1610
+ resourceId?: string;
1604
1611
  toolCallIds?: string[];
1605
1612
  toolCallArgs?: Record<string, unknown>[];
1606
1613
  toolNames?: string[];
1607
1614
  type: 'text' | 'tool-call' | 'tool-result';
1608
1615
  };
1609
- type MessageType = MastraMessageV2 & {
1610
- threadId: string;
1611
- };
1616
+ /**
1617
+ * @deprecated use MastraMessageV1 or MastraMessageV2
1618
+ */
1619
+ type MessageType = MastraMessageV1;
1612
1620
  type StorageThreadType = {
1613
1621
  id: string;
1614
1622
  title?: string;
@@ -1674,8 +1682,8 @@ declare class MessageList {
1674
1682
  private taggedSystemMessages;
1675
1683
  private memoryInfo;
1676
1684
  private memoryMessages;
1677
- private newMessages;
1678
- private responseMessages;
1685
+ private newUserMessages;
1686
+ private newResponseMessages;
1679
1687
  private generateMessageId?;
1680
1688
  constructor({ threadId, resourceId, generateMessageId, }?: {
1681
1689
  threadId?: string;
@@ -1686,26 +1694,26 @@ declare class MessageList {
1686
1694
  getLatestUserContent(): string | null;
1687
1695
  get get(): {
1688
1696
  all: {
1689
- mastra: () => MastraMessageV2[];
1697
+ v2: () => MastraMessageV2[];
1690
1698
  v1: () => MastraMessageV1[];
1691
1699
  ui: () => UIMessage[];
1692
1700
  core: () => CoreMessage$1[];
1693
1701
  prompt: () => CoreMessage$1[];
1694
1702
  };
1695
1703
  remembered: {
1696
- mastra: () => MastraMessageV2[];
1704
+ v2: () => MastraMessageV2[];
1697
1705
  v1: () => MastraMessageV1[];
1698
1706
  ui: () => UIMessage[];
1699
1707
  core: () => CoreMessage$1[];
1700
1708
  };
1701
1709
  input: {
1702
- mastra: () => MastraMessageV2[];
1710
+ v2: () => MastraMessageV2[];
1703
1711
  v1: () => MastraMessageV1[];
1704
1712
  ui: () => UIMessage[];
1705
1713
  core: () => CoreMessage$1[];
1706
1714
  };
1707
1715
  response: {
1708
- mastra: () => MastraMessageV2[];
1716
+ v2: () => MastraMessageV2[];
1709
1717
  };
1710
1718
  };
1711
1719
  private all;
@@ -1855,17 +1863,28 @@ declare abstract class MastraMemory extends MastraBase {
1855
1863
  * @param messages - Array of messages to save
1856
1864
  * @returns Promise resolving to the saved messages
1857
1865
  */
1858
- abstract saveMessages({ messages, memoryConfig, }: {
1859
- messages: (MastraMessageV1 | MastraMessageV2)[];
1860
- memoryConfig: MemoryConfig | undefined;
1866
+ abstract saveMessages(args: {
1867
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1868
+ memoryConfig?: MemoryConfig | undefined;
1869
+ format?: 'v1';
1870
+ }): Promise<MastraMessageV1[]>;
1871
+ abstract saveMessages(args: {
1872
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1873
+ memoryConfig?: MemoryConfig | undefined;
1874
+ format: 'v2';
1861
1875
  }): Promise<MastraMessageV2[]>;
1876
+ abstract saveMessages(args: {
1877
+ messages: (MastraMessageV1 | MastraMessageV2)[] | MastraMessageV1[] | MastraMessageV2[];
1878
+ memoryConfig?: MemoryConfig | undefined;
1879
+ format?: 'v1' | 'v2';
1880
+ }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
1862
1881
  /**
1863
1882
  * Retrieves all messages for a specific thread
1864
1883
  * @param threadId - The unique identifier of the thread
1865
1884
  * @returns Promise resolving to array of messages and uiMessages
1866
1885
  */
1867
1886
  abstract query({ threadId, resourceId, selectBy, }: StorageGetMessagesArg): Promise<{
1868
- messages: MastraMessageV1[];
1887
+ messages: CoreMessage$1[];
1869
1888
  uiMessages: UIMessage[];
1870
1889
  }>;
1871
1890
  /**
@@ -3324,10 +3343,30 @@ declare abstract class MastraStorage extends MastraBase {
3324
3343
  abstract deleteThread({ threadId }: {
3325
3344
  threadId: string;
3326
3345
  }): Promise<void>;
3327
- abstract getMessages({ threadId, selectBy, threadConfig }: StorageGetMessagesArg): Promise<MastraMessageV2[]>;
3328
- abstract saveMessages({ messages }: {
3329
- messages: (MastraMessageV1 | MastraMessageV2)[];
3346
+ abstract getMessages(args: StorageGetMessagesArg & {
3347
+ format?: 'v1';
3348
+ }): Promise<MastraMessageV1[]>;
3349
+ abstract getMessages(args: StorageGetMessagesArg & {
3350
+ format: 'v2';
3330
3351
  }): Promise<MastraMessageV2[]>;
3352
+ abstract getMessages({ threadId, resourceId, selectBy, format, }: StorageGetMessagesArg & {
3353
+ format?: 'v1' | 'v2';
3354
+ }): Promise<MastraMessageV1[] | MastraMessageV2[]>;
3355
+ abstract saveMessages(args: {
3356
+ messages: MastraMessageV1[];
3357
+ format?: undefined | 'v1';
3358
+ }): Promise<MastraMessageV1[]>;
3359
+ abstract saveMessages(args: {
3360
+ messages: MastraMessageV2[];
3361
+ format: 'v2';
3362
+ }): Promise<MastraMessageV2[]>;
3363
+ abstract saveMessages(args: {
3364
+ messages: MastraMessageV1[];
3365
+ format?: undefined | 'v1';
3366
+ } | {
3367
+ messages: MastraMessageV2[];
3368
+ format: 'v2';
3369
+ }): Promise<MastraMessageV2[] | MastraMessageV1[]>;
3331
3370
  abstract getTraces({ name, scope, page, perPage, attributes, filters, }: {
3332
3371
  name?: string;
3333
3372
  scope?: string;
@@ -3363,4 +3402,4 @@ declare abstract class MastraStorage extends MastraBase {
3363
3402
  }): Promise<WorkflowRun | null>;
3364
3403
  }
3365
3404
 
3366
- export { type WorkflowActions as $, type ApiRoute as A, type StepGraph as B, type ContextWithMastra as C, type BaseCondition as D, type EvalRow as E, type ActionContext as F, WhenConditionReturnValue as G, type StepDef as H, type StepCondition as I, type StepConfig as J, type StepsRecord$1 as K, type LegacyWorkflowRuns as L, type Methods as M, type WorkflowLogMessage as N, type WorkflowEvent as O, type ResolverFunctionInput as P, type ResolverFunctionOutput as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type SubscriberFunctionOutput as U, type VariableReference$1 as V, type WorkflowRuns as W, type DependencyCheckOutput as X, type StepResolverOutput as Y, type WorkflowActors as Z, type WorkflowActionParams as _, Mastra as a, Run as a$, type LegacyWorkflowState as a0, type StepId as a1, type ExtractSchemaFromStep$1 as a2, type ExtractStepResult as a3, type StepInputType as a4, type ExtractSchemaType$1 as a5, type PathsToStringProps$1 as a6, type LegacyWorkflowRunState as a7, type WorkflowResumeResult as a8, type ToolAction as a9, type LLMTextOptions as aA, type LLMTextObjectOptions as aB, type LLMStreamOptions as aC, type LLMInnerStreamOptions as aD, type LLMStreamObjectOptions as aE, createMockModel as aF, type Config as aG, type MastraMessageV1 as aH, type MessageType as aI, type MessageResponse as aJ, type MemoryConfig as aK, type SharedMemoryConfig as aL, type MemoryProcessorOpts as aM, MemoryProcessor as aN, memoryDefaultOptions as aO, createTool as aP, type VercelTool as aQ, type CoreTool as aR, type InternalCoreTool as aS, type StepFlowEntry as aT, type SerializedStep as aU, type SerializedStepFlowEntry as aV, createStep as aW, cloneStep as aX, createWorkflow as aY, cloneWorkflow as aZ, type WorkflowResult as a_, type AgentConfig as aa, MastraMemory as ab, type ToolExecutionContext as ac, Tool as ad, type Step as ae, Workflow as af, type WorkflowConfig as ag, type LanguageModel as ah, type CoreMessage as ai, type CoreSystemMessage as aj, type CoreAssistantMessage as ak, type CoreUserMessage as al, type CoreToolMessage as am, type EmbedResult as an, type EmbedManyResult as ao, type BaseStructuredOutputType as ap, type StructuredOutputType as aq, type StructuredOutputArrayItem as ar, type StructuredOutput as as, type GenerateReturn as at, type StreamReturn as au, type OutputType as av, type DefaultLLMTextOptions as aw, type DefaultLLMTextObjectOptions as ax, type DefaultLLMStreamOptions as ay, type DefaultLLMStreamObjectOptions as az, type MastraAuthConfig as b, type ExecutionGraph as b0, ExecutionEngine as b1, type ExecuteFunction as b2, type StepSuccess as b3, type StepFailure as b4, type StepSuspended as b5, type StepRunning as b6, type StepResult as b7, type StepsRecord as b8, type DynamicMapping as b9, type NamedArgumentInfo as bA, type SubcommandInfo as bB, type CommandInfo as bC, type EnvironmentVariableInfo as bD, type PackageInfo as bE, type RemoteInfo as bF, type MCPServerConfig as bG, type ServerInfo as bH, type ServerDetailInfo as bI, type MCPToolType as bJ, MessageList as bK, type ToolsetsInput as bL, type DynamicArgument as bM, type AgentGenerateOptions as bN, type AgentStreamOptions as bO, type MastraMessageContentV2 as bP, type PathsToStringProps as ba, type ExtractSchemaType as bb, type ExtractSchemaFromStep as bc, type VariableReference as bd, type WatchEvent as be, type ZodPathType as bf, type WorkflowRunState as bg, type MastraLanguageModel as bh, type MastraPrimitives as bi, AgentNetwork as bj, MCPServerBase as bk, type VoiceEventType as bl, type VoiceEventMap as bm, type VoiceConfig as bn, MastraVoice as bo, CompositeVoice as bp, DefaultVoice as bq, type AgentNetworkConfig as br, type ConvertedTool as bs, type MCPServerSSEOptions as bt, type MCPServerHonoSSEOptions as bu, type MCPServerHTTPOptions as bv, type Repository as bw, type VersionDetail as bx, type ArgumentInfo as by, type PositionalArgumentInfo as bz, MastraStorage as c, type StorageThreadType as d, type MastraMessageV2 as e, type StorageGetMessagesArg as f, type WorkflowRun as g, type LegacyWorkflowRun as h, TABLE_WORKFLOW_SNAPSHOT as i, TABLE_EVALS as j, TABLE_MESSAGES as k, TABLE_THREADS as l, TABLE_TRACES as m, TABLE_SCHEMAS as n, type StepResult$1 as o, LegacyStep as p, LegacyWorkflow as q, Agent as r, type WorkflowContext as s, type ToolsInput as t, type StepAction as u, type LegacyWorkflowRunResult as v, type WorkflowOptions as w, type StepExecutionContext as x, type StepVariableType as y, type StepNode as z };
3405
+ export { type WorkflowActionParams as $, type ApiRoute as A, type StepNode as B, type ContextWithMastra as C, type StepGraph as D, type EvalRow as E, type BaseCondition as F, type ActionContext as G, WhenConditionReturnValue as H, type StepDef as I, type StepCondition as J, type StepConfig as K, type LegacyWorkflowRuns as L, type Methods as M, type StepsRecord$1 as N, type WorkflowLogMessage as O, type WorkflowEvent as P, type ResolverFunctionInput as Q, type RetryConfig as R, type StorageColumn as S, type TABLE_NAMES as T, type ResolverFunctionOutput as U, type VariableReference$1 as V, type WorkflowRuns as W, type SubscriberFunctionOutput as X, type DependencyCheckOutput as Y, type StepResolverOutput as Z, type WorkflowActors as _, Mastra as a, Run as a$, type WorkflowActions as a0, type LegacyWorkflowState as a1, type StepId as a2, type ExtractSchemaFromStep$1 as a3, type ExtractStepResult as a4, type StepInputType as a5, type ExtractSchemaType$1 as a6, type PathsToStringProps$1 as a7, type LegacyWorkflowRunState as a8, type WorkflowResumeResult as a9, type DefaultLLMStreamObjectOptions as aA, type LLMTextOptions as aB, type LLMTextObjectOptions as aC, type LLMStreamOptions as aD, type LLMInnerStreamOptions as aE, type LLMStreamObjectOptions as aF, createMockModel as aG, type Config as aH, type MessageType as aI, type MessageResponse as aJ, type MemoryConfig as aK, type SharedMemoryConfig as aL, type MemoryProcessorOpts as aM, MemoryProcessor as aN, memoryDefaultOptions as aO, createTool as aP, type VercelTool as aQ, type CoreTool as aR, type InternalCoreTool as aS, type StepFlowEntry as aT, type SerializedStep as aU, type SerializedStepFlowEntry as aV, createStep as aW, cloneStep as aX, createWorkflow as aY, cloneWorkflow as aZ, type WorkflowResult as a_, type ToolAction as aa, type AgentConfig as ab, MastraMemory as ac, type ToolExecutionContext as ad, Tool as ae, type Step as af, Workflow as ag, type WorkflowConfig as ah, type LanguageModel as ai, type CoreMessage as aj, type CoreSystemMessage as ak, type CoreAssistantMessage as al, type CoreUserMessage as am, type CoreToolMessage as an, type EmbedResult as ao, type EmbedManyResult as ap, type BaseStructuredOutputType as aq, type StructuredOutputType as ar, type StructuredOutputArrayItem as as, type StructuredOutput as at, type GenerateReturn as au, type StreamReturn as av, type OutputType as aw, type DefaultLLMTextOptions as ax, type DefaultLLMTextObjectOptions as ay, type DefaultLLMStreamOptions as az, type MastraAuthConfig as b, type ExecutionGraph as b0, ExecutionEngine as b1, type ExecuteFunction as b2, type StepSuccess as b3, type StepFailure as b4, type StepSuspended as b5, type StepRunning as b6, type StepResult as b7, type StepsRecord as b8, type DynamicMapping as b9, type NamedArgumentInfo as bA, type SubcommandInfo as bB, type CommandInfo as bC, type EnvironmentVariableInfo as bD, type PackageInfo as bE, type RemoteInfo as bF, type MCPServerConfig as bG, type ServerInfo as bH, type ServerDetailInfo as bI, type MCPToolType as bJ, MessageList as bK, type ToolsetsInput as bL, type DynamicArgument as bM, type AgentGenerateOptions as bN, type AgentStreamOptions as bO, type MastraMessageContentV2 as bP, type PathsToStringProps as ba, type ExtractSchemaType as bb, type ExtractSchemaFromStep as bc, type VariableReference as bd, type WatchEvent as be, type ZodPathType as bf, type WorkflowRunState as bg, type MastraLanguageModel as bh, type MastraPrimitives as bi, AgentNetwork as bj, MCPServerBase as bk, type VoiceEventType as bl, type VoiceEventMap as bm, type VoiceConfig as bn, MastraVoice as bo, CompositeVoice as bp, DefaultVoice as bq, type AgentNetworkConfig as br, type ConvertedTool as bs, type MCPServerSSEOptions as bt, type MCPServerHonoSSEOptions as bu, type MCPServerHTTPOptions as bv, type Repository as bw, type VersionDetail as bx, type ArgumentInfo as by, type PositionalArgumentInfo as bz, MastraStorage as c, type StorageThreadType as d, type MastraMessageV2 as e, type StorageGetMessagesArg as f, type MastraMessageV1 as g, type WorkflowRun as h, type LegacyWorkflowRun as i, TABLE_WORKFLOW_SNAPSHOT as j, TABLE_EVALS as k, TABLE_MESSAGES as l, TABLE_THREADS as m, TABLE_TRACES as n, TABLE_SCHEMAS as o, type StepResult$1 as p, LegacyStep as q, LegacyWorkflow as r, Agent as s, type WorkflowContext as t, type ToolsInput as u, type StepAction as v, type LegacyWorkflowRunResult as w, type WorkflowOptions as x, type StepExecutionContext as y, type StepVariableType as z };
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-MZDYQ3I7.js';
1
+ import { Agent } from './chunk-WCGRF63O.js';
2
2
  import { CohereClient } from 'cohere-ai';
3
3
 
4
4
  var CohereRelevanceScorer = class {
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkUVRGQEMD_cjs = require('./chunk-UVRGQEMD.cjs');
3
+ var chunkTICDQWVJ_cjs = require('./chunk-TICDQWVJ.cjs');
4
4
  var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
5
5
  var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
6
6
 
7
7
  // src/tts/index.ts
8
8
  var _MastraTTS_decorators, _init, _a;
9
- _MastraTTS_decorators = [chunkUVRGQEMD_cjs.InstrumentClass({
9
+ _MastraTTS_decorators = [chunkTICDQWVJ_cjs.InstrumentClass({
10
10
  prefix: "tts",
11
11
  excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
12
12
  })];
@@ -1,5 +1,5 @@
1
1
  import { EMITTER_SYMBOL } from './chunk-Y7D2JLKS.js';
2
- import { Agent } from './chunk-MZDYQ3I7.js';
2
+ import { Agent } from './chunk-WCGRF63O.js';
3
3
  import { Tool } from './chunk-EQTIDVPN.js';
4
4
  import { MastraBase } from './chunk-FI7R232B.js';
5
5
  import { RegisteredLogger } from './chunk-VHLL4AZK.js';
@@ -110,6 +110,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
110
110
  workflowId,
111
111
  runId,
112
112
  entry,
113
+ serializedStepGraph: params.serializedStepGraph,
113
114
  prevStep: steps[i - 1],
114
115
  stepResults,
115
116
  resume,
@@ -334,6 +335,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
334
335
  runId,
335
336
  entry,
336
337
  prevStep,
338
+ serializedStepGraph,
337
339
  stepResults,
338
340
  resume,
339
341
  executionContext,
@@ -349,6 +351,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
349
351
  entry: step,
350
352
  prevStep,
351
353
  stepResults,
354
+ serializedStepGraph,
352
355
  resume,
353
356
  executionContext: {
354
357
  workflowId,
@@ -388,6 +391,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
388
391
  entry,
389
392
  prevOutput,
390
393
  prevStep,
394
+ serializedStepGraph,
391
395
  stepResults,
392
396
  resume,
393
397
  executionContext,
@@ -435,6 +439,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
435
439
  entry: step,
436
440
  prevStep,
437
441
  stepResults,
442
+ serializedStepGraph,
438
443
  resume,
439
444
  executionContext: {
440
445
  workflowId,
@@ -573,6 +578,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
573
578
  workflowId,
574
579
  runId,
575
580
  stepResults,
581
+ serializedStepGraph,
576
582
  executionContext
577
583
  }) {
578
584
  await this.mastra?.getStorage()?.persistWorkflowSnapshot({
@@ -583,6 +589,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
583
589
  value: {},
584
590
  context: stepResults,
585
591
  activePaths: [],
592
+ serializedStepGraph,
586
593
  suspendedPaths: executionContext.suspendedPaths,
587
594
  // @ts-ignore
588
595
  timestamp: Date.now()
@@ -594,6 +601,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
594
601
  runId,
595
602
  entry,
596
603
  prevStep,
604
+ serializedStepGraph,
597
605
  stepResults,
598
606
  resume,
599
607
  executionContext,
@@ -622,6 +630,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
622
630
  runId,
623
631
  entry: entry.steps[idx],
624
632
  prevStep,
633
+ serializedStepGraph,
625
634
  stepResults,
626
635
  resume,
627
636
  executionContext: {
@@ -642,6 +651,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
642
651
  entry,
643
652
  prevStep,
644
653
  stepResults,
654
+ serializedStepGraph,
645
655
  resume,
646
656
  executionContext,
647
657
  emitter,
@@ -655,6 +665,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
655
665
  prevStep,
656
666
  prevOutput,
657
667
  stepResults,
668
+ serializedStepGraph,
658
669
  resume,
659
670
  executionContext,
660
671
  emitter,
@@ -693,6 +704,7 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
693
704
  await this.persistStepUpdate({
694
705
  workflowId,
695
706
  runId,
707
+ serializedStepGraph,
696
708
  stepResults,
697
709
  executionContext
698
710
  });
@@ -1145,6 +1157,7 @@ var Workflow = class extends MastraBase {
1145
1157
  executionGraph: this.executionGraph,
1146
1158
  mastra: this.#mastra,
1147
1159
  retryConfig: this.retryConfig,
1160
+ serializedStepGraph: this.serializedStepGraph,
1148
1161
  cleanup: () => this.#runs.delete(runIdToUse)
1149
1162
  });
1150
1163
  this.#runs.set(runIdToUse, run);
@@ -1224,6 +1237,10 @@ var Run = class {
1224
1237
  * The execution graph for this run
1225
1238
  */
1226
1239
  executionGraph;
1240
+ /**
1241
+ * The serialized step graph for this run
1242
+ */
1243
+ serializedStepGraph;
1227
1244
  /**
1228
1245
  * The storage for this run
1229
1246
  */
@@ -1235,6 +1252,7 @@ var Run = class {
1235
1252
  constructor(params) {
1236
1253
  this.workflowId = params.workflowId;
1237
1254
  this.runId = params.runId;
1255
+ this.serializedStepGraph = params.serializedStepGraph;
1238
1256
  this.executionEngine = params.executionEngine;
1239
1257
  this.executionGraph = params.executionGraph;
1240
1258
  this.#mastra = params.mastra;
@@ -1255,6 +1273,7 @@ var Run = class {
1255
1273
  workflowId: this.workflowId,
1256
1274
  runId: this.runId,
1257
1275
  graph: this.executionGraph,
1276
+ serializedStepGraph: this.serializedStepGraph,
1258
1277
  input: inputData,
1259
1278
  emitter: {
1260
1279
  emit: async (event, data) => {
@@ -1367,6 +1386,7 @@ var Run = class {
1367
1386
  workflowId: this.workflowId,
1368
1387
  runId: this.runId,
1369
1388
  graph: this.executionGraph,
1389
+ serializedStepGraph: this.serializedStepGraph,
1370
1390
  input: params.resumeData,
1371
1391
  resume: {
1372
1392
  steps,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkLXFZUKP3_cjs = require('./chunk-LXFZUKP3.cjs');
4
- var chunkXAO67QBR_cjs = require('./chunk-XAO67QBR.cjs');
4
+ var chunkOB2PB6SX_cjs = require('./chunk-OB2PB6SX.cjs');
5
5
  var chunkDXLVS7ML_cjs = require('./chunk-DXLVS7ML.cjs');
6
6
  var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
7
7
 
@@ -221,7 +221,7 @@ https://mastra.ai/en/docs/memory/overview`
221
221
  toolCallIds
222
222
  };
223
223
  const savedMessages = await this.saveMessages({ messages: [message], memoryConfig: config });
224
- const list = new chunkXAO67QBR_cjs.MessageList({ threadId, resourceId }).add(savedMessages[0], "memory");
224
+ const list = new chunkOB2PB6SX_cjs.MessageList({ threadId, resourceId }).add(savedMessages[0], "memory");
225
225
  return list.get.all.v1()[0];
226
226
  }
227
227
  /**
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkBYMMP6QW_cjs = require('./chunk-BYMMP6QW.cjs');
3
+ var chunkEZDS6FFZ_cjs = require('./chunk-EZDS6FFZ.cjs');
4
4
  var cohereAi = require('cohere-ai');
5
5
 
6
6
  var CohereRelevanceScorer = class {
@@ -38,7 +38,7 @@ Relevance score (0-1):`;
38
38
  var MastraAgentRelevanceScorer = class {
39
39
  agent;
40
40
  constructor(name, model) {
41
- this.agent = new chunkBYMMP6QW_cjs.Agent({
41
+ this.agent = new chunkEZDS6FFZ_cjs.Agent({
42
42
  name: `Relevance Scorer ${name}`,
43
43
  instructions: `You are a specialized agent for evaluating the relevance of text to queries.
44
44
  Your task is to rate how well a text passage answers a given query.
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var chunkUVRGQEMD_cjs = require('./chunk-UVRGQEMD.cjs');
3
+ var chunkTICDQWVJ_cjs = require('./chunk-TICDQWVJ.cjs');
4
4
  var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
5
5
  var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
6
6
 
7
7
  // src/voice/voice.ts
8
8
  var _MastraVoice_decorators, _init, _a;
9
- _MastraVoice_decorators = [chunkUVRGQEMD_cjs.InstrumentClass({
9
+ _MastraVoice_decorators = [chunkTICDQWVJ_cjs.InstrumentClass({
10
10
  prefix: "voice",
11
11
  excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
12
12
  })];