@mastra/core 0.10.11-alpha.4 → 0.10.12-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) 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-DpaaEQWN.d.cts → base-CevbNCZz.d.cts} +12 -16
  6. package/dist/{base-BBkhRGjp.d.ts → base-r5AnlfyA.d.ts} +12 -16
  7. package/dist/{chunk-VUEY4BUU.cjs → chunk-E7AX3U6M.cjs} +8 -54
  8. package/dist/{chunk-FL4BYLDK.cjs → chunk-LK3JMAG3.cjs} +2 -2
  9. package/dist/{chunk-VNEHTPHO.js → chunk-P4ZZZ3TH.js} +1 -1
  10. package/dist/{chunk-ZJSVUBYU.cjs → chunk-TPVJVBKI.cjs} +2 -2
  11. package/dist/{chunk-WTC6DJHD.cjs → chunk-V4ONHDHV.cjs} +3 -3
  12. package/dist/{chunk-QO6F3HHE.js → chunk-VPRAWB5K.js} +1 -1
  13. package/dist/{chunk-XR7OX4ZC.js → chunk-YFXNOA63.js} +2 -2
  14. package/dist/{chunk-EJI2SQJP.js → chunk-YJEHXYK5.js} +8 -54
  15. package/dist/eval/index.d.cts +1 -1
  16. package/dist/eval/index.d.ts +1 -1
  17. package/dist/index.cjs +16 -16
  18. package/dist/index.d.cts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +4 -4
  21. package/dist/integration/index.d.cts +1 -1
  22. package/dist/integration/index.d.ts +1 -1
  23. package/dist/llm/index.d.cts +1 -1
  24. package/dist/llm/index.d.ts +1 -1
  25. package/dist/mastra/index.d.cts +1 -1
  26. package/dist/mastra/index.d.ts +1 -1
  27. package/dist/mcp/index.d.cts +1 -1
  28. package/dist/mcp/index.d.ts +1 -1
  29. package/dist/memory/index.d.cts +1 -1
  30. package/dist/memory/index.d.ts +1 -1
  31. package/dist/network/index.cjs +2 -2
  32. package/dist/network/index.d.cts +1 -1
  33. package/dist/network/index.d.ts +1 -1
  34. package/dist/network/index.js +1 -1
  35. package/dist/network/vNext/index.cjs +13 -13
  36. package/dist/network/vNext/index.d.cts +1 -1
  37. package/dist/network/vNext/index.d.ts +1 -1
  38. package/dist/network/vNext/index.js +2 -2
  39. package/dist/relevance/index.cjs +4 -4
  40. package/dist/relevance/index.d.cts +1 -1
  41. package/dist/relevance/index.d.ts +1 -1
  42. package/dist/relevance/index.js +1 -1
  43. package/dist/server/index.d.cts +2 -2
  44. package/dist/server/index.d.ts +2 -2
  45. package/dist/storage/index.d.cts +2 -2
  46. package/dist/storage/index.d.ts +2 -2
  47. package/dist/telemetry/index.d.cts +1 -1
  48. package/dist/telemetry/index.d.ts +1 -1
  49. package/dist/tools/index.d.cts +2 -2
  50. package/dist/tools/index.d.ts +2 -2
  51. package/dist/utils.d.cts +1 -1
  52. package/dist/utils.d.ts +1 -1
  53. package/dist/voice/index.d.cts +1 -1
  54. package/dist/voice/index.d.ts +1 -1
  55. package/dist/workflows/index.cjs +10 -10
  56. package/dist/workflows/index.d.cts +2 -2
  57. package/dist/workflows/index.d.ts +2 -2
  58. package/dist/workflows/index.js +1 -1
  59. package/dist/workflows/legacy/index.cjs +22 -22
  60. package/dist/workflows/legacy/index.d.cts +2 -2
  61. package/dist/workflows/legacy/index.d.ts +2 -2
  62. package/dist/workflows/legacy/index.js +1 -1
  63. package/package.json +3 -3
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkWTC6DJHD_cjs = require('../chunk-WTC6DJHD.cjs');
3
+ var chunkV4ONHDHV_cjs = require('../chunk-V4ONHDHV.cjs');
4
4
  var chunkQUSEDVYI_cjs = require('../chunk-QUSEDVYI.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "Agent", {
9
9
  enumerable: true,
10
- get: function () { return chunkWTC6DJHD_cjs.Agent; }
10
+ get: function () { return chunkV4ONHDHV_cjs.Agent; }
11
11
  });
