@mastra/core 0.4.0 → 0.4.2-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 (52) hide show
  1. package/dist/agent/index.d.ts +4 -3
  2. package/dist/agent/index.js +1 -1
  3. package/dist/{base-BTUaTXvc.d.ts → base-BdNHFjqH.d.ts} +34 -3
  4. package/dist/{base-CmtknnDz.d.ts → base-eWkcLLSb.d.ts} +1 -8
  5. package/dist/base.d.ts +2 -2
  6. package/dist/base.js +1 -1
  7. package/dist/bundler/index.d.ts +2 -2
  8. package/dist/bundler/index.js +1 -1
  9. package/dist/{chunk-SYZAQCKZ.js → chunk-6RDA4JYW.js} +1 -18
  10. package/dist/{chunk-VIJVUFTB.js → chunk-7NPRQT5A.js} +9 -1
  11. package/dist/{chunk-DAWQ5R4C.js → chunk-HPIB5X7E.js} +2 -2
  12. package/dist/{chunk-6CWY2XAM.js → chunk-JIV6PDIN.js} +1 -1
  13. package/dist/{chunk-XS2VY7YW.js → chunk-KP5SHTKA.js} +3 -1
  14. package/dist/{chunk-KDUL7NPA.js → chunk-LKOVXFLE.js} +1 -1
  15. package/dist/{chunk-ILKS57KK.js → chunk-N7KZVQDK.js} +1 -1
  16. package/dist/{chunk-WVNTGARP.js → chunk-NDQR6IPC.js} +1 -1
  17. package/dist/{chunk-63KLSI2Y.js → chunk-ORM3OCHX.js} +72 -24
  18. package/dist/{chunk-PI5YQB75.js → chunk-TCMOYQ74.js} +1 -1
  19. package/dist/{chunk-KMVLZUIO.js → chunk-XD7K4XPP.js} +4 -4
  20. package/dist/{chunk-DIMNBNEX.js → chunk-YUOADWSP.js} +1 -1
  21. package/dist/{chunk-COG5YSSN.js → chunk-Z735LDV7.js} +1 -1
  22. package/dist/deployer/index.d.ts +2 -2
  23. package/dist/deployer/index.js +1 -1
  24. package/dist/eval/index.d.ts +4 -3
  25. package/dist/{index-BIpeWPEO.d.ts → index-C5uPdbs4.d.ts} +7 -3
  26. package/dist/index.d.ts +9 -8
  27. package/dist/index.js +16 -16
  28. package/dist/integration/index.d.ts +5 -4
  29. package/dist/llm/index.d.ts +4 -3
  30. package/dist/logger/index.d.ts +1 -1
  31. package/dist/logger/index.js +1 -1
  32. package/dist/mastra/index.d.ts +5 -4
  33. package/dist/mastra/index.js +1 -1
  34. package/dist/memory/index.d.ts +4 -3
  35. package/dist/memory/index.js +1 -1
  36. package/dist/relevance/index.js +1 -1
  37. package/dist/storage/index.d.ts +5 -4
  38. package/dist/storage/index.js +2 -2
  39. package/dist/telemetry/index.d.ts +4 -3
  40. package/dist/tools/index.d.ts +5 -4
  41. package/dist/tts/index.d.ts +2 -2
  42. package/dist/tts/index.js +1 -1
  43. package/dist/vector/index.d.ts +2 -2
  44. package/dist/vector/index.js +1 -1
  45. package/dist/vector/libsql/index.d.ts +2 -2
  46. package/dist/vector/libsql/index.js +1 -1
  47. package/dist/voice/index.d.ts +19 -4
  48. package/dist/voice/index.js +37 -4
  49. package/dist/{workflow-CwuYLcTS.d.ts → workflow-CbKcJz7a.d.ts} +2 -2
  50. package/dist/workflows/index.d.ts +6 -5
  51. package/dist/workflows/index.js +1 -1
  52. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { A as Agent } from '../base-BTUaTXvc.js';
5
- import '../base-CmtknnDz.js';
4
+ export { A as Agent } from '../base-BdNHFjqH.js';
5
+ import '../base-eWkcLLSb.js';
6
6
  import '../types-m9RryK9a.js';
7
+ import '../voice/index.js';
7
8
  import 'sift';
8
9
  import '../vector/index.js';
9
10
  import '@opentelemetry/api';
10
- import '../index-BIpeWPEO.js';
11
+ import '../index-C5uPdbs4.js';
11
12
  import 'pino';
12
13
  import 'stream';
13
14
  import '@opentelemetry/sdk-trace-base';
@@ -1 +1 @@
1
- export { Agent } from '../chunk-63KLSI2Y.js';
1
+ export { Agent } from '../chunk-ORM3OCHX.js';
@@ -1,12 +1,13 @@
1
1
  import * as ai from 'ai';
2
2
  import { EmbeddingModel, CoreMessage as CoreMessage$1, Message, UserContent, AssistantContent, LanguageModelV1, GenerateTextResult, GenerateObjectResult, StreamTextResult, StreamObjectResult, CoreSystemMessage as CoreSystemMessage$1, CoreAssistantMessage as CoreAssistantMessage$1, CoreUserMessage as CoreUserMessage$1, CoreToolMessage as CoreToolMessage$1, EmbedResult as EmbedResult$1, EmbedManyResult as EmbedManyResult$1, LanguageModel as LanguageModel$1, DeepPartial, ToolContent } from 'ai';
3
- import { M as MastraBase, T as Telemetry } from './base-CmtknnDz.js';
3
+ import { M as MastraBase, T as Telemetry } from './base-eWkcLLSb.js';
4
4
  import { a as Metric, M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
5
5
  import { Query } from 'sift';
6
6
  import { z, ZodSchema } from 'zod';
7
7
  import { JSONSchema7 } from 'json-schema';
8
8
  import { MastraVector } from './vector/index.js';
9
- import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, d as Run } from './index-BIpeWPEO.js';
9
+ import { CompositeVoice } from './voice/index.js';
10
+ import { B as BaseLogMessage, R as RegisteredLogger, L as Logger, d as Run } from './index-C5uPdbs4.js';
10
11
  import { MastraTTS } from './tts/index.js';
11
12
 
12
13
  /**
@@ -460,6 +461,7 @@ interface AgentConfig<TTools extends Record<string, ToolAction<any, any, any, an
460
461
  metrics?: TMetrics;
461
462
  evals?: TMetrics;
462
463
  memory?: MastraMemory;
464
+ voice?: CompositeVoice;
463
465
  }
464
466
  interface AgentGenerateOptions<Z extends ZodSchema | JSONSchema7 | undefined = undefined> {
465
467
  toolsets?: ToolsetsInput;
@@ -584,6 +586,7 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
584
586
  /** @deprecated This property is deprecated. Use evals instead. */
