@mastra/core 0.9.1-alpha.3 → 0.9.1-alpha.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 (97) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.d.cts +1 -1
  3. package/dist/agent/index.d.ts +1 -1
  4. package/dist/agent/index.js +1 -1
  5. package/dist/{base-CuXWXbrh.d.ts → base-BS0LLAna.d.ts} +69 -46
  6. package/dist/{base-mr-hn8v_.d.cts → base-QJ_GwQxQ.d.cts} +69 -46
  7. package/dist/{chunk-V7IE36YV.cjs → chunk-33XQ5DGU.cjs} +9 -9
  8. package/dist/{chunk-KWV5ZLOF.js → chunk-52SRR7WR.js} +1 -1
  9. package/dist/{chunk-TNILINST.cjs → chunk-6KB5CPBV.cjs} +1 -0
  10. package/dist/{chunk-ZRMY72JX.js → chunk-7IAP7VPO.js} +1 -1
  11. package/dist/{chunk-YTTBFAQJ.cjs → chunk-7JRVDC7F.cjs} +4 -1
  12. package/dist/{chunk-422BXQRT.cjs → chunk-7PRLYMXV.cjs} +242 -101
  13. package/dist/{chunk-SGTFVHOZ.js → chunk-7ZR64JAJ.js} +1 -1
  14. package/dist/{chunk-7AGAXO6B.cjs → chunk-CFWUR4PX.cjs} +16 -61
  15. package/dist/{chunk-PS2ZF6MA.js → chunk-FA7FWCKH.js} +1 -1
  16. package/dist/{chunk-4K4DHXRF.js → chunk-H2UWWO4L.js} +234 -93
  17. package/dist/{chunk-6AHC67YY.js → chunk-J7WRPNIY.js} +2 -2
  18. package/dist/{chunk-34622N67.js → chunk-JSUPD5IG.js} +4 -1
  19. package/dist/{chunk-YZFNMXY4.cjs → chunk-KF5VBC5P.cjs} +6 -6
  20. package/dist/{chunk-HFOT2NFM.js → chunk-KWYJUFY3.js} +1 -1
  21. package/dist/{chunk-BU45BMXY.js → chunk-KYULILA6.js} +2 -2
  22. package/dist/{chunk-U5DGGGS2.cjs → chunk-MAWT75XY.cjs} +2 -2
  23. package/dist/{chunk-RIBNDTA6.cjs → chunk-MYHX5XVW.cjs} +2 -2
  24. package/dist/{chunk-FKUPMQZP.cjs → chunk-POEYDVX7.cjs} +2 -2
  25. package/dist/{chunk-MWLZJBPF.js → chunk-Q6Z2YS6I.js} +1 -1
  26. package/dist/{chunk-ANYT6KP7.js → chunk-SEOWDGC2.js} +1 -0
  27. package/dist/{chunk-BFF2O6RO.js → chunk-SHDPMWGJ.js} +1 -1
  28. package/dist/{chunk-FPM2XCMS.cjs → chunk-XNBNJEES.cjs} +19 -19
  29. package/dist/{chunk-VMVXIPGW.js → chunk-YEA2KXXJ.js} +12 -57
  30. package/dist/{chunk-27PAET7X.cjs → chunk-ZKRQS3N5.cjs} +2 -2
  31. package/dist/{chunk-CEXM6WP5.cjs → chunk-ZWALP7T2.cjs} +2 -2
  32. package/dist/{chunk-P6KJ7FZZ.cjs → chunk-ZZRFVSYZ.cjs} +2 -2
  33. package/dist/eval/index.d.cts +1 -1
  34. package/dist/eval/index.d.ts +1 -1
  35. package/dist/index.cjs +62 -62
  36. package/dist/index.d.cts +2 -2
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.js +12 -12
  39. package/dist/integration/index.cjs +3 -3
  40. package/dist/integration/index.d.cts +1 -1
  41. package/dist/integration/index.d.ts +1 -1
  42. package/dist/integration/index.js +1 -1
  43. package/dist/llm/index.d.cts +1 -1
  44. package/dist/llm/index.d.ts +1 -1
  45. package/dist/mastra/index.cjs +2 -2
  46. package/dist/mastra/index.d.cts +1 -1
  47. package/dist/mastra/index.d.ts +1 -1
  48. package/dist/mastra/index.js +1 -1
  49. package/dist/memory/index.cjs +4 -4
  50. package/dist/memory/index.d.cts +1 -1
  51. package/dist/memory/index.d.ts +1 -1
  52. package/dist/memory/index.js +1 -1
  53. package/dist/network/index.cjs +4 -4
  54. package/dist/network/index.d.cts +1 -1
  55. package/dist/network/index.d.ts +1 -1
  56. package/dist/network/index.js +2 -2
  57. package/dist/relevance/index.cjs +4 -4
  58. package/dist/relevance/index.d.cts +1 -1
  59. package/dist/relevance/index.d.ts +1 -1
  60. package/dist/relevance/index.js +1 -1
  61. package/dist/server/index.d.cts +1 -1
  62. package/dist/server/index.d.ts +1 -1
  63. package/dist/storage/index.cjs +9 -9
  64. package/dist/storage/index.d.cts +1 -1
  65. package/dist/storage/index.d.ts +1 -1
  66. package/dist/storage/index.js +2 -2
  67. package/dist/storage/libsql/index.cjs +19 -16
  68. package/dist/storage/libsql/index.d.cts +12 -17
  69. package/dist/storage/libsql/index.d.ts +12 -17
  70. package/dist/storage/libsql/index.js +5 -2
  71. package/dist/telemetry/index.cjs +6 -6
  72. package/dist/telemetry/index.d.cts +1 -1
  73. package/dist/telemetry/index.d.ts +1 -1
  74. package/dist/telemetry/index.js +1 -1
  75. package/dist/tools/index.cjs +4 -4
  76. package/dist/tools/index.d.cts +1 -1
  77. package/dist/tools/index.d.ts +1 -1
  78. package/dist/tools/index.js +1 -1
  79. package/dist/tts/index.cjs +2 -2
  80. package/dist/tts/index.js +1 -1
  81. package/dist/utils.cjs +14 -14
  82. package/dist/utils.d.cts +1 -1
  83. package/dist/utils.d.ts +1 -1
  84. package/dist/utils.js +1 -1
  85. package/dist/voice/index.cjs +4 -4
  86. package/dist/voice/index.d.cts +7 -19
  87. package/dist/voice/index.d.ts +7 -19
  88. package/dist/voice/index.js +1 -1
  89. package/dist/workflows/index.cjs +22 -22
  90. package/dist/workflows/index.d.cts +2 -2
  91. package/dist/workflows/index.d.ts +2 -2
  92. package/dist/workflows/index.js +1 -1
  93. package/dist/workflows/vNext/index.cjs +4 -4
  94. package/dist/workflows/vNext/index.d.cts +2 -2
  95. package/dist/workflows/vNext/index.d.ts +2 -2
  96. package/dist/workflows/vNext/index.js +2 -2
  97. package/package.json +4 -4
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunk422BXQRT_cjs = require('../chunk-422BXQRT.cjs');
3
+ var chunk7PRLYMXV_cjs = require('../chunk-7PRLYMXV.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "Agent", {
8
8
  enumerable: true,
9
- get: function () { return chunk422BXQRT_cjs.Agent; }
9
+ get: function () { return chunk7PRLYMXV_cjs.Agent; }
10
10
  });