12
12
  Object.defineProperty(exports, "MessageList", {
13
13
  enumerable: true,
@@ -1,7 +1,7 @@
1
1
  export { Message as AiMessageType } from 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-DpaaEQWN.cjs';
4
+ export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-CevbNCZz.cjs';
5
5
  import '../base-B_y9sMg0.cjs';
6
6
  import '../types-Bo1uigWx.cjs';
7
7
  import '../runtime-context/index.cjs';
@@ -1,7 +1,7 @@
1
1
  export { Message as AiMessageType } from 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-BBkhRGjp.js';
4
+ export { A as Agent, av as AgentConfig, c6 as AgentGenerateOptions, c5 as AgentMemoryOption, c7 as AgentStreamOptions, aZ as DynamicArgument, aY as MastraLanguageModel, c8 as MastraMessageContentV2, t as MastraMessageV2, c3 as MessageList, T as ToolsInput, c4 as ToolsetsInput } from '../base-r5AnlfyA.js';
5
5
  import '../base-ClrXcCRx.js';
6
6
  import '../types-Bo1uigWx.js';
7
7
  import '../runtime-context/index.js';
@@ -1,2 +1,2 @@
1
- export { Agent } from '../chunk-XR7OX4ZC.js';
1
+ export { Agent } from '../chunk-YFXNOA63.js';
2
2
  export { MessageList } from '../chunk-4UBOJFSL.js';
@@ -1,5 +1,4 @@
1
- import * as ai from 'ai';
2
- import { Tool as Tool$2, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, TextStreamPart, UserContent, AssistantContent, ToolContent, EmbeddingModel, UIMessage, Message, IDGenerator as IDGenerator$1, CoreSystemMessage as CoreSystemMessage$1, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
1
+ import { Tool as Tool$2, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, TextStreamPart, UserContent, AssistantContent, ToolContent, EmbeddingModel, UIMessage, Message, IDGenerator as IDGenerator$1, CoreSystemMessage as CoreSystemMessage$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
3
2
  import { M as MastraBase, a as Telemetry, O as OtelConfig, T as Trace } from './base-B_y9sMg0.cjs';
4
3
  import { z, ZodSchema, ZodObject } from 'zod';
5
4
  import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger, a as LogLevel } from './logger-B8XXh6ya.cjs';
@@ -2265,24 +2264,21 @@ declare abstract class MastraMemory extends MastraBase {
2265
2264
  abstract getWorkingMemoryTemplate(): Promise<WorkingMemoryTemplate | null>;
2266
2265
  }
2267
2266
 
2268
- declare class MastraLLMBase extends MastraBase {
2269
- #private;
2270
- constructor({ name, model }: {
2267
+ declare abstract class MastraLLMBase extends MastraBase {
2268
+ constructor({ name }: {
2271
2269
  name: string;
2272
- model: LanguageModel$1;
2273
2270
  });
2274
- getProvider(): string;
2275
- getModelId(): string;
2276
- getModel(): ai.LanguageModelV1;
2271
+ abstract getProvider(): string;
2272
+ abstract getModelId(): string;
2273
+ abstract __registerMastra(p: Mastra): void;
2274
+ abstract __text<Z extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextOptions<Z>): Promise<GenerateTextResult<any, any>>;
2275
+ abstract __textObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextObjectOptions<T>): Promise<GenerateObjectResult<T>>;
2276
+ abstract generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<GenerateReturn<Z>>;
2277
+ abstract __stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(input: LLMInnerStreamOptions<Z>): StreamTextResult<any, any>;
2278
+ abstract __streamObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMStreamObjectOptions<T>): StreamObjectResult<DeepPartial<T>, T, never>;
2279
+ abstract stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): StreamReturn<Z>;
2277
2280
  convertToMessages(messages: string | string[] | CoreMessage$1[]): CoreMessage$1[];
2278
2281
  __registerPrimitives(p: MastraPrimitives): void;
2279
- __registerMastra(p: Mastra): void;
2280
- __text<Z extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextOptions<Z>): Promise<GenerateTextResult<any, any>>;
2281
- __textObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextObjectOptions<T>): Promise<GenerateObjectResult<T>>;
2282
- generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<GenerateReturn<Z>>;
2283
- __stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(input: LLMInnerStreamOptions<Z>): Promise<StreamTextResult<any, any>>;
2284
- __streamObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMStreamObjectOptions<T>): Promise<StreamObjectResult<DeepPartial<T>, T, never>>;
2285
- stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<StreamReturn<Z>>;
2286
2282
  }
2287
2283
 