585
587
  metrics: TMetrics;
586
588
  evals: TMetrics;
589
+ voice?: CompositeVoice;
587
590
  constructor(config: AgentConfig<TTools, TMetrics>);
588
591
  hasOwnMemory(): boolean;
589
592
  getMemory(): MastraMemory | undefined;
@@ -609,7 +612,7 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
609
612
  runId?: string;
610
613
  }): Promise<{
611
614
  threadId: string;
612
- messages: any[];
615
+ messages: NonNullable<CoreMessage$1 | null>[];
613
616
  }>;
614
617
  saveResponse({ result, threadId, resourceId, runId, memoryConfig, }: {
615
618
  runId: string;
@@ -658,6 +661,34 @@ declare class Agent<TTools extends Record<string, ToolAction<any, any, any, any>
658
661
  };
659
662
  generate<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps, onStepFinish, runId, toolsets, output, temperature, toolChoice, }?: AgentGenerateOptions<Z>): Promise<GenerateReturn<Z>>;
660
663
  stream<Z extends ZodSchema | JSONSchema7 | undefined = undefined>(messages: string | string[] | CoreMessage$1[], { context, threadId: threadIdInFn, memoryOptions, resourceId, maxSteps, onFinish, onStepFinish, runId, toolsets, output, temperature, toolChoice, }?: AgentStreamOptions<Z>): Promise<StreamReturn<Z>>;
664
+ /**
665
+ * Convert text to speech using the configured voice provider
666
+ * @param input Text or text stream to convert to speech
667
+ * @param options Speech options including speaker and provider-specific options
668
+ * @returns Audio stream
669
+ */
670
+ speak(input: string | NodeJS.ReadableStream, options?: {
671
+ speaker?: string;
672
+ [key: string]: any;
673
+ }): Promise<NodeJS.ReadableStream>;
674
+ /**
675
+ * Convert speech to text using the configured voice provider
676
+ * @param audioStream Audio stream to transcribe
677
+ * @param options Provider-specific transcription options
678
+ * @returns Text or text stream
679
+ */
680
+ listen(audioStream: NodeJS.ReadableStream, options?: {
681
+ [key: string]: any;
682
+ }): Promise<string | NodeJS.ReadableStream>;
683
+ /**
684
+ * Get a list of available speakers from the configured voice provider
685
+ * @throws {Error} If no voice provider is configured
686
+ * @returns {Promise<Array<{voiceId: string}>>} List of available speakers
687
+ */
688
+ getSpeakers(): Promise<{
689
+ [key: string]: any;
690
+ voiceId: string;
691
+ }[]>;
661
692
  }
662
693
 