@@ -1,7 +1,7 @@
1
1
  export { Message as AiMessageType } from 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { G as Agent, H as AgentConfig, b9 as AgentGenerateOptions, ba as AgentStreamOptions, b3 as MastraLanguageModel, b4 as ToolsInput, b8 as ToolsetsInput } from '../base-mr-hn8v_.cjs';
4
+ export { B as Agent, C as AgentConfig, bb as AgentGenerateOptions, bc as AgentStreamOptions, ba as DynamicArgument, a_ as MastraLanguageModel, a$ as ToolsInput, b9 as ToolsetsInput } from '../base-QJ_GwQxQ.cjs';
5
5
  import '../base-BihKcqDY.cjs';
6
6
  import '../types-BtMyV38I.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 { G as Agent, H as AgentConfig, b9 as AgentGenerateOptions, ba as AgentStreamOptions, b3 as MastraLanguageModel, b4 as ToolsInput, b8 as ToolsetsInput } from '../base-CuXWXbrh.js';
4
+ export { B as Agent, C as AgentConfig, bb as AgentGenerateOptions, bc as AgentStreamOptions, ba as DynamicArgument, a_ as MastraLanguageModel, a$ as ToolsInput, b9 as ToolsetsInput } from '../base-BS0LLAna.js';
5
5
  import '../base-DT2poiVK.js';
6
6
  import '../types-BtMyV38I.js';
7
7
  import '../runtime-context/index.js';
@@ -1 +1 @@
1
- export { Agent } from '../chunk-4K4DHXRF.js';
1
+ export { Agent } from '../chunk-H2UWWO4L.js';
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, TelemetrySettings, generateText, generateObject, streamText, streamObject, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
2
+ import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
3
3
  import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-DT2poiVK.js';
4
4
  import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.js';
5
5
  import { Query } from 'sift';
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
1484
1484
  mastra: Mastra;
1485
1485
  }): Promise<z.infer<TOutput>>;
1486
1486
  getWorkflowRuns(): Promise<WorkflowRuns>;
1487
- getWorkflowRun(runId: string): Promise<{
1488
- workflowName: string;
1489
- runId: string;
1490
- snapshot: WorkflowRunState | string;
1491
- createdAt: Date;
1492
- updatedAt: Date;
1493
- } | Run<TSteps, TInput, TOutput> | undefined>;
1487
+ getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
1494
1488
  }
1495
1489
  /**
1496
1490
  * Represents a workflow run that can be executed
@@ -1802,8 +1796,7 @@ type DefaultLLMTextObjectOptions = Omit<GenerateObjectOptions, MastraCustomLLMOp
1802
1796
  type DefaultLLMStreamOptions = Omit<StreamTextOptions, MastraCustomLLMOptionsKeys>;
1803
1797
  type DefaultLLMStreamObjectOptions = Omit<StreamObjectOptions, MastraCustomLLMOptionsKeys>;
1804
1798
  type MastraCustomLLMOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = {
1805
- tools?: ToolsInput;
1806
- convertedTools?: Record<string, CoreTool>;
1799
+ tools?: Record<string, CoreTool>;
1807
1800
  onStepFinish?: (step: unknown) => void;
1808
1801
  experimental_output?: Z;
1809
1802
  telemetry?: TelemetrySettings;
@@ -2022,22 +2015,34 @@ declare class CompositeVoice extends MastraVoice<unknown, unknown, unknown, Tool
2022
2015
  off<E extends VoiceEventType>(event: E, callback: (data: E extends keyof VoiceEventMap ? VoiceEventMap[E] : unknown) => void): void;
2023
2016
  }
2024
2017
 
2018
+ declare class DefaultVoice extends MastraVoice {
2019
+ constructor();
2020
+ speak(_input: string | NodeJS.ReadableStream): Promise<NodeJS.ReadableStream>;
2021
+ listen(_input: string | NodeJS.ReadableStream): Promise<string>;
2022
+ getSpeakers(): Promise<{
2023
+ voiceId: string;
2024
+ }[]>;
2025
+ }
2026
+
2025
2027
  type ToolsInput = Record<string, ToolAction<any, any, any> | VercelTool>;
2026
2028
  type ToolsetsInput = Record<string, ToolsInput>;
2027
2029
  type MastraLanguageModel = LanguageModelV1;
2030
+ type DynamicArgument<T> = T | (({ runtimeContext }: {
2031
+ runtimeContext: RuntimeContext;
2032
+ }) => Promise<T> | T);
2028
2033
  interface AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>> {
2029
2034
  name: TAgentId;
2030
- instructions: string;
2031
- model: MastraLanguageModel;
2035
+ instructions: DynamicArgument<string>;
2036
+ model: DynamicArgument<MastraLanguageModel>;
2037
+ tools?: DynamicArgument<TTools>;
2032
2038
  defaultGenerateOptions?: AgentGenerateOptions;
2033
2039
  defaultStreamOptions?: AgentStreamOptions;
2034
- tools?: TTools;
2035
2040
  mastra?: Mastra;
2036
- /** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
2037
- metrics?: TMetrics;
2038
2041
  evals?: TMetrics;
2039
2042
  memory?: MastraMemory;
2040
2043
  voice?: CompositeVoice;
2044
+ /** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
2045
+ metrics?: TMetrics;
2041
2046
  }
2042
2047
  /**
2043
2048
  * Options for generating responses with an agent
@@ -2300,17 +2305,42 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2300
2305
  #private;
2301
2306
  id: TAgentId;
2302
2307
  name: TAgentId;
2303
- readonly llm: MastraLLMBase;
2304
- instructions: string;
2305
- readonly model?: MastraLanguageModel;
2306
- tools: TTools;
2308
+ readonly model?: DynamicArgument<MastraLanguageModel>;
2307
2309
  /** @deprecated This property is deprecated. Use evals instead. */