2288
2284
  declare function createMockModel({ objectGenerationMode, mockText, spyGenerate, spyStream, }: {
@@ -1,5 +1,4 @@
1
- import * as ai from 'ai';
2
- import { Tool as Tool$2, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, TextStreamPart, UserContent, AssistantContent, ToolContent, EmbeddingModel, UIMessage, Message, IDGenerator as IDGenerator$1, CoreSystemMessage as CoreSystemMessage$1, LanguageModel as LanguageModel$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
1
+ import { Tool as Tool$2, Schema, ToolExecutionOptions, LanguageModelV1, CoreMessage as CoreMessage$1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, TextStreamPart, UserContent, AssistantContent, ToolContent, EmbeddingModel, UIMessage, Message, IDGenerator as IDGenerator$1, CoreSystemMessage as CoreSystemMessage$1, DeepPartial, generateText, generateObject, streamText, streamObject, TelemetrySettings, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, GenerateTextOnStepFinishCallback, StreamTextOnFinishCallback, StreamObjectOnFinishCallback, StreamTextOnStepFinishCallback } from 'ai';
3
2
  import { M as MastraBase, a as Telemetry, O as OtelConfig, T as Trace } from './base-ClrXcCRx.js';
4
3
  import { z, ZodSchema, ZodObject } from 'zod';
5
4
  import { B as BaseLogMessage, R as RegisteredLogger, I as IMastraLogger, a as LogLevel } from './logger-Bpa2oLL4.js';
@@ -2265,24 +2264,21 @@ declare abstract class MastraMemory extends MastraBase {
2265
2264
  abstract getWorkingMemoryTemplate(): Promise<WorkingMemoryTemplate | null>;
2266
2265
  }
2267
2266
 
2268
- declare class MastraLLMBase extends MastraBase {
2269
- #private;
2270
- constructor({ name, model }: {
2267
+ declare abstract class MastraLLMBase extends MastraBase {
2268
+ constructor({ name }: {
2271
2269
  name: string;
2272
- model: LanguageModel$1;
2273
2270
  });
2274
- getProvider(): string;
2275
- getModelId(): string;
2276
- getModel(): ai.LanguageModelV1;
2271
+ abstract getProvider(): string;
2272
+ abstract getModelId(): string;
2273
+ abstract __registerMastra(p: Mastra): void;
2274
+ abstract __text<Z extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextOptions<Z>): Promise<GenerateTextResult<any, any>>;
2275
+ abstract __textObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextObjectOptions<T>): Promise<GenerateObjectResult<T>>;
2276
+ abstract generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<GenerateReturn<Z>>;
2277
+ abstract __stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(input: LLMInnerStreamOptions<Z>): StreamTextResult<any, any>;
2278
+ abstract __streamObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMStreamObjectOptions<T>): StreamObjectResult<DeepPartial<T>, T, never>;
2279
+ abstract stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): StreamReturn<Z>;
2277
2280
  convertToMessages(messages: string | string[] | CoreMessage$1[]): CoreMessage$1[];
2278
2281
  __registerPrimitives(p: MastraPrimitives): void;
2279
- __registerMastra(p: Mastra): void;
2280
- __text<Z extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextOptions<Z>): Promise<GenerateTextResult<any, any>>;
2281
- __textObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMTextObjectOptions<T>): Promise<GenerateObjectResult<T>>;
2282
- generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<GenerateReturn<Z>>;
2283
- __stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(input: LLMInnerStreamOptions<Z>): Promise<StreamTextResult<any, any>>;
2284
- __streamObject<T extends ZodSchema | JSONSchema7 | undefined>(input: LLMStreamObjectOptions<T>): Promise<StreamObjectResult<DeepPartial<T>, T, never>>;
2285
- stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], options: LLMStreamOptions<Z>): Promise<StreamReturn<Z>>;
2286
2282
  }
2287
2283
 