663
694
  interface StorageColumn {
@@ -1,6 +1,6 @@
1
1
  import * as _opentelemetry_api from '@opentelemetry/api';
2
2
  import { Tracer, Span } from '@opentelemetry/api';
3
- import { R as RegisteredLogger, L as Logger, a as LogLevel } from './index-BIpeWPEO.js';
3
+ import { R as RegisteredLogger, L as Logger } from './index-C5uPdbs4.js';
4
4
  import { SpanExporter } from '@opentelemetry/sdk-trace-base';
5
5
 
6
6
  /** Sampling strategy configuration for OpenTelemetry */
@@ -120,13 +120,6 @@ declare class MastraBase {
120
120
  * @param logger
121
121
  */
122
122
  __setLogger(logger: Logger): void;
123
- /**
124
- * Internal logging helper that formats and sends logs to the configured logger
125
- * @param level - Severity level of the log
126
- * @param message - Main log message
127
- * @param opts - Optional object for the log
128
- */
129
- log(level: LogLevel, message: string, opts?: Record<string, any>): void;
130
123
  /**
131
124
  * Set the telemetry for the
132
125
  * @param telemetry
package/dist/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import '@opentelemetry/api';
2
- import './index-BIpeWPEO.js';
3
- export { M as MastraBase } from './base-CmtknnDz.js';
2
+ import './index-C5uPdbs4.js';
3
+ export { M as MastraBase } from './base-eWkcLLSb.js';
4
4
  import 'pino';
5
5
  import 'stream';
6
6
  import '@opentelemetry/sdk-trace-base';
package/dist/base.js CHANGED
@@ -1 +1 @@
1
- export { MastraBase } from './chunk-SYZAQCKZ.js';
1
+ export { MastraBase } from './chunk-6RDA4JYW.js';
@@ -1,6 +1,6 @@
1
- import { M as MastraBase } from '../base-CmtknnDz.js';
1
+ import { M as MastraBase } from '../base-eWkcLLSb.js';
2
2
  import '@opentelemetry/api';
3
- import '../index-BIpeWPEO.js';
3
+ import '../index-C5uPdbs4.js';
4
4
  import 'pino';
5
5
  import 'stream';
6
6
  import '@opentelemetry/sdk-trace-base';
@@ -1 +1 @@
1
- export { MastraBundler } from '../chunk-DIMNBNEX.js';
1
+ export { MastraBundler } from '../chunk-YUOADWSP.js';
@@ -1,4 +1,4 @@
1
- import { RegisteredLogger, createLogger } from './chunk-XS2VY7YW.js';
1
+ import { RegisteredLogger, createLogger } from './chunk-KP5SHTKA.js';
2
2
 
3
3
  // src/base.ts
4
4
  var MastraBase = class {
@@ -19,23 +19,6 @@ var MastraBase = class {
19
19
  this.logger = logger;
20
20
  this.logger.debug(`Logger updated [component=${this.component}] [name=${this.name}]`);
21
21
  }
22
- /**
23
- * Internal logging helper that formats and sends logs to the configured logger
24
- * @param level - Severity level of the log
25
- * @param message - Main log message
26
- * @param opts - Optional object for the log
27
- */
28
- log(level, message, opts) {
29
- if (!this.logger) return;
30
- const logMessage = {
31
- type: this.component,
32
- message,
33
- destinationPath: this.name ? `${this.component}/${this.name}` : this.component,
34
- ...opts || {}
35
- };
36
- const logMethod = level.toLowerCase();
37
- this.logger[logMethod]?.(logMessage);
38
- }
39
22
  /**
40
23
  * Set the telemetry for the
41
24
  * @param telemetry
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-SYZAQCKZ.js';
1
+ import { MastraBase } from './chunk-6RDA4JYW.js';
2
2
  import { experimental_customProvider } from 'ai';
3
3
  import node_modulesPath from 'node_modules-path';
4
4
  import path from 'path';
@@ -46,6 +46,14 @@ const memory = new Memory({
46
46
  })
47
47
 
48
48
  Visit https://sdk.vercel.ai/docs/foundations/overview#embedding-models to find an alternate embedding provider
49
+
50
+ If you do not want to use the Memory semantic recall feature, you can disable it entirely and this error will go away.
51
+
52
+ const memory = new Memory({
53
+ options: {
54
+ semanticRecall: false // <- an embedder will not be required with this set to false
55
+ }
56
+ })
49
57
  `);
50
58
  }
51
59
  const { FlagEmbedding, EmbeddingModel } = mod;
@@ -1,6 +1,6 @@
1
- import { DefaultStorage } from './chunk-6CWY2XAM.js';
1
+ import { DefaultStorage } from './chunk-JIV6PDIN.js';
2
2
  import { InstrumentClass, OTLPTraceExporter, Telemetry } from './chunk-4ZRHVG25.js';
3
- import { createLogger, LogLevel, noopLogger } from './chunk-XS2VY7YW.js';
3
+ import { createLogger, LogLevel, noopLogger } from './chunk-KP5SHTKA.js';
4
4
  import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
5
5
 
6
6
  // src/mastra/index.ts
@@ -1,5 +1,5 @@
1
1
  import { TABLE_WORKFLOW_SNAPSHOT, TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES } from './chunk-RG66XEJT.js';
2
- import { MastraBase } from './chunk-SYZAQCKZ.js';
2
+ import { MastraBase } from './chunk-6RDA4JYW.js';
3
3
  import { createClient } from '@libsql/client';
4
4
  import { join } from 'node:path';
5
5
 
@@ -24,8 +24,10 @@ var LogLevel = {
24
24
  NONE: "silent"
25
25
  };
26
26
  var LoggerTransport = class extends Transform {
27
+ constructor(opts = {}) {
28
+ super({ ...opts, objectMode: true });
29
+ }
27
30
  async getLogsByRunId({ runId }) {
28
- console.log(runId);
29
31
  return [];
30
32
  }
31
33
  async getLogs() {
@@ -1,4 +1,4 @@
1
- import { MastraVector } from './chunk-VIJVUFTB.js';
1
+ import { MastraVector } from './chunk-7NPRQT5A.js';
2
2
  import { BaseFilterTranslator } from './chunk-SIFBBGY6.js';
3
3
  import { createClient } from '@libsql/client';
4
4
  import { join } from 'path';
@@ -1,4 +1,4 @@
1
- import { Agent } from './chunk-63KLSI2Y.js';
1
+ import { Agent } from './chunk-ORM3OCHX.js';
2
2
  import { CohereClient } from 'cohere-ai';
3
3
 
4
4
  var CohereRelevanceScorer = class {
@@ -1,5 +1,5 @@
1
1
  import { InstrumentClass } from './chunk-4ZRHVG25.js';
2
- import { MastraBase } from './chunk-SYZAQCKZ.js';
2
+ import { MastraBase } from './chunk-6RDA4JYW.js';
3
3
  import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
4
4
 
5
5
  // src/tts/index.ts
@@ -1,8 +1,8 @@
1
1
  import { InstrumentClass } from './chunk-4ZRHVG25.js';
2
2
  import { delay } from './chunk-WIBGG4X6.js';
3
+ import { MastraBase } from './chunk-6RDA4JYW.js';
4
+ import { RegisteredLogger } from './chunk-KP5SHTKA.js';
3
5
  import { executeHook } from './chunk-BB4KXGBU.js';
4
- import { MastraBase } from './chunk-SYZAQCKZ.js';
5
- import { RegisteredLogger, LogLevel } from './chunk-XS2VY7YW.js';
6
6
  import { __decoratorStart, __decorateElement, __runInitializers } from './chunk-C6A6W6XS.js';
7
7
  import { randomUUID } from 'crypto';
8
8
  import { z } from 'zod';
@@ -517,6 +517,7 @@ var Agent = class extends (_a = MastraBase) {
517
517
  /** @deprecated This property is deprecated. Use evals instead. */
518
518
  metrics;
519
519
  evals;
520
+ voice;
520
521
  constructor(config) {
521
522
  super({
522
523
  component: RegisteredLogger.AGENT
@@ -549,6 +550,9 @@ var Agent = class extends (_a = MastraBase) {
549
550
  if (config.memory) {
550
551
  this.#memory = config.memory;
551
552
  }
553
+ if (config.voice) {
554
+ this.voice = config.voice;
555
+ }
552
556
  }
553
557
  hasOwnMemory() {
554
558
  return Boolean(this.#memory);
@@ -698,7 +702,7 @@ var Agent = class extends (_a = MastraBase) {
698
702
  memoryConfig
699
703
  });
700
704
  }
701
- this.log(LogLevel.DEBUG, "Saved messages to memory", {
705
+ this.logger.debug("Saved messages to memory", {
702
706
  threadId: thread.id,
703
707
  runId
704
708
  });
@@ -708,24 +712,10 @@ var Agent = class extends (_a = MastraBase) {
708
712
  }) : null;
709
713
  return {
710
714
  threadId: thread.id,
711
- messages: [{
715
+ messages: [memorySystemMessage ? {
712
716
  role: "system",
713
- content: `
714
-
715
- Analyze this message to determine if the user is referring to a previous conversation with the LLM.
716
- Specifically, identify if the user wants to reference specific information from that chat or if they want the LLM to use the previous chat messages as context for the current conversation.
717
- Extract any date ranges mentioned in the user message that could help identify the previous chat.
718
- Return dates in ISO format.
719
- If no specific dates are mentioned but time periods are (like "last week" or "past month"), calculate the appropriate date range.
720
- For the end date, return the date 1 day after the end of the time period.
721
- Today's date is ${(/* @__PURE__ */new Date()).toISOString()} and the time is ${(/* @__PURE__ */new Date()).toLocaleTimeString("en-US", {
722
- hour: "numeric",
723
- minute: "numeric",
724
- hour12: true
725
- })} ${memorySystemMessage ? `
726
-
727
- ${memorySystemMessage}` : ""}`
728
- }, ...this.sanitizeResponseMessages(memoryMessages), ...newMessages]
717
+ content: memorySystemMessage
718
+ } : null, ...this.sanitizeResponseMessages(memoryMessages), ...newMessages].filter(message => Boolean(message))
729
719
  };
730
720
  }
731
721
  return {
@@ -887,7 +877,8 @@ ${memorySystemMessage}` : ""}`
887
877
  this.logger.debug(`[Agent:${this.name}] - Executing tool ${k}`, {
888
878
  name: k,
889
879
  description: tool.description,
890
- args
880
+ args,
881
+ runId
891
882
  });
892
883
  return tool.execute({
893
884
  context: args,
@@ -925,7 +916,8 @@ ${memorySystemMessage}` : ""}`
925
916
  this.logger.debug(`[Agent:${this.name}] - Executing tool ${toolName}`, {
926
917
  name: toolName,
927
918
  description: toolObj.description,
928
- args
919
+ args,
920
+ runId
929
921
  });
930
922
  return toolObj.execute({
931
923
  context: args,
@@ -954,7 +946,7 @@ ${memorySystemMessage}` : ""}`
954
946
  }) {
955
947
  let coreMessages = [];
956
948
  let threadIdToUse = threadId;
957
- this.log(LogLevel.DEBUG, `Saving user messages in memory for agent ${this.name}`, {
949
+ this.logger.debug(`Saving user messages in memory for agent ${this.name}`, {
958
950
  runId
959
951
  });
960
952
  const saveMessageResponse = await this.saveMemory({
@@ -988,7 +980,7 @@ ${memorySystemMessage}` : ""}`
988
980
  }
989
981
  const systemMessage = {
990
982
  role: "system",
991
- content: `${this.instructions}. Today's date is ${(/* @__PURE__ */new Date()).toISOString()}`
983
+ content: `${this.instructions}.`
992
984
  };
993
985
  let coreMessages = messages;
994
986
  let threadIdToUse = threadId;
@@ -1308,6 +1300,62 @@ ${memorySystemMessage}` : ""}`
1308
1300
  toolChoice
1309
1301
  });
1310
1302
  }
1303
+ /**
1304
+ * Convert text to speech using the configured voice provider
1305
+ * @param input Text or text stream to convert to speech
1306
+ * @param options Speech options including speaker and provider-specific options
1307
+ * @returns Audio stream
1308
+ */
1309
+ async speak(input, options) {
1310
+ if (!this.voice) {
1311
+ throw new Error("No voice provider configured");
1312
+ }
1313
+ try {
1314
+ return this.voice.speak(input, options);
1315
+ } catch (e) {
1316
+ this.logger.error("Error during agent speak", {
1317
+ error: e
1318
+ });
1319
+ throw e;
1320
+ }
1321
+ }
1322
+ /**
1323
+ * Convert speech to text using the configured voice provider
1324
+ * @param audioStream Audio stream to transcribe
1325
+ * @param options Provider-specific transcription options
1326
+ * @returns Text or text stream
1327
+ */
1328
+ async listen(audioStream, options) {
1329
+ if (!this.voice) {
1330
+ throw new Error("No voice provider configured");
1331
+ }
1332
+ try {
1333
+ return this.voice.listen(audioStream, options);
1334
+ } catch (e) {
1335
+ this.logger.error("Error during agent listen", {
1336
+ error: e
1337
+ });
1338
+ throw e;
1339
+ }
1340
+ }
1341
+ /**
1342
+ * Get a list of available speakers from the configured voice provider
1343
+ * @throws {Error} If no voice provider is configured
1344
+ * @returns {Promise<Array<{voiceId: string}>>} List of available speakers
1345
+ */
1346
+ async getSpeakers() {
1347
+ if (!this.voice) {
1348
+ throw new Error("No voice provider configured");
1349
+ }
1350
+ try {
1351
+ return await this.voice.getSpeakers();
1352
+ } catch (e) {
1353
+ this.logger.error("Error during agent getSpeakers", {
1354
+ error: e
1355
+ });
1356
+ throw e;
1357
+ }
1358
+ }
1311
1359
  };
1312
1360
  Agent = /*@__PURE__*/(_ => {
1313
1361
  _init = __decoratorStart(_a);
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-SYZAQCKZ.js';
1
+ import { MastraBase } from './chunk-6RDA4JYW.js';
2
2
  import { context, trace } from '@opentelemetry/api';
3
3
  import { get } from 'radash';
4
4
  import sift from 'sift';
@@ -1,8 +1,8 @@
1
- import { DefaultStorage } from './chunk-6CWY2XAM.js';
2
- import { DefaultVectorDB } from './chunk-KDUL7NPA.js';
3
- import { defaultEmbedder } from './chunk-VIJVUFTB.js';
1
+ import { DefaultStorage } from './chunk-JIV6PDIN.js';
2
+ import { DefaultVectorDB } from './chunk-LKOVXFLE.js';
3
+ import { defaultEmbedder } from './chunk-7NPRQT5A.js';
4
4
  import { deepMerge } from './chunk-WIBGG4X6.js';
5
- import { MastraBase } from './chunk-SYZAQCKZ.js';
5
+ import { MastraBase } from './chunk-6RDA4JYW.js';
6
6
 
7
7
  // src/memory/memory.ts
8
8
  var MastraMemory = class extends MastraBase {
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-SYZAQCKZ.js';
1
+ import { MastraBase } from './chunk-6RDA4JYW.js';
2
2
  import { parse } from 'dotenv';
3
3
  import { readFile } from 'fs/promises';
4
4
 
@@ -1,4 +1,4 @@
1
- import { MastraBundler } from './chunk-DIMNBNEX.js';
1
+ import { MastraBundler } from './chunk-YUOADWSP.js';
2
2
 
3
3
  // src/deployer/index.ts
4
4
  var MastraDeployer = class extends MastraBundler {
@@ -1,7 +1,7 @@
1
1
  import { MastraBundler, IBundler } from '../bundler/index.js';
2
- import '../base-CmtknnDz.js';
2
+ import '../base-eWkcLLSb.js';
3
3
  import '@opentelemetry/api';
4
- import '../index-BIpeWPEO.js';
4
+ import '../index-C5uPdbs4.js';
5
5
  import 'pino';
6
6
  import 'stream';
7
7
  import '@opentelemetry/sdk-trace-base';
@@ -1 +1 @@
1
- export { MastraDeployer } from '../chunk-COG5YSSN.js';
1
+ export { MastraDeployer } from '../chunk-Z735LDV7.js';
@@ -1,9 +1,9 @@
1
1
  import { a as Metric, T as TestInfo, M as MetricResult } from '../types-m9RryK9a.js';
2
- import { A as Agent } from '../base-BTUaTXvc.js';
2
+ import { A as Agent } from '../base-BdNHFjqH.js';
3
3
  import 'ai';
4
- import '../base-CmtknnDz.js';
4
+ import '../base-eWkcLLSb.js';
5
5
  import '@opentelemetry/api';
6
- import '../index-BIpeWPEO.js';
6
+ import '../index-C5uPdbs4.js';
7
7
  import 'pino';
8
8
  import 'stream';
9
9
  import '@opentelemetry/sdk-trace-base';
@@ -11,6 +11,7 @@ import 'sift';
11
11
  import 'zod';
12
12
  import 'json-schema';
13
13
  import '../vector/index.js';
14
+ import '../voice/index.js';
14
15
  import '../tts/index.js';
15
16
 
16
17
  declare function evaluate<T extends Agent>({ agentName, input, metric, output, runId, globalRunId, testInfo, instructions, }: {
@@ -30,11 +30,15 @@ declare const LogLevel: {
30
30
  };
31
31
  type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
32
32
  interface BaseLogMessage extends Run {
33
- message: string;
34
- destinationPath: string;
35
- type: RegisteredLogger;
33
+ msg: string;
34
+ level: number;
35
+ time: Date;
36
+ pid: number;
37
+ hostname: string;
38
+ name: string;
36
39
  }
37
40
  declare class LoggerTransport extends Transform {
41
+ constructor(opts?: any);
38
42
  getLogsByRunId({ runId }: {
39
43
  runId: string;
40
44
  }): Promise<BaseLogMessage[]>;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { a as Metric } from './types-m9RryK9a.js';
2
2
  export { M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
3
- import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './base-BTUaTXvc.js';
4
- export { Y as ActionContext, X as BaseCondition, B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, Q as CoreTool, q as CoreToolMessage, p as CoreUserMessage, a5 as DependencyCheckOutput, s as EmbedManyResult, r as EmbedResult, E as EvalRow, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, N as MemoryConfig, K as MessageResponse, H as MessageType, O as OutputType, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, P as SharedMemoryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, f as StepResult, d as StepVariableType, k as StorageColumn, m as StorageGetMessagesArg, J as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a4 as SubscriberFunctionOutput, V as VariableReference, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, l as WorkflowRow, g as WorkflowRunState, a9 as WorkflowState } from './base-BTUaTXvc.js';
5
- import { M as MastraBase$1 } from './base-CmtknnDz.js';
6
- export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-CmtknnDz.js';
7
- import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-BIpeWPEO.js';
8
- export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-BIpeWPEO.js';
3
+ import { T as ToolAction, A as Agent$1, i as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, j as ToolExecutionContext, W as WorkflowOptions } from './base-BdNHFjqH.js';
4
+ export { Y as ActionContext, X as BaseCondition, B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, Q as CoreTool, q as CoreToolMessage, p as CoreUserMessage, a5 as DependencyCheckOutput, s as EmbedManyResult, r as EmbedResult, E as EvalRow, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, N as MemoryConfig, K as MessageResponse, H as MessageType, O as OutputType, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, P as SharedMemoryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, f as StepResult, d as StepVariableType, k as StorageColumn, m as StorageGetMessagesArg, J as StorageThreadType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType, a4 as SubscriberFunctionOutput, V as VariableReference, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, l as WorkflowRow, g as WorkflowRunState, a9 as WorkflowState } from './base-BdNHFjqH.js';
5
+ import { M as MastraBase$1 } from './base-eWkcLLSb.js';
6
+ export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-eWkcLLSb.js';
7
+ import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-C5uPdbs4.js';
8
+ export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-C5uPdbs4.js';
9
9
  import { MastraDeployer as MastraDeployer$1 } from './deployer/index.js';
10
10
  import { MastraStorageLibSql as DefaultStorage, LibSQLConfig } from './storage/index.js';
11
11
  export { evaluate } from './eval/index.js';
@@ -20,8 +20,8 @@ import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
20
20
  export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
21
21
  import { MastraVector as MastraVector$1 } from './vector/index.js';
22
22
  export { IndexStats, QueryResult, defaultEmbedder } from './vector/index.js';
23
- import { S as Step, W as Workflow$1 } from './workflow-CwuYLcTS.js';
24
- export { c as createStep } from './workflow-CwuYLcTS.js';
23
+ import { S as Step, W as Workflow$1 } from './workflow-CbKcJz7a.js';
24
+ export { c as createStep } from './workflow-CbKcJz7a.js';
25
25
  export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
26
26
  export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
27
27
  export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
@@ -29,6 +29,7 @@ export { LibSQLVector as DefaultVectorDB, LibSQLVector } from './vector/libsql/i
29
29
  export { Message as AiMessageType } from 'ai';
30
30
  import 'sift';
31
31
  import 'json-schema';
32
+ import './voice/index.js';
32
33
  import '@opentelemetry/api';
33
34
  import '@opentelemetry/sdk-trace-base';
34
35
  import 'pino';
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
- import { MastraTTS } from './chunk-WVNTGARP.js';
2
- import { Workflow } from './chunk-PI5YQB75.js';
3
- export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-PI5YQB75.js';
1
+ import { MastraTTS } from './chunk-NDQR6IPC.js';
2
+ import { Workflow } from './chunk-TCMOYQ74.js';
3
+ export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-TCMOYQ74.js';
4
4
  import { Integration, OpenAPIToolset } from './chunk-PNZK456O.js';
5
5
  import { Tool } from './chunk-ZINPRHAN.js';
6
6
  export { createTool } from './chunk-ZINPRHAN.js';
7
- export { Mastra } from './chunk-DAWQ5R4C.js';
8
- import { MastraMemory } from './chunk-KMVLZUIO.js';
9
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-ILKS57KK.js';
10
- import { MastraStorage, DefaultStorage } from './chunk-6CWY2XAM.js';
11
- export { DefaultStorage } from './chunk-6CWY2XAM.js';
12
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-KDUL7NPA.js';
13
- import { MastraVector } from './chunk-VIJVUFTB.js';
14
- export { defaultEmbedder } from './chunk-VIJVUFTB.js';
15
- import { Agent } from './chunk-63KLSI2Y.js';
7
+ export { Mastra } from './chunk-HPIB5X7E.js';
8
+ import { MastraMemory } from './chunk-XD7K4XPP.js';
9
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-N7KZVQDK.js';
10
+ import { MastraStorage, DefaultStorage } from './chunk-JIV6PDIN.js';
11
+ export { DefaultStorage } from './chunk-JIV6PDIN.js';
12
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from './chunk-LKOVXFLE.js';
13
+ import { MastraVector } from './chunk-7NPRQT5A.js';
14
+ export { defaultEmbedder } from './chunk-7NPRQT5A.js';
15
+ import { Agent } from './chunk-ORM3OCHX.js';
16
16
  export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZRHVG25.js';
17
17
  export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-WIBGG4X6.js';
18
- import { MastraDeployer } from './chunk-COG5YSSN.js';
18
+ import { MastraDeployer } from './chunk-Z735LDV7.js';
19
+ import { MastraBase } from './chunk-6RDA4JYW.js';
20
+ import { createLogger } from './chunk-KP5SHTKA.js';
21
+ export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-KP5SHTKA.js';
19
22
  export { Metric, evaluate } from './chunk-NUDAZEOG.js';
20
23
  export { AvailableHooks, executeHook, registerHook } from './chunk-BB4KXGBU.js';
21
- import { MastraBase } from './chunk-SYZAQCKZ.js';
22
- import { createLogger } from './chunk-XS2VY7YW.js';
23
- export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-XS2VY7YW.js';
24
24
  export { BaseFilterTranslator } from './chunk-SIFBBGY6.js';
25
25
 
26
26
  // src/agent/index.warning.ts
@@ -1,10 +1,10 @@
1
- import { W as Workflow } from '../workflow-CwuYLcTS.js';
2
- import '../base-CmtknnDz.js';
3
- import { T as ToolAction } from '../base-BTUaTXvc.js';
1
+ import { W as Workflow } from '../workflow-CbKcJz7a.js';
2
+ import '../base-eWkcLLSb.js';
3
+ import { T as ToolAction } from '../base-BdNHFjqH.js';
4
4
  import 'xstate';
5
5
  import 'zod';
6
6
  import '@opentelemetry/api';
7
- import '../index-BIpeWPEO.js';
7
+ import '../index-C5uPdbs4.js';
8
8
  import 'pino';
9
9
  import 'stream';
10
10
  import '@opentelemetry/sdk-trace-base';
@@ -13,6 +13,7 @@ import '../types-m9RryK9a.js';
13
13
  import 'sift';
14
14
  import 'json-schema';
15
15
  import '../vector/index.js';
16
+ import '../voice/index.js';
16
17
  import '../tts/index.js';
17
18
 
18
19
  declare class Integration<ToolsParams = void, ApiClient = void> {
@@ -1,9 +1,9 @@
1
1
  import 'ai';
2
2
  import 'json-schema';
3
3
  import 'zod';
4
- export { B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, q as CoreToolMessage, p as CoreUserMessage, s as EmbedManyResult, r as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../base-BTUaTXvc.js';
5
- import '../index-BIpeWPEO.js';
6
- import '../base-CmtknnDz.js';
4
+ export { B as BaseStructuredOutputType, o as CoreAssistantMessage, C as CoreMessage, n as CoreSystemMessage, q as CoreToolMessage, p as CoreUserMessage, s as EmbedManyResult, r as EmbedResult, G as GenerateReturn, D as LLMInnerStreamOptions, F as LLMStreamObjectOptions, x as LLMStreamOptions, z as LLMTextObjectOptions, y as LLMTextOptions, L as LanguageModel, O as OutputType, w as StreamReturn, v as StructuredOutput, u as StructuredOutputArrayItem, t as StructuredOutputType } from '../base-BdNHFjqH.js';
5
+ import '../index-C5uPdbs4.js';
6
+ import '../base-eWkcLLSb.js';
7
7
  import '@opentelemetry/api';
8
8
  import '@opentelemetry/sdk-trace-base';
9
9
  import '../types-m9RryK9a.js';
@@ -11,4 +11,5 @@ import 'sift';
11
11
  import '../vector/index.js';
12
12
  import 'pino';
13
13
  import 'stream';
14
+ import '../voice/index.js';
14
15
  import '../tts/index.js';
@@ -1,3 +1,3 @@
1
1
  import 'pino';
2
2
  import 'stream';
3
- export { B as BaseLogMessage, a as LogLevel, L as Logger, b as LoggerTransport, M as MultiLogger, R as RegisteredLogger, T as TransportMap, c as combineLoggers, e as createLogger, n as noopLogger } from '../index-BIpeWPEO.js';
3
+ export { B as BaseLogMessage, a as LogLevel, L as Logger, b as LoggerTransport, M as MultiLogger, R as RegisteredLogger, T as TransportMap, c as combineLoggers, e as createLogger, n as noopLogger } from '../index-C5uPdbs4.js';
@@ -1 +1 @@
1
- export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-XS2VY7YW.js';
1
+ export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-KP5SHTKA.js';
@@ -1,8 +1,8 @@
1
- import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-BTUaTXvc.js';
2
- import { L as Logger, B as BaseLogMessage } from '../index-BIpeWPEO.js';
3
- import { W as Workflow } from '../workflow-CwuYLcTS.js';
1
+ import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-BdNHFjqH.js';
2
+ import { L as Logger, B as BaseLogMessage } from '../index-C5uPdbs4.js';
3
+ import { W as Workflow } from '../workflow-CbKcJz7a.js';
4
4
  import { MastraVector } from '../vector/index.js';
5
- import { O as OtelConfig, T as Telemetry } from '../base-CmtknnDz.js';
5
+ import { O as OtelConfig, T as Telemetry } from '../base-eWkcLLSb.js';
6
6
  import { MastraTTS } from '../tts/index.js';
7
7
  import { MastraDeployer } from '../deployer/index.js';
8
8
  import 'ai';
@@ -10,6 +10,7 @@ import '../types-m9RryK9a.js';
10
10
  import 'sift';
11
11
  import 'zod';
12
12
  import 'json-schema';
13
+ import '../voice/index.js';
13
14
  import 'pino';
14
15
  import 'stream';
15
16
  import 'xstate';
@@ -1 +1 @@
1
- export { Mastra } from '../chunk-DAWQ5R4C.js';
1
+ export { Mastra } from '../chunk-HPIB5X7E.js';
@@ -1,8 +1,8 @@
1
- export { a as MastraMemory, N as MemoryConfig, K as MessageResponse, H as MessageType, P as SharedMemoryConfig, J as StorageThreadType } from '../base-BTUaTXvc.js';
1
+ export { a as MastraMemory, N as MemoryConfig, K as MessageResponse, H as MessageType, P as SharedMemoryConfig, J as StorageThreadType } from '../base-BdNHFjqH.js';
2
2
  export { Message as AiMessageType } from 'ai';
3
- import '../base-CmtknnDz.js';
3
+ import '../base-eWkcLLSb.js';
4
4
  import '@opentelemetry/api';
5
- import '../index-BIpeWPEO.js';
5
+ import '../index-C5uPdbs4.js';
6
6
  import 'pino';
7
7
  import 'stream';
8
8
  import '@opentelemetry/sdk-trace-base';
@@ -11,4 +11,5 @@ import 'sift';
11
11
  import 'zod';
12
12
  import 'json-schema';
13
13
  import '../vector/index.js';
14
+ import '../voice/index.js';
14
15
  import '../tts/index.js';
@@ -1 +1 @@
1
- export { MastraMemory } from '../chunk-KMVLZUIO.js';
1
+ export { MastraMemory } from '../chunk-XD7K4XPP.js';
@@ -1 +1 @@
1
- export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-ILKS57KK.js';
1
+ export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-N7KZVQDK.js';
@@ -1,6 +1,6 @@
1
- import { M as MastraStorage, ag as TABLE_NAMES, k as StorageColumn, J as StorageThreadType, H as MessageType, m as StorageGetMessagesArg, E as EvalRow } from '../base-BTUaTXvc.js';
2
- export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-BTUaTXvc.js';
3
- import '../base-CmtknnDz.js';
1
+ import { M as MastraStorage, ag as TABLE_NAMES, k as StorageColumn, J as StorageThreadType, H as MessageType, m as StorageGetMessagesArg, E as EvalRow } from '../base-BdNHFjqH.js';
2
+ export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-BdNHFjqH.js';
3
+ import '../base-eWkcLLSb.js';
4
4
  export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
5
5
  import 'ai';
6
6
  import '../types-m9RryK9a.js';
@@ -9,10 +9,11 @@ import 'zod';
9
9
  import 'json-schema';
10
10
  import '../vector/index.js';
11
11
  import '@opentelemetry/api';
12
- import '../index-BIpeWPEO.js';
12
+ import '../index-C5uPdbs4.js';
13
13
  import 'pino';
14
14
  import 'stream';
15
15
  import '@opentelemetry/sdk-trace-base';
16
+ import '../voice/index.js';
16
17
  import '../tts/index.js';
17
18
  import '../filter/index.js';
18
19
 
@@ -1,3 +1,3 @@
1
- export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-6CWY2XAM.js';
2
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-KDUL7NPA.js';
1
+ export { DefaultStorage, MastraStorage, DefaultStorage as MastraStorageLibSql } from '../chunk-JIV6PDIN.js';
2
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-LKOVXFLE.js';
3
3
  export { TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-RG66XEJT.js';
@@ -1,9 +1,9 @@
1
- export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-CmtknnDz.js';
1
+ export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from '../base-eWkcLLSb.js';
2
2
  import { SpanKind } from '@opentelemetry/api';
3
3
  import { ExportResult } from '@opentelemetry/core';
4
4
  import { SpanExporter, ReadableSpan } from '@opentelemetry/sdk-trace-base';
5
- import { L as Logger } from '../index-BIpeWPEO.js';
6
- import { M as MastraStorage } from '../base-BTUaTXvc.js';
5
+ import { L as Logger } from '../index-C5uPdbs4.js';
6
+ import { M as MastraStorage } from '../base-BdNHFjqH.js';
7
7
  import 'pino';
8
8
  import 'stream';
9
9
  import 'ai';
@@ -12,6 +12,7 @@ import 'sift';
12
12
  import 'zod';
13
13
  import 'json-schema';
14
14
  import '../vector/index.js';
15
+ import '../voice/index.js';
15
16
  import '../tts/index.js';
16
17
 
17
18
  declare function withSpan(options: {
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../base-BTUaTXvc.js';
3
- export { Q as CoreTool } from '../base-BTUaTXvc.js';
2
+ import { j as ToolExecutionContext, T as ToolAction, c as MastraPrimitives } from '../base-BdNHFjqH.js';
3
+ export { Q as CoreTool } from '../base-BdNHFjqH.js';
4
4
  import 'ai';
5
- import '../base-CmtknnDz.js';
5
+ import '../base-eWkcLLSb.js';
6
6
  import '@opentelemetry/api';
7
- import '../index-BIpeWPEO.js';
7
+ import '../index-C5uPdbs4.js';
8
8
  import 'pino';
9
9
  import 'stream';
10
10
  import '@opentelemetry/sdk-trace-base';
@@ -12,6 +12,7 @@ import '../types-m9RryK9a.js';
12
12
  import 'sift';
13
13
  import 'json-schema';
14
14
  import '../vector/index.js';
15
+ import '../voice/index.js';
15
16
  import '../tts/index.js';
16
17
 
17
18
  declare class Tool<TId extends string, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends ToolExecutionContext<TSchemaIn> = ToolExecutionContext<TSchemaIn>> implements ToolAction<TId, TSchemaIn, TSchemaOut, TContext> {
@@ -1,6 +1,6 @@
1
- import { M as MastraBase } from '../base-CmtknnDz.js';
1
+ import { M as MastraBase } from '../base-eWkcLLSb.js';
2
2
  import '@opentelemetry/api';
3
- import '../index-BIpeWPEO.js';
3
+ import '../index-C5uPdbs4.js';
4
4
  import 'pino';
5
5
  import 'stream';
6
6
  import '@opentelemetry/sdk-trace-base';
package/dist/tts/index.js CHANGED
@@ -1 +1 @@
1
- export { MastraTTS } from '../chunk-WVNTGARP.js';
1
+ export { MastraTTS } from '../chunk-NDQR6IPC.js';
@@ -1,7 +1,7 @@
1
- import { M as MastraBase } from '../base-CmtknnDz.js';
1
+ import { M as MastraBase } from '../base-eWkcLLSb.js';
2
2
  import * as ai from 'ai';
3
3
  import '@opentelemetry/api';
4
- import '../index-BIpeWPEO.js';
4
+ import '../index-C5uPdbs4.js';
5
5
  import 'pino';
6
6
  import 'stream';
7
7
  import '@opentelemetry/sdk-trace-base';
@@ -1 +1 @@
1
- export { MastraVector, defaultEmbedder } from '../chunk-VIJVUFTB.js';
1
+ export { MastraVector, defaultEmbedder } from '../chunk-7NPRQT5A.js';
@@ -1,8 +1,8 @@
1
1
  import { Filter } from '../../filter/index.js';
2
2
  import { MastraVector, QueryResult, IndexStats } from '../index.js';
3
- import '../../base-CmtknnDz.js';
3
+ import '../../base-eWkcLLSb.js';
4
4
  import '@opentelemetry/api';
5
- import '../../index-BIpeWPEO.js';
5
+ import '../../index-C5uPdbs4.js';
6
6
  import 'pino';
7
7
  import 'stream';
8
8
  import '@opentelemetry/sdk-trace-base';
@@ -1 +1 @@
1
- export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-KDUL7NPA.js';
1
+ export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../../chunk-LKOVXFLE.js';
@@ -1,6 +1,6 @@
1
- import { M as MastraBase } from '../base-CmtknnDz.js';
1
+ import { M as MastraBase } from '../base-eWkcLLSb.js';
2
2
  import '@opentelemetry/api';
3
- import '../index-BIpeWPEO.js';
3
+ import '../index-C5uPdbs4.js';
4
4
  import 'pino';
5
5
  import 'stream';
6
6
  import '@opentelemetry/sdk-trace-base';
@@ -18,7 +18,7 @@ declare abstract class MastraVoice extends MastraBase {
18
18
  protected listeningModel?: BuiltInModelConfig;
19
19
  protected speechModel?: BuiltInModelConfig;
20
20
  protected speaker?: string;
21
- constructor({ listeningModel, speechModel, speaker }: VoiceConfig);
21
+ constructor({ listeningModel, speechModel, speaker }?: VoiceConfig);
22
22
  traced<T extends Function>(method: T, methodName: string): T;
23
23
  /**
24
24
  * Convert text to speech
@@ -49,4 +49,19 @@ declare abstract class MastraVoice extends MastraBase {
49
49
  }>>;
50
50
  }
51
51
 
52
- export { MastraVoice, type VoiceConfig };
52
+ declare class CompositeVoice extends MastraVoice {
53
+ protected speakProvider?: MastraVoice;
54
+ protected listenProvider?: MastraVoice;
55
+ constructor({ speakProvider, listenProvider }: {
56
+ speakProvider?: MastraVoice;
57
+ listenProvider?: MastraVoice;
58
+ });
59
+ speak(input: string | NodeJS.ReadableStream, options?: any): Promise<NodeJS.ReadableStream>;
60
+ listen(audioStream: NodeJS.ReadableStream, options?: any): Promise<string | NodeJS.ReadableStream>;
61
+ getSpeakers(): Promise<{
62
+ [key: string]: any;
63
+ voiceId: string;
64
+ }[]>;
65
+ }
66
+
67
+ export { CompositeVoice, MastraVoice, type VoiceConfig };
@@ -1,8 +1,8 @@
1
1
  import { InstrumentClass } from '../chunk-4ZRHVG25.js';
2
- import { MastraBase } from '../chunk-SYZAQCKZ.js';
2
+ import { MastraBase } from '../chunk-6RDA4JYW.js';
3
3
  import { __decoratorStart, __decorateElement, __runInitializers } from '../chunk-C6A6W6XS.js';
4
4
 
5
- // src/voice/index.ts
5
+ // src/voice/voice.ts
6
6
  var _MastraVoice_decorators, _init, _a;
7
7
  _MastraVoice_decorators = [InstrumentClass({
8
8
  prefix: "voice",
@@ -16,7 +16,7 @@ var MastraVoice = class extends (_a = MastraBase) {
16
16
  listeningModel,
17
17
  speechModel,
18
18
  speaker
19
- }) {
19
+ } = {}) {
20
20
  super({
21
21
  component: "VOICE"
22
22
  });
@@ -37,7 +37,40 @@ MastraVoice = /*@__PURE__*/(_ => {
37
37
  _init = __decoratorStart(_a);
38
38
  MastraVoice = __decorateElement(_init, 0, "MastraVoice", _MastraVoice_decorators, MastraVoice);
39
39
  __runInitializers(_init, 1, MastraVoice);
40
+
41
+ // src/voice/composite-voice.ts
40
42
  return MastraVoice;
41
43
  })();
44
+ // src/voice/composite-voice.ts
45
+ var CompositeVoice = class extends MastraVoice {
46
+ speakProvider;
47
+ listenProvider;
48
+ constructor({
49
+ speakProvider,
50
+ listenProvider
51
+ }) {
52
+ super();
53
+ this.speakProvider = speakProvider;
54
+ this.listenProvider = listenProvider;
55
+ }
56
+ async speak(input, options) {
57
+ if (!this.speakProvider) {
58
+ throw new Error("No speak provider configured");
59
+ }
60
+ return this.speakProvider.speak(input, options);
61
+ }
62
+ async listen(audioStream, options) {
63
+ if (!this.listenProvider) {
64
+ throw new Error("No listen provider configured");
65
+ }
66
+ return this.listenProvider.listen(audioStream, options);
67
+ }
68
+ async getSpeakers() {
69
+ if (!this.speakProvider) {
70
+ throw new Error("No speak provider configured");
71
+ }
72
+ return this.speakProvider.getSpeakers();
73
+ }
74
+ };
42
75
 
43
- export { MastraVoice };
76
+ export { CompositeVoice, MastraVoice };
@@ -1,7 +1,7 @@
1
1
  import { Snapshot } from 'xstate';
2
2
  import { z } from 'zod';
3
- import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './base-BTUaTXvc.js';
4
- import { M as MastraBase } from './base-CmtknnDz.js';
3
+ import { S as StepExecutionContext, b as StepAction, R as RetryConfig, c as MastraPrimitives, W as WorkflowOptions, I as IAction, d as StepVariableType, e as StepConfig, f as StepResult, g as WorkflowRunState, h as StepGraph } from './base-BdNHFjqH.js';
4
+ import { M as MastraBase } from './base-eWkcLLSb.js';
5
5
 
6
6
  declare class Step<TStepId extends string = any, TSchemaIn extends z.ZodSchema | undefined = undefined, TSchemaOut extends z.ZodSchema | undefined = undefined, TContext extends StepExecutionContext<TSchemaIn> = StepExecutionContext<TSchemaIn>> implements StepAction<TStepId, TSchemaIn, TSchemaOut, TContext> {
7
7
  id: TStepId;
@@ -1,11 +1,11 @@
1
- export { S as Step, W as Workflow, c as createStep } from '../workflow-CwuYLcTS.js';
2
- import { V as VariableReference, f as StepResult } from '../base-BTUaTXvc.js';
3
- export { Y as ActionContext, X as BaseCondition, a5 as DependencyCheckOutput, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, d as StepVariableType, a4 as SubscriberFunctionOutput, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, a9 as WorkflowState } from '../base-BTUaTXvc.js';
1
+ export { S as Step, W as Workflow, c as createStep } from '../workflow-CbKcJz7a.js';
2
+ import { V as VariableReference, f as StepResult } from '../base-BdNHFjqH.js';
3
+ export { Y as ActionContext, X as BaseCondition, a5 as DependencyCheckOutput, ab as ExtractSchemaFromStep, ae as ExtractSchemaType, ac as ExtractStepResult, af as PathsToStringProps, a2 as ResolverFunctionInput, a3 as ResolverFunctionOutput, R as RetryConfig, b as StepAction, _ as StepCondition, e as StepConfig, Z as StepDef, S as StepExecutionContext, h as StepGraph, aa as StepId, ad as StepInputType, U as StepNode, d as StepVariableType, a4 as SubscriberFunctionOutput, a7 as WorkflowActionParams, a8 as WorkflowActions, a6 as WorkflowActors, $ as WorkflowContext, a1 as WorkflowEvent, a0 as WorkflowLogMessage, W as WorkflowOptions, g as WorkflowRunState, a9 as WorkflowState } from '../base-BdNHFjqH.js';
4
4
  import 'xstate';
5
5
  import 'zod';
6
- import '../base-CmtknnDz.js';
6
+ import '../base-eWkcLLSb.js';
7
7
  import '@opentelemetry/api';
8
- import '../index-BIpeWPEO.js';
8
+ import '../index-C5uPdbs4.js';
9
9
  import 'pino';
10
10
  import 'stream';
11
11
  import '@opentelemetry/sdk-trace-base';
@@ -14,6 +14,7 @@ import '../types-m9RryK9a.js';
14
14
  import 'sift';
15
15
  import 'json-schema';
16
16
  import '../vector/index.js';
17
+ import '../voice/index.js';
17
18
  import '../tts/index.js';
18
19
 
19
20
  declare function isErrorEvent(stateEvent: any): stateEvent is {
@@ -1 +1 @@
1
- export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-PI5YQB75.js';
1
+ export { Step, Workflow, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from '../chunk-TCMOYQ74.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.2-alpha.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/core.esm.js",