2308
2310
  metrics: TMetrics;
2309
2311
  evals: TMetrics;
2310
- voice: CompositeVoice;
2311
2312
  constructor(config: AgentConfig<TAgentId, TTools, TMetrics>);
2312
2313
  hasOwnMemory(): boolean;
2313
2314
  getMemory(): MastraMemory | undefined;
2315
+ get voice(): CompositeVoice;
2316
+ getVoice({ runtimeContext }?: {
2317
+ runtimeContext?: RuntimeContext;
2318
+ }): Promise<CompositeVoice | DefaultVoice>;
2319
+ get instructions(): string;
2320
+ getInstructions({ runtimeContext }?: {
2321
+ runtimeContext?: RuntimeContext;
2322
+ }): string | Promise<string>;
2323
+ get tools(): TTools;
2324
+ getTools({ runtimeContext }?: {
2325
+ runtimeContext?: RuntimeContext;
2326
+ }): TTools | Promise<TTools>;
2327
+ get llm(): MastraLLMBase | Promise<MastraLLMBase>;
2328
+ /**
2329
+ * Gets or creates an LLM instance based on the current model
2330
+ * @param options Options for getting the LLM
2331
+ * @returns A promise that resolves to the LLM instance
2332
+ */
2333
+ getLLM({ runtimeContext }?: {
2334
+ runtimeContext?: RuntimeContext;
2335
+ }): MastraLLMBase | Promise<MastraLLMBase>;
2336
+ /**
2337
+ * Gets the model, resolving it if it's a function
2338
+ * @param options Options for getting the model
2339
+ * @returns A promise that resolves to the model
2340
+ */
2341
+ getModel({ runtimeContext }?: {
2342
+ runtimeContext?: RuntimeContext;
2343
+ }): MastraLanguageModel | Promise<MastraLanguageModel>;
2314
2344
  __updateInstructions(newInstructions: string): void;
2315
2345
  __registerPrimitives(p: MastraPrimitives): void;
2316
2346
  __registerMastra(mastra: Mastra): void;
@@ -2319,8 +2349,9 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2319
2349
  * @param tools
2320
2350
  */
2321
2351
  __setTools(tools: TTools): void;
2322
- generateTitleFromUserMessage({ message }: {
2352
+ generateTitleFromUserMessage({ message, runtimeContext, }: {
2323
2353
  message: CoreUserMessage$1;
2354
+ runtimeContext?: RuntimeContext;
2324
2355
  }): Promise<string>;
2325
2356
  getMostRecentUserMessage(messages: Array<CoreMessage$1>): CoreUserMessage$1 | undefined;
2326
2357
  genTitle(userMessage: CoreUserMessage$1 | undefined): Promise<string>;
@@ -2340,14 +2371,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2340
2371
  }>;
2341
2372
  private getResponseMessages;
2342
2373
  sanitizeResponseMessages(messages: Array<CoreMessage$1>): Array<CoreMessage$1>;
2343
- convertTools({ toolsets, clientTools, threadId, resourceId, runId, runtimeContext, }: {
2344
- toolsets?: ToolsetsInput;
2345
- clientTools?: ToolsInput;
2346
- threadId?: string;
2347
- resourceId?: string;
2348
- runId?: string;
2349
- runtimeContext: RuntimeContext;
2350
- }): Record<string, CoreTool>;
2374
+ private convertTools;
2351
2375
  preExecute({ resourceId, runId, threadId, thread, memoryConfig, messages, systemMessage, }: {
2352
2376
  runId?: string;
2353
2377
  threadId: string;
@@ -2374,7 +2398,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2374
2398
  }): {
2375
2399
  before: () => Promise<{
2376
2400
  messageObjects: CoreMessage$1[];
2377
- convertedTools: Record<string, CoreTool> | undefined;
2401
+ convertedTools: Record<string, CoreTool>;
2378
2402
  threadId: string;
2379
2403
  thread: StorageThreadType | null | undefined;
2380
2404
  }>;
@@ -2461,23 +2485,18 @@ interface StorageColumn {
2461
2485
  column: string;
2462
2486
  };
2463
2487
  }
2464
- interface WorkflowRow {
2465
- workflow_name: string;
2466
- run_id: string;
2467
- snapshot: WorkflowRunState;
2468
- created_at: Date;
2469
- updated_at: Date;
2470
- }
2471
2488
  interface WorkflowRuns {
2472
- runs: Array<{
2473
- workflowName: string;
2474
- runId: string;
2475
- snapshot: WorkflowRunState | string;
2476
- createdAt: Date;
2477
- updatedAt: Date;
2478
- }>;
2489
+ runs: WorkflowRun[];
2479
2490
  total: number;
2480
2491
  }
2492
+ interface WorkflowRun {
2493
+ workflowName: string;
2494
+ runId: string;
2495
+ snapshot: WorkflowRunState | string;
2496
+ createdAt: Date;
2497
+ updatedAt: Date;
2498
+ resourceId?: string;
2499
+ }
2481
2500
  type StorageGetMessagesArg = {
2482
2501
  threadId: string;
2483
2502
  resourceId?: string;
@@ -2642,13 +2661,17 @@ declare abstract class MastraStorage extends MastraBase {
2642
2661
  }): Promise<WorkflowRunState | null>;
2643
2662
  abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
2644
2663
  abstract getWorkflowRuns(args?: {
2645
- namespace?: string;
2646
2664
  workflowName?: string;
2647
2665
  fromDate?: Date;
2648
2666
  toDate?: Date;
2649
2667
  limit?: number;
2650
2668
  offset?: number;
2669
+ resourceId?: string;
2651
2670
  }): Promise<WorkflowRuns>;
2671
+ abstract getWorkflowRunById(args: {
2672
+ runId: string;
2673
+ workflowName?: string;
2674
+ }): Promise<WorkflowRun | null>;
2652
2675
  }
