@mastra/core 0.9.5-alpha.0 → 0.10.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 (168) hide show
  1. package/README.md +3 -2
  2. package/dist/agent/index.cjs +2 -2
  3. package/dist/agent/index.d.cts +12 -13
  4. package/dist/agent/index.d.ts +12 -13
  5. package/dist/agent/index.js +1 -1
  6. package/dist/{base-CI7Uz2GO.d.ts → base-DttB7sJD.d.ts} +1172 -1130
  7. package/dist/{base-BV8SNIdm.d.cts → base-aJ3etsh5.d.cts} +1172 -1130
  8. package/dist/{base-H7siSAfu.d.cts → base-aPYtPBT2.d.cts} +3 -3
  9. package/dist/{base-4Z34GQL8.d.ts → base-tc5kgDTD.d.ts} +3 -3
  10. package/dist/base.cjs +2 -2
  11. package/dist/base.d.cts +2 -3
  12. package/dist/base.d.ts +2 -3
  13. package/dist/base.js +1 -1
  14. package/dist/bundler/index.cjs +2 -2
  15. package/dist/bundler/index.d.cts +2 -3
  16. package/dist/bundler/index.d.ts +2 -3
  17. package/dist/bundler/index.js +1 -1
  18. package/dist/{chunk-W4BSLENO.js → chunk-2NTUAUGH.js} +1 -1
  19. package/dist/{chunk-MF5BUJO6.js → chunk-2PW6UJMW.js} +57 -9
  20. package/dist/{chunk-HKCSQI7G.cjs → chunk-2U7ZZUFO.cjs} +2 -2
  21. package/dist/{workflows/vNext/index.js → chunk-3SQ3G2EJ.js} +16 -15
  22. package/dist/chunk-5HULBQ2W.cjs +38 -0
  23. package/dist/{chunk-BATBI3D4.cjs → chunk-5JRD3NDP.cjs} +15 -15
  24. package/dist/{chunk-EYQLTWRJ.cjs → chunk-5W2G7S44.cjs} +33 -58
  25. package/dist/chunk-75Z4BZEE.js +36 -0
  26. package/dist/{chunk-S3Y7QBO7.cjs → chunk-AOGUTJUO.cjs} +57 -50
  27. package/dist/{chunk-BZUIFK6C.js → chunk-BPTSLJHA.js} +9 -9
  28. package/dist/{chunk-JBJ7KXN5.js → chunk-C3ICEF6E.js} +1 -1
  29. package/dist/{chunk-E4FAXBUV.cjs → chunk-CWSFP2HS.cjs} +2 -2
  30. package/dist/{chunk-RWWUZTAK.js → chunk-E7CLY6SK.js} +41 -34
  31. package/dist/{chunk-235X76GC.js → chunk-FI7R232B.js} +2 -2
  32. package/dist/chunk-GQ2XQ4UN.js +321 -0
  33. package/dist/{chunk-6EPEYXAE.js → chunk-J7GDGV6F.js} +1 -1
  34. package/dist/{chunk-NLBJOFNG.js → chunk-JW5TMK2L.js} +1 -1
  35. package/dist/{chunk-NOPY74PV.js → chunk-KJQFFEEQ.js} +1 -1
  36. package/dist/{chunk-V2Q2FEVO.cjs → chunk-KSPHQSZX.cjs} +2 -2
  37. package/dist/{chunk-SU4O2A72.js → chunk-LHRZV5VG.js} +1 -22
  38. package/dist/chunk-NMDM4IZN.cjs +78 -0
  39. package/dist/chunk-OBEALYTK.js +74 -0
  40. package/dist/{chunk-PU2TNRKO.js → chunk-OCT2762Q.js} +1 -1
  41. package/dist/{chunk-5DUFC7TV.cjs → chunk-P7BGXOQV.cjs} +2 -2
  42. package/dist/{chunk-NQE264UM.cjs → chunk-PIZM25KI.cjs} +2 -23
  43. package/dist/{chunk-S7J63JOG.cjs → chunk-RVS6OUJN.cjs} +2 -2
  44. package/dist/{chunk-LF5CE7LU.cjs → chunk-SKG2NIZW.cjs} +2 -2
  45. package/dist/chunk-SWW4EBUZ.cjs +96 -0
  46. package/dist/{chunk-RGE4UF6A.cjs → chunk-TMPFLJLG.cjs} +2 -2
  47. package/dist/{workflows/vNext/index.cjs → chunk-TTKQ37ZZ.cjs} +21 -20
  48. package/dist/{chunk-F7HNPG53.cjs → chunk-U3L3NEOM.cjs} +58 -10
  49. package/dist/chunk-VHLL4AZK.js +90 -0
  50. package/dist/{chunk-EG74VBSP.cjs → chunk-YEULQPUY.cjs} +6 -6
  51. package/dist/{chunk-RVKA5VUT.js → chunk-ZB3LEHL2.js} +31 -56
  52. package/dist/{chunk-TAFOICHR.js → chunk-ZKN6HYYQ.js} +1 -1
  53. package/dist/chunk-ZZDAC5KD.cjs +325 -0
  54. package/dist/deployer/index.cjs +2 -2
  55. package/dist/deployer/index.d.cts +2 -3
  56. package/dist/deployer/index.d.ts +2 -3
  57. package/dist/deployer/index.js +1 -1
  58. package/dist/eval/index.d.cts +12 -13
  59. package/dist/eval/index.d.ts +12 -13
  60. package/dist/hooks/index.d.cts +1 -1
  61. package/dist/hooks/index.d.ts +1 -1
  62. package/dist/index.cjs +71 -158
  63. package/dist/index.d.cts +16 -24
  64. package/dist/index.d.ts +16 -24
  65. package/dist/index.js +16 -23
  66. package/dist/integration/index.cjs +3 -3
  67. package/dist/integration/index.d.cts +11 -12
  68. package/dist/integration/index.d.ts +11 -12
  69. package/dist/integration/index.js +1 -1
  70. package/dist/llm/index.d.cts +11 -12
  71. package/dist/llm/index.d.ts +11 -12
  72. package/dist/logger/index.cjs +18 -17
  73. package/dist/logger/index.d.cts +42 -2
  74. package/dist/logger/index.d.ts +42 -2
  75. package/dist/logger/index.js +2 -1
  76. package/dist/{index-QV27jkxQ.d.ts → logger-EhZkzZOr.d.cts} +38 -52
  77. package/dist/{index-QV27jkxQ.d.cts → logger-EhZkzZOr.d.ts} +38 -52
  78. package/dist/mastra/index.cjs +2 -2
  79. package/dist/mastra/index.d.cts +10 -11
  80. package/dist/mastra/index.d.ts +10 -11
  81. package/dist/mastra/index.js +1 -1
  82. package/dist/mcp/index.cjs +4 -4
  83. package/dist/mcp/index.d.cts +13 -14
  84. package/dist/mcp/index.d.ts +13 -14
  85. package/dist/mcp/index.js +2 -2
  86. package/dist/memory/index.cjs +4 -4
  87. package/dist/memory/index.d.cts +11 -12
  88. package/dist/memory/index.d.ts +11 -12
  89. package/dist/memory/index.js +1 -1
  90. package/dist/network/index.cjs +8 -8
  91. package/dist/network/index.d.cts +11 -12
  92. package/dist/network/index.d.ts +11 -12
  93. package/dist/network/index.js +4 -4
  94. package/dist/relevance/index.cjs +4 -4
  95. package/dist/relevance/index.d.cts +14 -15
  96. package/dist/relevance/index.d.ts +14 -15
  97. package/dist/relevance/index.js +1 -1
  98. package/dist/server/index.cjs +4 -0
  99. package/dist/server/index.d.cts +14 -13
  100. package/dist/server/index.d.ts +14 -13
  101. package/dist/server/index.js +4 -1
  102. package/dist/storage/index.cjs +184 -3
  103. package/dist/storage/index.d.cts +82 -12
  104. package/dist/storage/index.d.ts +82 -12
  105. package/dist/storage/index.js +186 -1
  106. package/dist/telemetry/index.d.cts +13 -14
  107. package/dist/telemetry/index.d.ts +13 -14
  108. package/dist/telemetry/otel-vendor.cjs +2 -2
  109. package/dist/telemetry/otel-vendor.d.cts +1 -1
  110. package/dist/telemetry/otel-vendor.d.ts +1 -1
  111. package/dist/telemetry/otel-vendor.js +1 -1
  112. package/dist/tools/index.cjs +4 -4
  113. package/dist/tools/index.d.cts +11 -12
  114. package/dist/tools/index.d.ts +11 -12
  115. package/dist/tools/index.js +1 -1
  116. package/dist/tts/index.cjs +2 -2
  117. package/dist/tts/index.d.cts +2 -3
  118. package/dist/tts/index.d.ts +2 -3
  119. package/dist/tts/index.js +1 -1
  120. package/dist/{types-BtMyV38I.d.ts → types-Bo1uigWx.d.cts} +1 -1
  121. package/dist/{types-BtMyV38I.d.cts → types-Bo1uigWx.d.ts} +1 -1
  122. package/dist/utils.cjs +16 -16
  123. package/dist/utils.d.cts +14 -15
  124. package/dist/utils.d.ts +14 -15
  125. package/dist/utils.js +1 -1
  126. package/dist/vector/filter/index.cjs +189 -7
  127. package/dist/vector/filter/index.js +190 -1
  128. package/dist/vector/index.cjs +2 -2
  129. package/dist/vector/index.d.cts +10 -24
  130. package/dist/vector/index.d.ts +10 -24
  131. package/dist/vector/index.js +1 -1
  132. package/dist/voice/index.cjs +4 -4
  133. package/dist/voice/index.d.cts +11 -12
  134. package/dist/voice/index.d.ts +11 -12
  135. package/dist/voice/index.js +1 -1
  136. package/dist/workflows/index.cjs +17 -69
  137. package/dist/workflows/index.d.cts +195 -75
  138. package/dist/workflows/index.d.ts +195 -75
  139. package/dist/workflows/index.js +1 -1
  140. package/dist/workflows/legacy/index.cjs +90 -0
  141. package/dist/workflows/legacy/index.d.cts +87 -0
  142. package/dist/workflows/legacy/index.d.ts +87 -0
  143. package/dist/workflows/legacy/index.js +1 -0
  144. package/package.json +19 -41
  145. package/workflows/legacy.d.ts +1 -0
  146. package/dist/chunk-CMPPXW4U.js +0 -154
  147. package/dist/chunk-GH6EMQSO.js +0 -131
  148. package/dist/chunk-JMJXBE7L.js +0 -843
  149. package/dist/chunk-LGERQTJM.js +0 -190
  150. package/dist/chunk-O44MSFMZ.cjs +0 -168
  151. package/dist/chunk-T6DN4C76.cjs +0 -134
  152. package/dist/chunk-UCZWRJRW.cjs +0 -667
  153. package/dist/chunk-YK3XJ52U.cjs +0 -192
  154. package/dist/chunk-YNOTY72R.cjs +0 -845
  155. package/dist/chunk-ZY2DW2VQ.js +0 -658
  156. package/dist/storage/libsql/index.cjs +0 -588
  157. package/dist/storage/libsql/index.d.cts +0 -104
  158. package/dist/storage/libsql/index.d.ts +0 -104
  159. package/dist/storage/libsql/index.js +0 -585
  160. package/dist/vector/libsql/index.cjs +0 -14
  161. package/dist/vector/libsql/index.d.cts +0 -86
  162. package/dist/vector/libsql/index.d.ts +0 -86
  163. package/dist/vector/libsql/index.js +0 -1
  164. package/dist/workflows/vNext/index.d.cts +0 -209
  165. package/dist/workflows/vNext/index.d.ts +0 -209
  166. package/storage/libsql.d.ts +0 -1
  167. package/vector/libsql.d.ts +0 -1
  168. package/workflows/vNext.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkUVRGQEMD_cjs = require('./chunk-UVRGQEMD.cjs');