2288
2284
  declare function createMockModel({ objectGenerationMode, mockText, spyGenerate, spyStream, }: {
@@ -10,24 +10,11 @@ var zod = require('zod');
10
10
 
11
11
  // src/llm/model/base.ts
12
12
  var MastraLLMBase = class extends chunkP3Q73CAW_cjs.MastraBase {
13
- // @ts-ignore
14
- #mastra;
15
- #model;
16
- constructor({ name, model }) {
13
+ constructor({ name }) {
17
14
  super({
18
15
  component: chunkZIZ3CVHN_cjs.RegisteredLogger.LLM,
19
16
  name
20
17
  });
21
- this.#model = model;
22
- }
23
- getProvider() {
24
- return this.#model.provider;
25
- }
26
- getModelId() {
27
- return this.#model.modelId;
28
- }
29
- getModel() {
30
- return this.#model;
31
18
  }
32
19
  convertToMessages(messages) {
33
20
  if (Array.isArray(messages)) {
@@ -56,33 +43,6 @@ var MastraLLMBase = class extends chunkP3Q73CAW_cjs.MastraBase {
56
43
  this.__setLogger(p.logger);
57
44
  }
58
45
  }
59
- __registerMastra(p) {
60
- this.#mastra = p;
61
- }
62
- async __text(input) {
63
- this.logger.debug(`[LLMs:${this.name}] Generating text.`, { input });
64
- throw new Error("Method not implemented.");
65
- }
66
- async __textObject(input) {
67
- this.logger.debug(`[LLMs:${this.name}] Generating object.`, { input });
68
- throw new Error("Method not implemented.");
69
- }
70
- async generate(messages, options) {
71
- this.logger.debug(`[LLMs:${this.name}] Generating text.`, { messages, options });
72
- throw new Error("Method not implemented.");
73
- }
74
- async __stream(input) {
75
- this.logger.debug(`[LLMs:${this.name}] Streaming text.`, { input });
76
- throw new Error("Method not implemented.");
77
- }
78
- async __streamObject(input) {
79
- this.logger.debug(`[LLMs:${this.name}] Streaming object.`, { input });
80
- throw new Error("Method not implemented.");
81
- }
82
- async stream(messages, options) {
83
- this.logger.debug(`[LLMs:${this.name}] Streaming text.`, { messages, options });
84
- throw new Error("Method not implemented.");
85
- }
86
46
  };
87
47
 
88
48
  // src/llm/model/model.ts
@@ -90,7 +50,7 @@ var MastraLLM = class extends MastraLLMBase {
90
50
  #model;
91
51
  #mastra;
92
52
  constructor({ model, mastra }) {
93
- super({ name: "aisdk", model });
53
+ super({ name: "aisdk" });
94
54
  this.#model = model;
95
55
  if (mastra) {
96
56
  this.#mastra = mastra;
@@ -194,7 +154,6 @@ var MastraLLM = class extends MastraLLMBase {
194
154
  },
195
155
  e
196
156
  );
197
- this.logger.trackException(mastraError);
198
157
  throw mastraError;
199
158
  }
200
159
  this.logger.debug("[LLM] - Step Change:", {
@@ -254,7 +213,6 @@ var MastraLLM = class extends MastraLLMBase {
254
213
  },
255
214
  e
256
215
  );
257
- this.logger.trackException(mastraError);
258
216
  throw mastraError;
259
217
  }
260
218
  }
@@ -305,7 +263,6 @@ var MastraLLM = class extends MastraLLMBase {
305
263
  },
306
264
  e
307
265
  );
308
- this.logger.trackException(mastraError);
309
266
  throw mastraError;
310
267
  }
311
268
  this.logger.debug("[LLM] - Step Change:", {
@@ -356,11 +313,10 @@ var MastraLLM = class extends MastraLLMBase {
356
313
  },
357
314
  e
358
315
  );
359
- this.logger.trackException(mastraError);
360
316
  throw mastraError;
361
317
  }
362
318
  }
363
- async __stream({
319
+ __stream({
364
320
  messages,
365
321
  onStepFinish,
366
322
  onFinish,
@@ -487,7 +443,7 @@ var MastraLLM = class extends MastraLLMBase {
487
443
  }
488
444
  }
489
445
  try {
490
- return await ai.streamText({
446
+ return ai.streamText({
491
447
  messages,
492
448
  ...argsForExecute,
493
449
  experimental_telemetry: {
@@ -514,11 +470,10 @@ var MastraLLM = class extends MastraLLMBase {
514
470
  },
515
471
  e
516
472
  );
517
- this.logger.trackException(mastraError);
518
473
  throw mastraError;
519
474
  }
520
475
  }
521
- async __streamObject({
476
+ __streamObject({
522
477
  messages,
523
478
  runId,
524
479
  tools = {},
@@ -664,7 +619,6 @@ var MastraLLM = class extends MastraLLMBase {
664
619
  },
665
620
  e
666
621
  );
667
- this.logger.trackException(mastraError);
668
622
  throw mastraError;
669
623
  }
670
624
  }
@@ -684,16 +638,16 @@ var MastraLLM = class extends MastraLLMBase {
684
638
  ...rest
685
639
  });
686
640
  }
687
- async stream(messages, { maxSteps = 5, output, ...rest }) {
641
+ stream(messages, { maxSteps = 5, output, ...rest }) {
688
642
  const msgs = this.convertToMessages(messages);
689
643
  if (!output) {
690
- return await this.__stream({
644
+ return this.__stream({
691
645
  messages: msgs,
692
646
  maxSteps,
693
647
  ...rest
694
648
  });
695
649
  }
696
- return await this.__streamObject({
650
+ return this.__streamObject({
697
651
  messages: msgs,
698
652
  structuredOutput: output,
699
653
  maxSteps,
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkBB6DPGIV_cjs = require('./chunk-BB6DPGIV.cjs');
4
- var chunkWTC6DJHD_cjs = require('./chunk-WTC6DJHD.cjs');
4
+ var chunkV4ONHDHV_cjs = require('./chunk-V4ONHDHV.cjs');
5
5
  var chunk4Z3OU5RY_cjs = require('./chunk-4Z3OU5RY.cjs');
6
6
  var chunkB6TOBUS6_cjs = require('./chunk-B6TOBUS6.cjs');
7
7
  var chunkP3Q73CAW_cjs = require('./chunk-P3Q73CAW.cjs');
@@ -1301,7 +1301,7 @@ function mapVariable(config) {
1301
1301
  return config;
1302
1302
  }
1303
1303
  function createStep(params) {
1304
- if (params instanceof chunkWTC6DJHD_cjs.Agent) {
1304
+ if (params instanceof chunkV4ONHDHV_cjs.Agent) {
1305
1305
  return {
1306
1306
  id: params.name,
1307
1307
  // @ts-ignore
@@ -1,5 +1,5 @@
1
1
  import { EMITTER_SYMBOL } from './chunk-Y7D2JLKS.js';
2
- import { Agent } from './chunk-XR7OX4ZC.js';
2
+ import { Agent } from './chunk-YFXNOA63.js';
3
3
  import { Tool } from './chunk-C4LMN2IR.js';
4
4
  import { MastraError } from './chunk-6UNGH46J.js';
5
5
  import { MastraBase } from './chunk-5IEKR756.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkWTC6DJHD_cjs = require('./chunk-WTC6DJHD.cjs');
3
+ var chunkV4ONHDHV_cjs = require('./chunk-V4ONHDHV.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 chunkWTC6DJHD_cjs.Agent({
41
+ this.agent = new chunkV4ONHDHV_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.
@@ -3,7 +3,7 @@
3
3
  var chunkZPOUMTTH_cjs = require('./chunk-ZPOUMTTH.cjs');
4
4
  var chunkQUSEDVYI_cjs = require('./chunk-QUSEDVYI.cjs');
5
5
  var chunkST5RMVLG_cjs = require('./chunk-ST5RMVLG.cjs');
6
- var chunkVUEY4BUU_cjs = require('./chunk-VUEY4BUU.cjs');
6
+ var chunkE7AX3U6M_cjs = require('./chunk-E7AX3U6M.cjs');
7
7
  var chunkQQ5K5TZE_cjs = require('./chunk-QQ5K5TZE.cjs');
8
8
  var chunk7F6BQXE2_cjs = require('./chunk-7F6BQXE2.cjs');
9
9
  var chunkB6TOBUS6_cjs = require('./chunk-B6TOBUS6.cjs');
@@ -565,7 +565,7 @@ exports.Agent = class Agent extends (_a = chunkP3Q73CAW_cjs.MastraBase) {
565
565
  runtimeContext
566
566
  });
567
567
  return resolveMaybePromise(modelToUse, resolvedModel => {
568
- const llm = new chunkVUEY4BUU_cjs.MastraLLM({
568
+ const llm = new chunkE7AX3U6M_cjs.MastraLLM({
569
569
  model: resolvedModel,
570
570
  mastra: this.#mastra
571
571
  });
@@ -1679,7 +1679,7 @@ ${JSON.stringify(
1679
1679
  this.logger.debug(`Starting agent ${this.name} llm stream call`, {
1680
1680
  runId
1681
1681
  });
1682
- const streamResult = await llm.__stream({
1682
+ const streamResult = llm.__stream({
1683
1683
  messages: messageObjects,
1684
1684
  temperature,
1685
1685
  tools: convertedTools,
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-XR7OX4ZC.js';
1
+ import { Agent } from './chunk-YFXNOA63.js';
2
2
  import { CohereClient } from 'cohere-ai';
3
3
 
4
4
  var CohereRelevanceScorer = class {
@@ -1,7 +1,7 @@
1
1
  import { DefaultVoice } from './chunk-5HTMDAXP.js';
2
2
  import { MessageList } from './chunk-4UBOJFSL.js';
3
3
  import { executeHook } from './chunk-BB4KXGBU.js';
4
- import { MastraLLM } from './chunk-EJI2SQJP.js';
4
+ import { MastraLLM } from './chunk-YJEHXYK5.js';
5
5
  import { InstrumentClass } from './chunk-TC2SCOTE.js';
6
6
  import { ensureToolProperties, makeCoreTool, createMastraProxy } from './chunk-DFFVEKIG.js';
7
7
  import { MastraError } from './chunk-6UNGH46J.js';
@@ -1672,7 +1672,7 @@ ${JSON.stringify(
1672
1672
  this.logger.debug(`Starting agent ${this.name} llm stream call`, {
1673
1673
  runId
1674
1674
  });
1675
- const streamResult = await llm.__stream({
1675
+ const streamResult = llm.__stream({
1676
1676
  messages: messageObjects,
1677
1677
  temperature,
1678
1678
  tools: convertedTools,
@@ -8,24 +8,11 @@ import { z } from 'zod';
8
8
 
9
9
  // src/llm/model/base.ts
10
10
  var MastraLLMBase = class extends MastraBase {
11
- // @ts-ignore
12
- #mastra;
13
- #model;
14
- constructor({ name, model }) {
11
+ constructor({ name }) {
15
12
  super({
16
13
  component: RegisteredLogger.LLM,
17
14
  name
18
15
  });
19
- this.#model = model;
20
- }
21
- getProvider() {
22
- return this.#model.provider;
23
- }
24
- getModelId() {
25
- return this.#model.modelId;
26
- }
27
- getModel() {
28
- return this.#model;
29
16
  }
30
17
  convertToMessages(messages) {
31
18
  if (Array.isArray(messages)) {
@@ -54,33 +41,6 @@ var MastraLLMBase = class extends MastraBase {
54
41
  this.__setLogger(p.logger);
55
42
  }
56
43
  }
57
- __registerMastra(p) {
58
- this.#mastra = p;
59
- }
60
- async __text(input) {
61
- this.logger.debug(`[LLMs:${this.name}] Generating text.`, { input });
62
- throw new Error("Method not implemented.");
63
- }
64
- async __textObject(input) {
65
- this.logger.debug(`[LLMs:${this.name}] Generating object.`, { input });
66
- throw new Error("Method not implemented.");
67
- }
68
- async generate(messages, options) {
69
- this.logger.debug(`[LLMs:${this.name}] Generating text.`, { messages, options });
70
- throw new Error("Method not implemented.");
71
- }
72
- async __stream(input) {
73
- this.logger.debug(`[LLMs:${this.name}] Streaming text.`, { input });
74
- throw new Error("Method not implemented.");
75
- }
76
- async __streamObject(input) {
77
- this.logger.debug(`[LLMs:${this.name}] Streaming object.`, { input });
78
- throw new Error("Method not implemented.");
79
- }
80
- async stream(messages, options) {
81
- this.logger.debug(`[LLMs:${this.name}] Streaming text.`, { messages, options });
82
- throw new Error("Method not implemented.");
83
- }
84
44
  };
85
45
 
86
46
  // src/llm/model/model.ts
@@ -88,7 +48,7 @@ var MastraLLM = class extends MastraLLMBase {
88
48
  #model;
89
49
  #mastra;
90
50
  constructor({ model, mastra }) {
91
- super({ name: "aisdk", model });
51
+ super({ name: "aisdk" });
92
52
  this.#model = model;
93
53
  if (mastra) {
94
54
  this.#mastra = mastra;
@@ -192,7 +152,6 @@ var MastraLLM = class extends MastraLLMBase {
192
152
  },
193
153
  e
194
154
  );
195
- this.logger.trackException(mastraError);
196
155
  throw mastraError;
197
156
  }
198
157
  this.logger.debug("[LLM] - Step Change:", {
@@ -252,7 +211,6 @@ var MastraLLM = class extends MastraLLMBase {
252
211
  },
253
212
  e
254
213
  );
255
- this.logger.trackException(mastraError);
256
214
  throw mastraError;
257
215
  }
258
216
  }
@@ -303,7 +261,6 @@ var MastraLLM = class extends MastraLLMBase {
303
261
  },
304
262
  e
305
263
  );
306
- this.logger.trackException(mastraError);
307
264
  throw mastraError;
308
265
  }
309
266
  this.logger.debug("[LLM] - Step Change:", {
@@ -354,11 +311,10 @@ var MastraLLM = class extends MastraLLMBase {
354
311
  },
355
312
  e
356
313
  );
357
- this.logger.trackException(mastraError);
358
314
  throw mastraError;
359
315
  }
360
316
  }
361
- async __stream({
317
+ __stream({
362
318
  messages,
363
319
  onStepFinish,
364
320
  onFinish,
@@ -485,7 +441,7 @@ var MastraLLM = class extends MastraLLMBase {
485
441
  }
486
442
  }
487
443
  try {
488
- return await streamText({
444
+ return streamText({
489
445
  messages,
490
446
  ...argsForExecute,
491
447
  experimental_telemetry: {
@@ -512,11 +468,10 @@ var MastraLLM = class extends MastraLLMBase {
512
468
  },
513
469
  e
514
470
  );
515
- this.logger.trackException(mastraError);
516
471
  throw mastraError;
517
472
  }
518
473
  }
519
- async __streamObject({
474
+ __streamObject({
520
475
  messages,
521
476
  runId,
522
477
  tools = {},
@@ -662,7 +617,6 @@ var MastraLLM = class extends MastraLLMBase {
662
617
  },
663
618
  e
664
619
  );
665
- this.logger.trackException(mastraError);
666
620
  throw mastraError;
667
621
  }
668
622
  }
@@ -682,16 +636,16 @@ var MastraLLM = class extends MastraLLMBase {
682
636
  ...rest
683
637
  });
684
638
  }
685
- async stream(messages, { maxSteps = 5, output, ...rest }) {
639
+ stream(messages, { maxSteps = 5, output, ...rest }) {
686
640
  const msgs = this.convertToMessages(messages);
687
641
  if (!output) {
688
- return await this.__stream({
642
+ return this.__stream({
689
643
  messages: msgs,
690
644
  maxSteps,
691
645
  ...rest
692
646
  });
693
647
  }
694
- return await this.__streamObject({
648
+ return this.__streamObject({
695
649
  messages: msgs,
696
650
  structuredOutput: output,
697
651
  maxSteps,
@@ -1,6 +1,6 @@
1
1
  import { M as Metric, T as TestInfo, E as EvaluationResult } from '../types-Bo1uigWx.cjs';
2
2
  export { a as MetricResult } from '../types-Bo1uigWx.cjs';
3
- import { A as Agent } from '../base-DpaaEQWN.cjs';
3
+ import { A as Agent } from '../base-CevbNCZz.cjs';
4
4
  import 'ai';
5
5
  import '../base-B_y9sMg0.cjs';
6
6
  import '@opentelemetry/api';
@@ -1,6 +1,6 @@
1
1
  import { M as Metric, T as TestInfo, E as EvaluationResult } from '../types-Bo1uigWx.js';
2
2
  export { a as MetricResult } from '../types-Bo1uigWx.js';
3
- import { A as Agent } from '../base-BBkhRGjp.js';
3
+ import { A as Agent } from '../base-r5AnlfyA.js';
4
4
  import 'ai';
5
5
  import '../base-ClrXcCRx.js';
6
6
  import '@opentelemetry/api';
package/dist/index.cjs CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  var chunkGWFS5DAR_cjs = require('./chunk-GWFS5DAR.cjs');
4
4
  var chunkMP2QBLUJ_cjs = require('./chunk-MP2QBLUJ.cjs');
5
- var chunkFL4BYLDK_cjs = require('./chunk-FL4BYLDK.cjs');
5
+ var chunkLK3JMAG3_cjs = require('./chunk-LK3JMAG3.cjs');
6
6
  var chunk2GRYVZ2O_cjs = require('./chunk-2GRYVZ2O.cjs');
7
- var chunkZJSVUBYU_cjs = require('./chunk-ZJSVUBYU.cjs');
7
+ var chunkTPVJVBKI_cjs = require('./chunk-TPVJVBKI.cjs');
8
8
  var chunkF2WMR75C_cjs = require('./chunk-F2WMR75C.cjs');
9
9
  var chunkJ52TXHZV_cjs = require('./chunk-J52TXHZV.cjs');
10
10
  var chunkB7SQOKEC_cjs = require('./chunk-B7SQOKEC.cjs');
11
11
  var chunkMUNFCOMB_cjs = require('./chunk-MUNFCOMB.cjs');
12
12
  var chunk7H2GET5Z_cjs = require('./chunk-7H2GET5Z.cjs');
13
- var chunkWTC6DJHD_cjs = require('./chunk-WTC6DJHD.cjs');
13
+ var chunkV4ONHDHV_cjs = require('./chunk-V4ONHDHV.cjs');
14
14
  var chunkST5RMVLG_cjs = require('./chunk-ST5RMVLG.cjs');
15
15
  var chunkQQ5K5TZE_cjs = require('./chunk-QQ5K5TZE.cjs');
16
16
  var chunk7F6BQXE2_cjs = require('./chunk-7F6BQXE2.cjs');
@@ -19,7 +19,7 @@ var chunkZZLBNB3U_cjs = require('./chunk-ZZLBNB3U.cjs');
19
19
  var chunkP3Q73CAW_cjs = require('./chunk-P3Q73CAW.cjs');
20
20
 
21
21
  // src/agent/index.warning.ts
22
- var Agent2 = class extends chunkWTC6DJHD_cjs.Agent {
22
+ var Agent2 = class extends chunkV4ONHDHV_cjs.Agent {
23
23
  constructor(config) {
24
24
  super(config);
25
25
  this.logger.warn('Please import "Agent from "@mastra/core/agent" instead of "@mastra/core"');
@@ -101,7 +101,7 @@ var MastraVector2 = class extends chunkMP2QBLUJ_cjs.MastraVector {
101
101
  };
102
102
 
103
103
  // src/workflows/workflow.warning.ts
104
- var Workflow2 = class extends chunkFL4BYLDK_cjs.Workflow {
104
+ var Workflow2 = class extends chunkLK3JMAG3_cjs.Workflow {
105
105
  constructor(args) {
106
106
  super(args);
107
107
  this.logger.warn('Please import "Workflow" from "@mastra/core/workflows" instead of "@mastra/core"');
@@ -110,35 +110,35 @@ var Workflow2 = class extends chunkFL4BYLDK_cjs.Workflow {
110
110
 
111
111
  Object.defineProperty(exports, "DefaultExecutionEngine", {
112
112
  enumerable: true,
113
- get: function () { return chunkFL4BYLDK_cjs.DefaultExecutionEngine; }
113
+ get: function () { return chunkLK3JMAG3_cjs.DefaultExecutionEngine; }
114
114
  });
115
115
  Object.defineProperty(exports, "ExecutionEngine", {
116
116
  enumerable: true,
117
- get: function () { return chunkFL4BYLDK_cjs.ExecutionEngine; }
117
+ get: function () { return chunkLK3JMAG3_cjs.ExecutionEngine; }
118
118
  });
119
119
  Object.defineProperty(exports, "Run", {
120
120
  enumerable: true,
121
- get: function () { return chunkFL4BYLDK_cjs.Run; }
121
+ get: function () { return chunkLK3JMAG3_cjs.Run; }
122
122
  });
123
123
  Object.defineProperty(exports, "cloneStep", {
124
124
  enumerable: true,
125
- get: function () { return chunkFL4BYLDK_cjs.cloneStep; }
125
+ get: function () { return chunkLK3JMAG3_cjs.cloneStep; }
126
126
  });
127
127
  Object.defineProperty(exports, "cloneWorkflow", {
128
128
  enumerable: true,
129
- get: function () { return chunkFL4BYLDK_cjs.cloneWorkflow; }
129
+ get: function () { return chunkLK3JMAG3_cjs.cloneWorkflow; }
130
130
  });
131
131
  Object.defineProperty(exports, "createStep", {
132
132
  enumerable: true,
133
- get: function () { return chunkFL4BYLDK_cjs.createStep; }
133
+ get: function () { return chunkLK3JMAG3_cjs.createStep; }
134
134
  });
135
135
  Object.defineProperty(exports, "createWorkflow", {
136
136
  enumerable: true,
137
- get: function () { return chunkFL4BYLDK_cjs.createWorkflow; }
137
+ get: function () { return chunkLK3JMAG3_cjs.createWorkflow; }
138
138
  });
139
139
  Object.defineProperty(exports, "mapVariable", {
140
140
  enumerable: true,
141
- get: function () { return chunkFL4BYLDK_cjs.mapVariable; }
141
+ get: function () { return chunkLK3JMAG3_cjs.mapVariable; }
142
142
  });
143
143
  Object.defineProperty(exports, "MemoryProcessor", {
144
144
  enumerable: true,
@@ -150,15 +150,15 @@ Object.defineProperty(exports, "memoryDefaultOptions", {
150
150
  });
151
151
  Object.defineProperty(exports, "CohereRelevanceScorer", {
152
152
  enumerable: true,
153
- get: function () { return chunkZJSVUBYU_cjs.CohereRelevanceScorer; }
153
+ get: function () { return chunkTPVJVBKI_cjs.CohereRelevanceScorer; }
154
154
  });
155
155
  Object.defineProperty(exports, "MastraAgentRelevanceScorer", {
156
156
  enumerable: true,
157
- get: function () { return chunkZJSVUBYU_cjs.MastraAgentRelevanceScorer; }
157
+ get: function () { return chunkTPVJVBKI_cjs.MastraAgentRelevanceScorer; }
158
158
  });
159
159
  Object.defineProperty(exports, "createSimilarityPrompt", {
160
160
  enumerable: true,
161
- get: function () { return chunkZJSVUBYU_cjs.createSimilarityPrompt; }
161
+ get: function () { return chunkTPVJVBKI_cjs.createSimilarityPrompt; }
162
162
  });
163
163
  Object.defineProperty(exports, "Metric", {
164
164
  enumerable: true,