2653
2676
 
2654
- export { type CoreSystemMessage as $, type ApiRoute as A, type VariableReference as B, CompositeVoice as C, type WatchEvent as D, type EvalRow as E, type ToolAction as F, Agent as G, type AgentConfig as H, MastraMemory as I, type ToolExecutionContext as J, Tool as K, Step as L, type Methods as M, type NewStep as N, Workflow as O, type PathsToStringProps as P, type WorkflowOptions as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowRow as U, type VoiceEventType as V, type WorkflowRunState as W, type WorkflowRuns as X, type LanguageModel as Y, type ZodPathType as Z, type CoreMessage as _, Mastra as a, type StepInputType as a$, type CoreAssistantMessage as a0, type CoreUserMessage as a1, type CoreToolMessage as a2, type EmbedResult as a3, type EmbedManyResult as a4, type BaseStructuredOutputType as a5, type StructuredOutputType as a6, type StructuredOutputArrayItem as a7, type StructuredOutput as a8, type GenerateReturn as a9, type StepGraph as aA, type RetryConfig as aB, type VariableReference$1 as aC, type BaseCondition as aD, type ActionContext as aE, WhenConditionReturnValue as aF, type StepDef as aG, type StepCondition as aH, type StepConfig as aI, type StepResult$1 as aJ, type StepsRecord$1 as aK, type WorkflowRunResult as aL, type WorkflowContext as aM, type WorkflowLogMessage as aN, type WorkflowEvent as aO, type ResolverFunctionInput as aP, type ResolverFunctionOutput as aQ, type SubscriberFunctionOutput as aR, type DependencyCheckOutput as aS, type StepResolverOutput as aT, type WorkflowActors as aU, type WorkflowActionParams as aV, type WorkflowActions as aW, type WorkflowState as aX, type StepId as aY, type ExtractSchemaFromStep$1 as aZ, type ExtractStepResult as a_, type StreamReturn as aa, type OutputType as ab, type DefaultLLMTextOptions as ac, type DefaultLLMTextObjectOptions as ad, type DefaultLLMStreamOptions as ae, type DefaultLLMStreamObjectOptions as af, type LLMTextOptions as ag, type LLMTextObjectOptions as ah, type LLMStreamOptions as ai, type LLMInnerStreamOptions as aj, type LLMStreamObjectOptions as ak, createMockModel as al, type Config as am, type MessageResponse as an, type MemoryConfig as ao, type SharedMemoryConfig as ap, type MemoryProcessorOpts as aq, MemoryProcessor as ar, memoryDefaultOptions as as, createTool as at, type VercelTool as au, type CoreTool as av, type StepExecutionContext as aw, type StepAction as ax, type StepVariableType as ay, type StepNode as az, MastraVoice as b, type ExtractSchemaType$1 as b0, type PathsToStringProps$1 as b1, type WorkflowResumeResult as b2, type MastraLanguageModel as b3, type ToolsInput as b4, type MastraPrimitives as b5, AgentNetwork as b6, type AgentNetworkConfig as b7, type ToolsetsInput as b8, type AgentGenerateOptions as b9, type AgentStreamOptions as ba, TABLE_WORKFLOW_SNAPSHOT as bb, TABLE_EVALS as bc, TABLE_MESSAGES as bd, TABLE_THREADS as be, TABLE_TRACES as bf, TABLE_SCHEMAS as bg, type VoiceEventMap as c, type VoiceConfig as d, MastraStorage as e, type StorageThreadType as f, type MessageType as g, type StorageGetMessagesArg as h, ExecutionEngine as i, type ExecutionGraph as j, type StepResult as k, type StepFlowEntry as l, type ExecuteFunction as m, createStep as n, cloneStep as o, createWorkflow as p, cloneWorkflow as q, type WorkflowResult as r, type NewWorkflowConfig as s, NewWorkflow as t, type StepSuccess as u, type StepFailure as v, type StepSuspended as w, type StepsRecord as x, type ExtractSchemaType as y, type ExtractSchemaFromStep as z };
2677
+ export { type BaseStructuredOutputType as $, type ApiRoute as A, Agent as B, type AgentConfig as C, MastraMemory as D, type EvalRow as E, type ToolExecutionContext as F, Tool as G, Step as H, Workflow as I, type WorkflowOptions as J, type CoreMessage as K, type LanguageModel as L, type Methods as M, type NewStep as N, type CoreSystemMessage as O, type PathsToStringProps as P, type CoreAssistantMessage as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreUserMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreToolMessage as X, type EmbedResult as Y, type ZodPathType as Z, type EmbedManyResult as _, Mastra as a, type ToolsInput as a$, type StructuredOutputType as a0, type StructuredOutputArrayItem as a1, type StructuredOutput as a2, type GenerateReturn as a3, type StreamReturn as a4, type OutputType as a5, type DefaultLLMTextOptions as a6, type DefaultLLMTextObjectOptions as a7, type DefaultLLMStreamOptions as a8, type DefaultLLMStreamObjectOptions as a9, type StepDef as aA, type StepCondition as aB, type StepConfig as aC, type StepResult$1 as aD, type StepsRecord$1 as aE, type WorkflowRunResult as aF, type WorkflowContext as aG, type WorkflowLogMessage as aH, type WorkflowEvent as aI, type ResolverFunctionInput as aJ, type ResolverFunctionOutput as aK, type SubscriberFunctionOutput as aL, type DependencyCheckOutput as aM, type StepResolverOutput as aN, type WorkflowActors as aO, type WorkflowActionParams as aP, type WorkflowActions as aQ, type WorkflowState as aR, type StepId as aS, type ExtractSchemaFromStep$1 as aT, type ExtractStepResult as aU, type StepInputType as aV, type ExtractSchemaType$1 as aW, type PathsToStringProps$1 as aX, type WorkflowRunState as aY, type WorkflowResumeResult as aZ, type MastraLanguageModel as a_, 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 MessageResponse as ah, type MemoryConfig as ai, type SharedMemoryConfig as aj, type MemoryProcessorOpts as ak, MemoryProcessor as al, memoryDefaultOptions as am, createTool as an, type VercelTool as ao, type CoreTool as ap, type StepExecutionContext as aq, type StepAction as ar, type StepVariableType as as, type StepNode as at, type StepGraph as au, type RetryConfig as av, type VariableReference$1 as aw, type BaseCondition as ax, type ActionContext as ay, WhenConditionReturnValue as az, MastraStorage as b, type MastraPrimitives as b0, AgentNetwork as b1, type AgentNetworkConfig as b2, type VoiceEventType as b3, type VoiceEventMap as b4, type VoiceConfig as b5, MastraVoice as b6, CompositeVoice as b7, DefaultVoice as b8, type ToolsetsInput as b9, type DynamicArgument as ba, type AgentGenerateOptions as bb, type AgentStreamOptions as bc, TABLE_WORKFLOW_SNAPSHOT as bd, TABLE_EVALS as be, TABLE_MESSAGES as bf, TABLE_THREADS as bg, TABLE_TRACES as bh, TABLE_SCHEMAS as bi, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type ExecutionGraph as h, type StepResult as i, type StepFlowEntry as j, type ExecuteFunction as k, createStep as l, cloneStep as m, createWorkflow as n, cloneWorkflow as o, type WorkflowResult as p, type NewWorkflowConfig as q, NewWorkflow as r, type StepSuccess as s, type StepFailure as t, type StepSuspended as u, type StepsRecord as v, type ExtractSchemaType as w, type ExtractSchemaFromStep as x, type WatchEvent as y, type ToolAction as z };
@@ -1,5 +1,5 @@
1
1
  import * as ai from 'ai';