4
- var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
4
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
5
5
  var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
6
6
 
7
7
  // src/tts/index.ts
@@ -10,7 +10,7 @@ _MastraTTS_decorators = [chunkUVRGQEMD_cjs.InstrumentClass({
10
10
  prefix: "tts",
11
11
  excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
12
12
  })];
13
- exports.MastraTTS = class MastraTTS extends (_a = chunkEG74VBSP_cjs.MastraBase) {
13
+ exports.MastraTTS = class MastraTTS extends (_a = chunkYEULQPUY_cjs.MastraBase) {
14
14
  model;
15
15
  constructor({
16
16
  model
@@ -1,4 +1,4 @@
1
- import { MastraBase } from './chunk-235X76GC.js';
1
+ import { MastraBase } from './chunk-FI7R232B.js';
2
2
 
3
3
  // src/vector/vector.ts
4
4
  var MastraVector = class extends MastraBase {
@@ -8,27 +8,6 @@ var MastraVector = class extends MastraBase {
8
8
  get indexSeparator() {
9
9
  return "_";
10
10
  }
11
- baseKeys = {
12
- query: ["queryVector", "topK", "filter", "includeVector"],
13
- upsert: ["vectors", "metadata", "ids"],
14
- createIndex: ["dimension", "metric"]
15
- };
16
- normalizeArgs(method, [first, ...rest], extendedKeys = []) {
17
- if (typeof first === "object") {
18
- return first;
19
- }
20
- this.logger.warn(
21
- `Deprecation Warning: Passing individual arguments to ${method}() is deprecated.
22
- Please use an object parameter instead.
23
- Individual arguments will be removed on May 20th, 2025.`
24
- );
25
- const baseKeys = this.baseKeys[method] || [];
26
- const paramKeys = [...baseKeys, ...extendedKeys].slice(0, rest.length);
27
- return {
28
- indexName: first,
29
- ...Object.fromEntries(paramKeys.map((key, i) => [key, rest[i]]))
30
- };
31
- }
32
11
  async validateExistingIndex(indexName, dimension, metric) {
33
12
  let info;
34
13
  try {
@@ -0,0 +1,78 @@
1
+ 'use strict';
2
+
3
+ var stream = require('stream');
4
+
5
+ // src/logger/multi-logger.ts
6
+ var MultiLogger = class {
7
+ loggers;
8
+ constructor(loggers) {
9
+ this.loggers = loggers;
10
+ }
11
+ debug(message, ...args) {
12
+ this.loggers.forEach((logger) => logger.debug(message, ...args));
13
+ }
14
+ info(message, ...args) {
15
+ this.loggers.forEach((logger) => logger.info(message, ...args));
16
+ }
17
+ warn(message, ...args) {
18
+ this.loggers.forEach((logger) => logger.warn(message, ...args));
19
+ }
20
+ error(message, ...args) {
21
+ this.loggers.forEach((logger) => logger.error(message, ...args));
22
+ }
23
+ getTransports() {
24
+ const transports = [];
25
+ this.loggers.forEach((logger) => transports.push(...logger.getTransports().entries()));
26
+ return new Map(transports);
27
+ }
28
+ async getLogs(transportId) {
29
+ for (const logger of this.loggers) {
30
+ const logs = await logger.getLogs(transportId);
31
+ if (logs.length > 0) {
32
+ return logs;
33
+ }
34
+ }
35
+ return [];
36
+ }
37
+ async getLogsByRunId(args) {
38
+ for (const logger of this.loggers) {
39
+ const logs = await logger.getLogsByRunId(args);
40
+ if (logs.length > 0) {
41
+ return logs;
42
+ }
43
+ }
44
+ return [];
45
+ }
46
+ };
47
+
48
+ // src/logger/noop-logger.ts
49
+ var noopLogger = {
50
+ debug: () => {
51
+ },
52
+ info: () => {
53
+ },
54
+ warn: () => {
55
+ },
56
+ error: () => {
57
+ },
58
+ cleanup: async () => {
59
+ },
60
+ getTransports: () => /* @__PURE__ */ new Map(),
61
+ getLogs: async () => [],
62
+ getLogsByRunId: async () => []
63
+ };
64
+ var LoggerTransport = class extends stream.Transform {
65
+ constructor(opts = {}) {
66
+ super({ ...opts, objectMode: true });
67
+ }
68
+ async getLogsByRunId(_args) {
69
+ return [];
70
+ }
71
+ async getLogs() {
72
+ return [];
73
+ }
74
+ };
75
+
76
+ exports.LoggerTransport = LoggerTransport;
77
+ exports.MultiLogger = MultiLogger;
78
+ exports.noopLogger = noopLogger;
@@ -0,0 +1,74 @@
1
+ import { Transform } from 'stream';
2
+
3
+ // src/logger/multi-logger.ts
4
+ var MultiLogger = class {
5
+ loggers;
6
+ constructor(loggers) {
7
+ this.loggers = loggers;
8
+ }
9
+ debug(message, ...args) {
10
+ this.loggers.forEach((logger) => logger.debug(message, ...args));
11
+ }
12
+ info(message, ...args) {
13
+ this.loggers.forEach((logger) => logger.info(message, ...args));
14
+ }
15
+ warn(message, ...args) {
16
+ this.loggers.forEach((logger) => logger.warn(message, ...args));
17
+ }
18
+ error(message, ...args) {
19
+ this.loggers.forEach((logger) => logger.error(message, ...args));
20
+ }
21
+ getTransports() {
22
+ const transports = [];
23
+ this.loggers.forEach((logger) => transports.push(...logger.getTransports().entries()));
24
+ return new Map(transports);
25
+ }
26
+ async getLogs(transportId) {
27
+ for (const logger of this.loggers) {
28
+ const logs = await logger.getLogs(transportId);
29
+ if (logs.length > 0) {
30
+ return logs;
31
+ }
32
+ }
33
+ return [];
34
+ }
35
+ async getLogsByRunId(args) {
36
+ for (const logger of this.loggers) {
37
+ const logs = await logger.getLogsByRunId(args);
38
+ if (logs.length > 0) {
39
+ return logs;
40
+ }
41
+ }
42
+ return [];
43
+ }
44
+ };
45
+
46
+ // src/logger/noop-logger.ts
47
+ var noopLogger = {
48
+ debug: () => {
49
+ },
50
+ info: () => {
51
+ },
52
+ warn: () => {
53
+ },
54
+ error: () => {
55
+ },
56
+ cleanup: async () => {
57
+ },
58
+ getTransports: () => /* @__PURE__ */ new Map(),
59
+ getLogs: async () => [],
60
+ getLogsByRunId: async () => []
61
+ };
62
+ var LoggerTransport = class extends Transform {
63
+ constructor(opts = {}) {
64
+ super({ ...opts, objectMode: true });
65
+ }
66
+ async getLogsByRunId(_args) {
67
+ return [];
68
+ }
69
+ async getLogs() {
70
+ return [];
71
+ }
72
+ };
73
+
74
+ export { LoggerTransport, MultiLogger, noopLogger };
@@ -1,4 +1,4 @@
1
- import { createTool } from './chunk-MF5BUJO6.js';
1
+ import { createTool } from './chunk-2PW6UJMW.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  // src/integration/integration.ts
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk6KB5CPBV_cjs = require('./chunk-6KB5CPBV.cjs');
4
- var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
4
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
5
5
 
6
6
  // src/storage/base.ts
7
- var MastraStorage = class extends chunkEG74VBSP_cjs.MastraBase {
7
+ var MastraStorage = class extends chunkYEULQPUY_cjs.MastraBase {
8
8
  /** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */
9
9
  static TABLE_WORKFLOW_SNAPSHOT = chunk6KB5CPBV_cjs.TABLE_WORKFLOW_SNAPSHOT;
10
10
  /** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */
@@ -1,36 +1,15 @@
1
1
  'use strict';
2
2
 
3
- var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
3
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
4
4
 
5
5
  // src/vector/vector.ts
6
- var MastraVector = class extends chunkEG74VBSP_cjs.MastraBase {
6
+ var MastraVector = class extends chunkYEULQPUY_cjs.MastraBase {
7
7
  constructor() {
8
8
  super({ name: "MastraVector", component: "VECTOR" });
9
9
  }
10
10
  get indexSeparator() {
11
11
  return "_";
12
12
  }
13
- baseKeys = {
14
- query: ["queryVector", "topK", "filter", "includeVector"],
15
- upsert: ["vectors", "metadata", "ids"],
16
- createIndex: ["dimension", "metric"]
17
- };
18
- normalizeArgs(method, [first, ...rest], extendedKeys = []) {
19
- if (typeof first === "object") {
20
- return first;
21
- }
22
- this.logger.warn(
23
- `Deprecation Warning: Passing individual arguments to ${method}() is deprecated.
24
- Please use an object parameter instead.
25
- Individual arguments will be removed on May 20th, 2025.`
26
- );
27
- const baseKeys = this.baseKeys[method] || [];
28
- const paramKeys = [...baseKeys, ...extendedKeys].slice(0, rest.length);
29
- return {
30
- indexName: first,
31
- ...Object.fromEntries(paramKeys.map((key, i) => [key, rest[i]]))
32
- };
33
- }
34
13
  async validateExistingIndex(indexName, dimension, metric) {
35
14
  let info;
36
15
  try {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkUVRGQEMD_cjs = require('./chunk-UVRGQEMD.cjs');
4
- var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
4
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
5
5
  var chunkRWTSGWWL_cjs = require('./chunk-RWTSGWWL.cjs');
6
6
 
7
7
  // src/voice/voice.ts
@@ -10,7 +10,7 @@ _MastraVoice_decorators = [chunkUVRGQEMD_cjs.InstrumentClass({
10
10
  prefix: "voice",
11
11
  excludeMethods: ["__setTools", "__setLogger", "__setTelemetry", "#log"]
12
12
  })];
13
- exports.MastraVoice = class MastraVoice extends (_a = chunkEG74VBSP_cjs.MastraBase) {
13
+ exports.MastraVoice = class MastraVoice extends (_a = chunkYEULQPUY_cjs.MastraBase) {
14
14
  listeningModel;
15
15
  speechModel;
16
16
  speaker;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkF7HNPG53_cjs = require('./chunk-F7HNPG53.cjs');
3
+ var chunkU3L3NEOM_cjs = require('./chunk-U3L3NEOM.cjs');
4
4
  var zod = require('zod');
5
5
 
6
6
  // src/integration/integration.ts
@@ -68,7 +68,7 @@ var OpenAPIToolset = class {
68
68
  const tools = Object.keys(clientMethods).reduce((acc, key) => {
69
69
  const comment = documentations[key]?.comment;
70
70
  const fallbackComment = `Execute ${key}`;
71
- const tool = chunkF7HNPG53_cjs.createTool({
71
+ const tool = chunkU3L3NEOM_cjs.createTool({
72
72
  id: key,
73
73
  inputSchema: schemas[key] || zod.z.object({}),
74
74
  description: comment || fallbackComment,
@@ -0,0 +1,96 @@
1
+ 'use strict';
2
+
3
+ // src/logger/constants.ts
4
+ var RegisteredLogger = {
5
+ AGENT: "AGENT",
6
+ NETWORK: "NETWORK",
7
+ WORKFLOW: "WORKFLOW",
8
+ LLM: "LLM",
9
+ TTS: "TTS",
10
+ VOICE: "VOICE",
11
+ VECTOR: "VECTOR",
12
+ BUNDLER: "BUNDLER",
13
+ DEPLOYER: "DEPLOYER",
14
+ MEMORY: "MEMORY",
15
+ STORAGE: "STORAGE",
16
+ EMBEDDINGS: "EMBEDDINGS",
17
+ MCP_SERVER: "MCP_SERVER"
18
+ };
19
+ var LogLevel = {
20
+ DEBUG: "debug",
21
+ INFO: "info",
22
+ WARN: "warn",
23
+ ERROR: "error",
24
+ NONE: "silent"
25
+ };
26
+
27
+ // src/logger/logger.ts
28
+ var MastraLogger = class {
29
+ name;
30
+ level;
31
+ transports;
32
+ constructor(options = {}) {
33
+ this.name = options.name || "Mastra";
34
+ this.level = options.level || LogLevel.ERROR;
35
+ this.transports = new Map(Object.entries(options.transports || {}));
36
+ }
37
+ getTransports() {
38
+ return this.transports;
39
+ }
40
+ async getLogs(transportId) {
41
+ if (!transportId || !this.transports.has(transportId)) {
42
+ return [];
43
+ }
44
+ return this.transports.get(transportId).getLogs() ?? [];
45
+ }
46
+ async getLogsByRunId({ transportId, runId }) {
47
+ if (!transportId || !this.transports.has(transportId) || !runId) {
48
+ return [];
49
+ }
50
+ return this.transports.get(transportId).getLogsByRunId({ runId }) ?? [];
51
+ }
52
+ };
53
+
54
+ // src/logger/default-logger.ts
55
+ var createLogger = (options) => {
56
+ const logger = new ConsoleLogger(options);
57
+ logger.warn(`createLogger is deprecated. Please use "new ConsoleLogger()" from "@mastra/core/logger" instead.`);
58
+ return logger;
59
+ };
60
+ var ConsoleLogger = class extends MastraLogger {
61
+ constructor(options = {}) {
62
+ super(options);
63
+ }
64
+ debug(message, ...args) {
65
+ if (this.level === LogLevel.DEBUG) {
66
+ console.debug(message, ...args);
67
+ }
68
+ }
69
+ info(message, ...args) {
70
+ if (this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) {
71
+ console.info(message, ...args);
72
+ }
73
+ }
74
+ warn(message, ...args) {
75
+ if (this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) {
76
+ console.warn(message, ...args);
77
+ }
78
+ }
79
+ error(message, ...args) {
80
+ if (this.level === LogLevel.ERROR || this.level === LogLevel.WARN || this.level === LogLevel.INFO || this.level === LogLevel.DEBUG) {
81
+ console.error(message, ...args);
82
+ }
83
+ }
84
+ async getLogs(_transportId) {
85
+ return [];
86
+ }
87
+ async getLogsByRunId(_args) {
88
+ return [];
89
+ }
90
+ };
91
+
92
+ exports.ConsoleLogger = ConsoleLogger;
93
+ exports.LogLevel = LogLevel;
94
+ exports.MastraLogger = MastraLogger;
95
+ exports.RegisteredLogger = RegisteredLogger;
96
+ exports.createLogger = createLogger;
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkEG74VBSP_cjs = require('./chunk-EG74VBSP.cjs');
3
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
4
4
  var promises = require('fs/promises');
5
5
  var dotenv = require('dotenv');
6
6
 
7
- var MastraBundler = class extends chunkEG74VBSP_cjs.MastraBase {
7
+ var MastraBundler = class extends chunkYEULQPUY_cjs.MastraBase {
8
8
  constructor({ name, component = "BUNDLER" }) {
9
9
  super({ component, name });
10
10
  }
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkS3Y7QBO7_cjs = require('../../chunk-S3Y7QBO7.cjs');
4
- var chunkF7HNPG53_cjs = require('../../chunk-F7HNPG53.cjs');
5
- var chunkEG74VBSP_cjs = require('../../chunk-EG74VBSP.cjs');
6
- var chunkO44MSFMZ_cjs = require('../../chunk-O44MSFMZ.cjs');
7
- var chunkLABUWBKX_cjs = require('../../chunk-LABUWBKX.cjs');
3
+ var chunkAOGUTJUO_cjs = require('./chunk-AOGUTJUO.cjs');
4
+ var chunkU3L3NEOM_cjs = require('./chunk-U3L3NEOM.cjs');
5
+ var chunkYEULQPUY_cjs = require('./chunk-YEULQPUY.cjs');
6
+ var chunkSWW4EBUZ_cjs = require('./chunk-SWW4EBUZ.cjs');
7
+ var chunkLABUWBKX_cjs = require('./chunk-LABUWBKX.cjs');
8
8
  var crypto = require('crypto');
9
9
  var EventEmitter = require('events');
10
10
  var zod = require('zod');
@@ -14,11 +14,11 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
14
14
 
15
15
  var EventEmitter__default = /*#__PURE__*/_interopDefault(EventEmitter);
16
16
 
17
- // src/workflows/vNext/execution-engine.ts
18
- var ExecutionEngine = class extends chunkEG74VBSP_cjs.MastraBase {
17
+ // src/workflows/execution-engine.ts
18
+ var ExecutionEngine = class extends chunkYEULQPUY_cjs.MastraBase {
19
19
  mastra;
20
20
  constructor({ mastra }) {
21
- super({ name: "ExecutionEngine", component: chunkO44MSFMZ_cjs.RegisteredLogger.WORKFLOW });
21
+ super({ name: "ExecutionEngine", component: chunkSWW4EBUZ_cjs.RegisteredLogger.WORKFLOW });
22
22
  this.mastra = mastra;
23
23
  }
24
24
  __registerMastra(mastra) {
@@ -26,7 +26,7 @@ var ExecutionEngine = class extends chunkEG74VBSP_cjs.MastraBase {
26
26
  }
27
27
  };
28
28
 
29
- // src/workflows/vNext/default.ts
29
+ // src/workflows/default.ts
30
30
  var DefaultExecutionEngine = class extends ExecutionEngine {
31
31
  async fmtReturnValue(executionSpan, emitter, stepResults, lastOutput, error) {
32
32
  const base = {
@@ -647,9 +647,9 @@ var DefaultExecutionEngine = class extends ExecutionEngine {
647
647
  }
648
648
  };
649
649
 
650
- // src/workflows/vNext/workflow.ts
650
+ // src/workflows/workflow.ts
651
651
  function createStep(params) {
652
- if (params instanceof chunkS3Y7QBO7_cjs.Agent) {
652
+ if (params instanceof chunkAOGUTJUO_cjs.Agent) {
653
653
  return {
654
654
  id: params.name,
655
655
  // @ts-ignore
@@ -673,7 +673,7 @@ function createStep(params) {
673
673
  }
674
674
  };
675
675
  }
676
- if (params instanceof chunkF7HNPG53_cjs.Tool) {
676
+ if (params instanceof chunkU3L3NEOM_cjs.Tool) {
677
677
  if (!params.inputSchema || !params.outputSchema) {
678
678
  throw new Error("Tool must have input and output schemas defined");
679
679
  }
@@ -711,10 +711,10 @@ function cloneStep(step, opts) {
711
711
  };
712
712
  }
713
713
  function createWorkflow(params) {
714
- return new NewWorkflow(params);
714
+ return new Workflow(params);
715
715
  }
716
716
  function cloneWorkflow(workflow, opts) {
717
- const wf = new NewWorkflow({
717
+ const wf = new Workflow({
718
718
  id: opts.id,
719
719
  inputSchema: workflow.inputSchema,
720
720
  outputSchema: workflow.outputSchema,
@@ -725,7 +725,7 @@ function cloneWorkflow(workflow, opts) {
725
725
  wf.commit();
726
726
  return wf;
727
727
  }
728
- var NewWorkflow = class extends chunkEG74VBSP_cjs.MastraBase {
728
+ var Workflow = class extends chunkYEULQPUY_cjs.MastraBase {
729
729
  id;
730
730
  description;
731
731
  inputSchema;
@@ -749,7 +749,7 @@ var NewWorkflow = class extends chunkEG74VBSP_cjs.MastraBase {
749
749
  retryConfig,
750
750
  steps
751
751
  }) {
752
- super({ name: id, component: chunkO44MSFMZ_cjs.RegisteredLogger.WORKFLOW });
752
+ super({ name: id, component: chunkSWW4EBUZ_cjs.RegisteredLogger.WORKFLOW });
753
753
  this.id = id;
754
754
  this.description = description;
755
755
  this.inputSchema = inputSchema;
@@ -1043,14 +1043,15 @@ var NewWorkflow = class extends chunkEG74VBSP_cjs.MastraBase {
1043
1043
  suspend,
1044
1044
  resume,
1045
1045
  emitter,
1046
- mastra
1046
+ mastra,
1047
+ runtimeContext
1047
1048
  }) {
1048
1049
  this.__registerMastra(mastra);
1049
1050
  const run = resume?.steps?.length ? this.createRun({ runId: resume.runId }) : this.createRun();
1050
1051
  const unwatch = run.watch((event) => {
1051
1052
  emitter.emit("nested-watch", { event, workflowId: this.id, runId: run.runId, isResume: !!resume?.steps?.length });
1052
1053
  });
1053
- const res = resume?.steps?.length ? await run.resume({ resumeData, step: resume.steps }) : await run.start({ inputData });
1054
+ const res = resume?.steps?.length ? await run.resume({ resumeData, step: resume.steps, runtimeContext }) : await run.start({ inputData, runtimeContext });
1054
1055
  unwatch();
1055
1056
  const suspendedSteps = Object.entries(res.steps).filter(([_stepName, stepResult]) => {
1056
1057
  const stepRes = stepResult;
@@ -1163,7 +1164,7 @@ var Run = class {
1163
1164
  const { type, payload, eventTimestamp } = event;
1164
1165
  const prefixedSteps = Object.fromEntries(
1165
1166
  Object.entries(payload?.workflowState?.steps ?? {}).map(([stepId, step]) => [
1166
- `${this.workflowId}.${stepId}`,
1167
+ `${workflowId}.${stepId}`,
1167
1168
  step
1168
1169
  ])
1169
1170
  );
@@ -1260,8 +1261,8 @@ function deepMerge(a, b) {
1260
1261
 
1261
1262
  exports.DefaultExecutionEngine = DefaultExecutionEngine;
1262
1263
  exports.ExecutionEngine = ExecutionEngine;
1263
- exports.NewWorkflow = NewWorkflow;
1264
1264
  exports.Run = Run;
1265
+ exports.Workflow = Workflow;
1265
1266
  exports.cloneStep = cloneStep;
1266
1267
  exports.cloneWorkflow = cloneWorkflow;
1267
1268
  exports.createStep = createStep;