2
- import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, TelemetrySettings, generateText, generateObject, streamText, streamObject, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
2
+ import { Tool as Tool$1, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, EmbeddingModel, Message, UserContent, AssistantContent, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback, ToolContent } from 'ai';
3
3
  import { M as MastraBase, T as Telemetry, O as OtelConfig } from './base-BihKcqDY.cjs';
4
4
  import { a as Metric, M as MetricResult, T as TestInfo } from './types-BtMyV38I.cjs';
5
5
  import { Query } from 'sift';
@@ -1484,13 +1484,7 @@ declare class NewWorkflow<TSteps extends NewStep<string, any, any, any, any>[] =
1484
1484
  mastra: Mastra;
1485
1485
  }): Promise<z.infer<TOutput>>;
1486
1486
  getWorkflowRuns(): Promise<WorkflowRuns>;
1487
- getWorkflowRun(runId: string): Promise<{
1488
- workflowName: string;
1489
- runId: string;
1490
- snapshot: WorkflowRunState | string;
1491
- createdAt: Date;
1492
- updatedAt: Date;
1493
- } | Run<TSteps, TInput, TOutput> | undefined>;
1487
+ getWorkflowRun(runId: string): Promise<WorkflowRun | Run<TSteps, TInput, TOutput> | undefined>;
1494
1488
  }
1495
1489
  /**
1496
1490
  * Represents a workflow run that can be executed
@@ -1802,8 +1796,7 @@ type DefaultLLMTextObjectOptions = Omit<GenerateObjectOptions, MastraCustomLLMOp
1802
1796
  type DefaultLLMStreamOptions = Omit<StreamTextOptions, MastraCustomLLMOptionsKeys>;
1803
1797
  type DefaultLLMStreamObjectOptions = Omit<StreamObjectOptions, MastraCustomLLMOptionsKeys>;
1804
1798
  type MastraCustomLLMOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> = {
1805
- tools?: ToolsInput;
1806
- convertedTools?: Record<string, CoreTool>;
1799
+ tools?: Record<string, CoreTool>;
1807
1800
  onStepFinish?: (step: unknown) => void;
1808
1801
  experimental_output?: Z;
1809
1802
  telemetry?: TelemetrySettings;
@@ -2022,22 +2015,34 @@ declare class CompositeVoice extends MastraVoice<unknown, unknown, unknown, Tool
2022
2015
  off<E extends VoiceEventType>(event: E, callback: (data: E extends keyof VoiceEventMap ? VoiceEventMap[E] : unknown) => void): void;
2023
2016
  }
2024
2017
 
2018
+ declare class DefaultVoice extends MastraVoice {
2019
+ constructor();
2020
+ speak(_input: string | NodeJS.ReadableStream): Promise<NodeJS.ReadableStream>;
2021
+ listen(_input: string | NodeJS.ReadableStream): Promise<string>;
2022
+ getSpeakers(): Promise<{
2023
+ voiceId: string;
2024
+ }[]>;
2025
+ }
2026
+
2025
2027
  type ToolsInput = Record<string, ToolAction<any, any, any> | VercelTool>;
2026
2028
  type ToolsetsInput = Record<string, ToolsInput>;
2027
2029
  type MastraLanguageModel = LanguageModelV1;
2030
+ type DynamicArgument<T> = T | (({ runtimeContext }: {
2031
+ runtimeContext: RuntimeContext;
2032
+ }) => Promise<T> | T);
2028
2033
  interface AgentConfig<TAgentId extends string = string, TTools extends ToolsInput = ToolsInput, TMetrics extends Record<string, Metric> = Record<string, Metric>> {
2029
2034
  name: TAgentId;
2030
- instructions: string;
2031
- model: MastraLanguageModel;
2035
+ instructions: DynamicArgument<string>;
2036
+ model: DynamicArgument<MastraLanguageModel>;
2037
+ tools?: DynamicArgument<TTools>;
2032
2038
  defaultGenerateOptions?: AgentGenerateOptions;
2033
2039
  defaultStreamOptions?: AgentStreamOptions;
2034
- tools?: TTools;
2035
2040
  mastra?: Mastra;
2036
- /** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
2037
- metrics?: TMetrics;
2038
2041
  evals?: TMetrics;
2039
2042
  memory?: MastraMemory;
2040
2043
  voice?: CompositeVoice;
2044
+ /** @deprecated This property is deprecated. Use evals instead to add evaluation metrics. */
2045
+ metrics?: TMetrics;
2041
2046
  }
2042
2047
  /**
2043
2048
  * Options for generating responses with an agent
@@ -2300,17 +2305,42 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2300
2305
  #private;
2301
2306
  id: TAgentId;
2302
2307
  name: TAgentId;
2303
- readonly llm: MastraLLMBase;
2304
- instructions: string;
2305
- readonly model?: MastraLanguageModel;
2306
- tools: TTools;
2308
+ readonly model?: DynamicArgument<MastraLanguageModel>;
2307
2309
  /** @deprecated This property is deprecated. Use evals instead. */
2308
2310
  metrics: TMetrics;
2309
2311
  evals: TMetrics;
2310
- voice: CompositeVoice;
2311
2312
  constructor(config: AgentConfig<TAgentId, TTools, TMetrics>);
2312
2313
  hasOwnMemory(): boolean;
2313
2314
  getMemory(): MastraMemory | undefined;
2315
+ get voice(): CompositeVoice;
2316
+ getVoice({ runtimeContext }?: {
2317
+ runtimeContext?: RuntimeContext;
2318
+ }): Promise<CompositeVoice | DefaultVoice>;
2319
+ get instructions(): string;
2320
+ getInstructions({ runtimeContext }?: {
2321
+ runtimeContext?: RuntimeContext;
2322
+ }): string | Promise<string>;
2323
+ get tools(): TTools;
2324
+ getTools({ runtimeContext }?: {
2325
+ runtimeContext?: RuntimeContext;
2326
+ }): TTools | Promise<TTools>;
2327
+ get llm(): MastraLLMBase | Promise<MastraLLMBase>;
2328
+ /**
2329
+ * Gets or creates an LLM instance based on the current model
2330
+ * @param options Options for getting the LLM
2331
+ * @returns A promise that resolves to the LLM instance
2332
+ */
2333
+ getLLM({ runtimeContext }?: {
2334
+ runtimeContext?: RuntimeContext;
2335
+ }): MastraLLMBase | Promise<MastraLLMBase>;
2336
+ /**
2337
+ * Gets the model, resolving it if it's a function
2338
+ * @param options Options for getting the model
2339
+ * @returns A promise that resolves to the model
2340
+ */
2341
+ getModel({ runtimeContext }?: {
2342
+ runtimeContext?: RuntimeContext;
2343
+ }): MastraLanguageModel | Promise<MastraLanguageModel>;
2314
2344
  __updateInstructions(newInstructions: string): void;
2315
2345
  __registerPrimitives(p: MastraPrimitives): void;
2316
2346
  __registerMastra(mastra: Mastra): void;
@@ -2319,8 +2349,9 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2319
2349
  * @param tools
2320
2350
  */
2321
2351
  __setTools(tools: TTools): void;
2322
- generateTitleFromUserMessage({ message }: {
2352
+ generateTitleFromUserMessage({ message, runtimeContext, }: {
2323
2353
  message: CoreUserMessage$1;
2354
+ runtimeContext?: RuntimeContext;
2324
2355
  }): Promise<string>;
2325
2356
  getMostRecentUserMessage(messages: Array<CoreMessage$1>): CoreUserMessage$1 | undefined;
2326
2357
  genTitle(userMessage: CoreUserMessage$1 | undefined): Promise<string>;
@@ -2340,14 +2371,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2340
2371
  }>;
2341
2372
  private getResponseMessages;
2342
2373
  sanitizeResponseMessages(messages: Array<CoreMessage$1>): Array<CoreMessage$1>;
2343
- convertTools({ toolsets, clientTools, threadId, resourceId, runId, runtimeContext, }: {
2344
- toolsets?: ToolsetsInput;
2345
- clientTools?: ToolsInput;
2346
- threadId?: string;
2347
- resourceId?: string;
2348
- runId?: string;
2349
- runtimeContext: RuntimeContext;
2350
- }): Record<string, CoreTool>;
2374
+ private convertTools;
2351
2375
  preExecute({ resourceId, runId, threadId, thread, memoryConfig, messages, systemMessage, }: {
2352
2376
  runId?: string;
2353
2377
  threadId: string;
@@ -2374,7 +2398,7 @@ declare class Agent<TAgentId extends string = string, TTools extends ToolsInput
2374
2398
  }): {
2375
2399
  before: () => Promise<{
2376
2400
  messageObjects: CoreMessage$1[];
2377
- convertedTools: Record<string, CoreTool> | undefined;
2401
+ convertedTools: Record<string, CoreTool>;
2378
2402
  threadId: string;
2379
2403
  thread: StorageThreadType | null | undefined;
2380
2404
  }>;
@@ -2461,23 +2485,18 @@ interface StorageColumn {
2461
2485
  column: string;
2462
2486
  };
2463
2487
  }
2464
- interface WorkflowRow {
2465
- workflow_name: string;
2466
- run_id: string;
2467
- snapshot: WorkflowRunState;
2468
- created_at: Date;
2469
- updated_at: Date;
2470
- }
2471
2488
  interface WorkflowRuns {
2472
- runs: Array<{
2473
- workflowName: string;
2474
- runId: string;
2475
- snapshot: WorkflowRunState | string;
2476
- createdAt: Date;
2477
- updatedAt: Date;
2478
- }>;
2489
+ runs: WorkflowRun[];
2479
2490
  total: number;
2480
2491
  }
2492
+ interface WorkflowRun {
2493
+ workflowName: string;
2494
+ runId: string;
2495
+ snapshot: WorkflowRunState | string;
2496
+ createdAt: Date;
2497
+ updatedAt: Date;
2498
+ resourceId?: string;
2499
+ }
2481
2500
  type StorageGetMessagesArg = {
2482
2501
  threadId: string;
2483
2502
  resourceId?: string;
@@ -2642,13 +2661,17 @@ declare abstract class MastraStorage extends MastraBase {
2642
2661
  }): Promise<WorkflowRunState | null>;
2643
2662
  abstract getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
2644
2663
  abstract getWorkflowRuns(args?: {
2645
- namespace?: string;
2646
2664
  workflowName?: string;
2647
2665
  fromDate?: Date;
2648
2666
  toDate?: Date;
2649
2667
  limit?: number;
2650
2668
  offset?: number;
2669
+ resourceId?: string;
2651
2670
  }): Promise<WorkflowRuns>;
2671
+ abstract getWorkflowRunById(args: {
2672
+ runId: string;
2673
+ workflowName?: string;
2674
+ }): Promise<WorkflowRun | null>;
2652
2675
  }
2653
2676
 
2654
- export { type CoreSystemMessage as $, type ApiRoute as A, type VariableReference as B, CompositeVoice as C, type WatchEvent as D, type EvalRow as E, type ToolAction as F, Agent as G, type AgentConfig as H, MastraMemory as I, type ToolExecutionContext as J, Tool as K, Step as L, type Methods as M, type NewStep as N, Workflow as O, type PathsToStringProps as P, type WorkflowOptions as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type WorkflowRow as U, type VoiceEventType as V, type WorkflowRunState as W, type WorkflowRuns as X, type LanguageModel as Y, type ZodPathType as Z, type CoreMessage as _, Mastra as a, type StepInputType as a$, type CoreAssistantMessage as a0, type CoreUserMessage as a1, type CoreToolMessage as a2, type EmbedResult as a3, type EmbedManyResult as a4, type BaseStructuredOutputType as a5, type StructuredOutputType as a6, type StructuredOutputArrayItem as a7, type StructuredOutput as a8, type GenerateReturn as a9, type StepGraph as aA, type RetryConfig as aB, type VariableReference$1 as aC, type BaseCondition as aD, type ActionContext as aE, WhenConditionReturnValue as aF, type StepDef as aG, type StepCondition as aH, type StepConfig as aI, type StepResult$1 as aJ, type StepsRecord$1 as aK, type WorkflowRunResult as aL, type WorkflowContext as aM, type WorkflowLogMessage as aN, type WorkflowEvent as aO, type ResolverFunctionInput as aP, type ResolverFunctionOutput as aQ, type SubscriberFunctionOutput as aR, type DependencyCheckOutput as aS, type StepResolverOutput as aT, type WorkflowActors as aU, type WorkflowActionParams as aV, type WorkflowActions as aW, type WorkflowState as aX, type StepId as aY, type ExtractSchemaFromStep$1 as aZ, type ExtractStepResult as a_, type StreamReturn as aa, type OutputType as ab, type DefaultLLMTextOptions as ac, type DefaultLLMTextObjectOptions as ad, type DefaultLLMStreamOptions as ae, type DefaultLLMStreamObjectOptions as af, type LLMTextOptions as ag, type LLMTextObjectOptions as ah, type LLMStreamOptions as ai, type LLMInnerStreamOptions as aj, type LLMStreamObjectOptions as ak, createMockModel as al, type Config as am, type MessageResponse as an, type MemoryConfig as ao, type SharedMemoryConfig as ap, type MemoryProcessorOpts as aq, MemoryProcessor as ar, memoryDefaultOptions as as, createTool as at, type VercelTool as au, type CoreTool as av, type StepExecutionContext as aw, type StepAction as ax, type StepVariableType as ay, type StepNode as az, MastraVoice as b, type ExtractSchemaType$1 as b0, type PathsToStringProps$1 as b1, type WorkflowResumeResult as b2, type MastraLanguageModel as b3, type ToolsInput as b4, type MastraPrimitives as b5, AgentNetwork as b6, type AgentNetworkConfig as b7, type ToolsetsInput as b8, type AgentGenerateOptions as b9, type AgentStreamOptions as ba, TABLE_WORKFLOW_SNAPSHOT as bb, TABLE_EVALS as bc, TABLE_MESSAGES as bd, TABLE_THREADS as be, TABLE_TRACES as bf, TABLE_SCHEMAS as bg, type VoiceEventMap as c, type VoiceConfig as d, MastraStorage as e, type StorageThreadType as f, type MessageType as g, type StorageGetMessagesArg as h, ExecutionEngine as i, type ExecutionGraph as j, type StepResult as k, type StepFlowEntry as l, type ExecuteFunction as m, createStep as n, cloneStep as o, createWorkflow as p, cloneWorkflow as q, type WorkflowResult as r, type NewWorkflowConfig as s, NewWorkflow as t, type StepSuccess as u, type StepFailure as v, type StepSuspended as w, type StepsRecord as x, type ExtractSchemaType as y, type ExtractSchemaFromStep as z };
2677
+ export { type BaseStructuredOutputType as $, type ApiRoute as A, Agent as B, type AgentConfig as C, MastraMemory as D, type EvalRow as E, type ToolExecutionContext as F, Tool as G, Step as H, Workflow as I, type WorkflowOptions as J, type CoreMessage as K, type LanguageModel as L, type Methods as M, type NewStep as N, type CoreSystemMessage as O, type PathsToStringProps as P, type CoreAssistantMessage as Q, Run as R, type StorageColumn as S, type TABLE_NAMES as T, type CoreUserMessage as U, type VariableReference as V, type WorkflowRuns as W, type CoreToolMessage as X, type EmbedResult as Y, type ZodPathType as Z, type EmbedManyResult as _, Mastra as a, type ToolsInput as a$, type StructuredOutputType as a0, type StructuredOutputArrayItem as a1, type StructuredOutput as a2, type GenerateReturn as a3, type StreamReturn as a4, type OutputType as a5, type DefaultLLMTextOptions as a6, type DefaultLLMTextObjectOptions as a7, type DefaultLLMStreamOptions as a8, type DefaultLLMStreamObjectOptions as a9, type StepDef as aA, type StepCondition as aB, type StepConfig as aC, type StepResult$1 as aD, type StepsRecord$1 as aE, type WorkflowRunResult as aF, type WorkflowContext as aG, type WorkflowLogMessage as aH, type WorkflowEvent as aI, type ResolverFunctionInput as aJ, type ResolverFunctionOutput as aK, type SubscriberFunctionOutput as aL, type DependencyCheckOutput as aM, type StepResolverOutput as aN, type WorkflowActors as aO, type WorkflowActionParams as aP, type WorkflowActions as aQ, type WorkflowState as aR, type StepId as aS, type ExtractSchemaFromStep$1 as aT, type ExtractStepResult as aU, type StepInputType as aV, type ExtractSchemaType$1 as aW, type PathsToStringProps$1 as aX, type WorkflowRunState as aY, type WorkflowResumeResult as aZ, type MastraLanguageModel as a_, 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 MessageResponse as ah, type MemoryConfig as ai, type SharedMemoryConfig as aj, type MemoryProcessorOpts as ak, MemoryProcessor as al, memoryDefaultOptions as am, createTool as an, type VercelTool as ao, type CoreTool as ap, type StepExecutionContext as aq, type StepAction as ar, type StepVariableType as as, type StepNode as at, type StepGraph as au, type RetryConfig as av, type VariableReference$1 as aw, type BaseCondition as ax, type ActionContext as ay, WhenConditionReturnValue as az, MastraStorage as b, type MastraPrimitives as b0, AgentNetwork as b1, type AgentNetworkConfig as b2, type VoiceEventType as b3, type VoiceEventMap as b4, type VoiceConfig as b5, MastraVoice as b6, CompositeVoice as b7, DefaultVoice as b8, type ToolsetsInput as b9, type DynamicArgument as ba, type AgentGenerateOptions as bb, type AgentStreamOptions as bc, TABLE_WORKFLOW_SNAPSHOT as bd, TABLE_EVALS as be, TABLE_MESSAGES as bf, TABLE_THREADS as bg, TABLE_TRACES as bh, TABLE_SCHEMAS as bi, type StorageThreadType as c, type MessageType as d, type StorageGetMessagesArg as e, type WorkflowRun as f, ExecutionEngine as g, type ExecutionGraph as h, type StepResult as i, type StepFlowEntry as j, type ExecuteFunction as k, createStep as l, cloneStep as m, createWorkflow as n, cloneWorkflow as o, type WorkflowResult as p, type NewWorkflowConfig as q, NewWorkflow as r, type StepSuccess as s, type StepFailure as t, type StepSuspended as u, type StepsRecord as v, type ExtractSchemaType as w, type ExtractSchemaFromStep as x, type WatchEvent as y, type ToolAction as z };
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunk27PAET7X_cjs = require('./chunk-27PAET7X.cjs');
4
- var chunkRIBNDTA6_cjs = require('./chunk-RIBNDTA6.cjs');
3
+ var chunkZKRQS3N5_cjs = require('./chunk-ZKRQS3N5.cjs');
4
+ var chunkMYHX5XVW_cjs = require('./chunk-MYHX5XVW.cjs');
5
5
  var chunkO7IW545H_cjs = require('./chunk-O7IW545H.cjs');
6
6
  var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
7
7
 
8
8
  // src/mastra/index.ts
9
9
  var _Mastra_decorators, _init;
10
- _Mastra_decorators = [chunkRIBNDTA6_cjs.InstrumentClass({
10
+ _Mastra_decorators = [chunkMYHX5XVW_cjs.InstrumentClass({
11
11
  prefix: "mastra",
12
12
  excludeMethods: ["getLogger", "getTelemetry"]
13
13
  })];
@@ -67,14 +67,14 @@ exports.Mastra = class Mastra {
67
67
  this.#logger = logger;
68
68
  let storage = config?.storage;
69
69
  if (!storage) {
70
- storage = new chunk27PAET7X_cjs.DefaultProxyStorage({
70
+ storage = new chunkZKRQS3N5_cjs.DefaultProxyStorage({
71
71
  config: {
72
72
  url: process.env.MASTRA_DEFAULT_STORAGE_URL || `:memory:`
73
73
  }
74
74
  });
75
75
  }
76
- storage = chunk27PAET7X_cjs.augmentWithInit(storage);
77
- this.#telemetry = chunkRIBNDTA6_cjs.Telemetry.init(config?.telemetry);
76
+ storage = chunkZKRQS3N5_cjs.augmentWithInit(storage);
77
+ this.#telemetry = chunkMYHX5XVW_cjs.Telemetry.init(config?.telemetry);
78
78
  if (this.#telemetry) {
79
79
  this.#storage = this.#telemetry.traceClass(storage, {
80
80
  excludeMethods: ["__setTelemetry", "__getTelemetry", "batchTraceInsert"]
@@ -285,7 +285,7 @@ This is a warning for now, but will throw an error in the future
285
285
  return this.#vnext_workflows;
286
286
  }
287
287
  setStorage(storage) {
288
- if (storage instanceof chunk27PAET7X_cjs.DefaultProxyStorage) {
288
+ if (storage instanceof chunkZKRQS3N5_cjs.DefaultProxyStorage) {
289
289
  this.#logger.warn(`Importing "DefaultStorage" from '@mastra/core/storage/libsql' is deprecated.
290
290
 
291
291
  Instead of:
@@ -295,7 +295,7 @@ Do:
295
295
  import { LibSQLStore } from '@mastra/libsql';
296
296
  `);
297
297
  }
298
- this.#storage = chunk27PAET7X_cjs.augmentWithInit(storage);
298
+ this.#storage = chunkZKRQS3N5_cjs.augmentWithInit(storage);
299
299
  }
300
300
  setLogger({
301
301
  logger
@@ -327,7 +327,7 @@ Do:
327
327
  }
328
328
  }
329
329
  setTelemetry(telemetry) {
330
- this.#telemetry = chunkRIBNDTA6_cjs.Telemetry.init(telemetry);
330
+ this.#telemetry = chunkMYHX5XVW_cjs.Telemetry.init(telemetry);
331
331
  if (this.#agents) {
332
332
  Object.keys(this.#agents).forEach(key => {
333
333
  if (this.#telemetry) {
@@ -1,4 +1,4 @@
1
- import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-ANYT6KP7.js';
1
+ import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_SCHEMAS } from './chunk-SEOWDGC2.js';
2
2
  import { MastraBase } from './chunk-CLJQYXNM.js';
3
3
 
4
4
  // src/storage/base.ts
@@ -14,6 +14,7 @@ var TABLE_SCHEMAS = {
14
14
  run_id: {
15
15
  type: "text"
16
16
  },
17
+ resourceId: { type: "text", nullable: true },
17
18
  snapshot: {
18
19
  type: "text"
19
20
  },
@@ -1,4 +1,4 @@
1
- import { InstrumentClass } from './chunk-HFOT2NFM.js';
1
+ import { InstrumentClass } from './chunk-KWYJUFY3.js';
2
2
  import { MastraBase } from './chunk-CLJQYXNM.js';
3
3
  import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
4
4
 
@@ -32,7 +32,7 @@ function createTool(opts) {
32
32
  }
33
33
  var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
34
34
  function jsonSchemaPropertiesToTSTypes(value) {
35
- if (!value.type) {
35
+ if (!value?.type) {
36
36
  return zod.z.object({});
37
37
  }
38
38
  if (Array.isArray(value.type)) {
@@ -61,6 +61,9 @@ Examples: ${value.examples.join(", ")}` : ""));
61
61
  Examples: ${value.examples.join(", ")}` : ""));
62
62
  break;
63
63
  case "array":
64
+ if (!value.items || !value.items?.type) {
65
+ value.items = value.items ? { ...value.items, type: "string" } : { type: "string" };
66
+ }
64
67
  zodType = zod.z.array(jsonSchemaPropertiesToTSTypes(value.items)).describe((value.description || "") + (value.examples ? `
65
68
  Examples: ${value.examples.join(", ")}` : ""));
66
69
  break;