@mastra/core 0.10.13 → 0.10.15-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 (235) hide show
  1. package/a2a.d.ts +1 -0
  2. package/agent.d.ts +1 -0
  3. package/base.d.ts +1 -0
  4. package/bundler.d.ts +1 -0
  5. package/deployer.d.ts +1 -0
  6. package/di.d.ts +1 -0
  7. package/dist/a2a/index.cjs +79 -0
  8. package/dist/a2a/index.d.cts +780 -0
  9. package/dist/a2a/index.d.ts +780 -0
  10. package/dist/a2a/index.js +68 -0
  11. package/dist/agent/index.cjs +15 -0
  12. package/dist/agent/index.d.cts +29 -0
  13. package/dist/agent/index.d.ts +29 -0
  14. package/dist/agent/index.js +2 -0
  15. package/dist/base-B_y9sMg0.d.cts +162 -0
  16. package/dist/base-CTj7ESwt.d.cts +4132 -0
  17. package/dist/base-ClrXcCRx.d.ts +162 -0
  18. package/dist/base-qVqAnB-c.d.ts +4132 -0
  19. package/dist/base.cjs +10 -0
  20. package/dist/base.d.cts +6 -0
  21. package/dist/base.d.ts +6 -0
  22. package/dist/base.js +1 -0
  23. package/dist/bundler/index.cjs +10 -0
  24. package/dist/bundler/index.d.cts +30 -0
  25. package/dist/bundler/index.d.ts +30 -0
  26. package/dist/bundler/index.js +1 -0
  27. package/dist/chunk-32C7JDIZ.js +1 -0
  28. package/dist/chunk-4UWPFBC6.js +88 -0
  29. package/dist/chunk-4Z3OU5RY.cjs +31 -0
  30. package/dist/chunk-5HTMDAXP.js +359 -0
  31. package/dist/chunk-5IEKR756.js +53 -0
  32. package/dist/chunk-5YDTZN2X.js +114 -0
  33. package/dist/chunk-6UNGH46J.js +75 -0
  34. package/dist/chunk-6Y4UL5Z6.cjs +94 -0
  35. package/dist/chunk-7H2GET5Z.cjs +668 -0
  36. package/dist/chunk-7HZ6NIAF.cjs +2 -0
  37. package/dist/chunk-7XQIPES3.js +668 -0
  38. package/dist/chunk-AKYTYALY.js +70 -0
  39. package/dist/chunk-AOWJUV2N.js +2415 -0
  40. package/dist/chunk-ATXBSEFT.js +22 -0
  41. package/dist/chunk-B6TOBUS6.cjs +80 -0
  42. package/dist/chunk-B7SQOKEC.cjs +91 -0
  43. package/dist/chunk-BB4KXGBU.js +83 -0
  44. package/dist/chunk-BB6DPGIV.cjs +6 -0
  45. package/dist/chunk-BVD7NVAR.cjs +244 -0
  46. package/dist/chunk-C4LMN2IR.js +27 -0
  47. package/dist/chunk-DR4JS662.js +989 -0
  48. package/dist/chunk-F2WMR75C.cjs +183 -0
  49. package/dist/chunk-FEYYOBBG.cjs +24 -0
  50. package/dist/chunk-FL5SZ2XU.js +181 -0
  51. package/dist/chunk-GH2KM66J.js +37 -0
  52. package/dist/chunk-GWFS5DAR.cjs +37 -0
  53. package/dist/chunk-HNEE7IF4.js +60 -0
  54. package/dist/chunk-HSVOEWAM.cjs +2 -0
  55. package/dist/chunk-IBKM5CLQ.js +428 -0
  56. package/dist/chunk-ID5LG5CQ.cjs +659 -0
  57. package/dist/chunk-J52TXHZV.cjs +73 -0
  58. package/dist/chunk-J62R4M7K.js +240 -0
  59. package/dist/chunk-JNMQKJH4.js +10 -0
  60. package/dist/chunk-JQOMTERC.js +89 -0
  61. package/dist/chunk-LABUWBKX.cjs +71 -0
  62. package/dist/chunk-LBUQ6YNU.cjs +447 -0
  63. package/dist/chunk-LXFZUKP3.cjs +34 -0
  64. package/dist/chunk-MP2QBLUJ.cjs +70 -0
  65. package/dist/chunk-MUNFCOMB.cjs +62 -0
  66. package/dist/chunk-MVCHTRVB.js +5038 -0
  67. package/dist/chunk-NH5WJNNS.js +1 -0
  68. package/dist/chunk-P3Q73CAW.cjs +55 -0
  69. package/dist/chunk-Q33INUG2.cjs +81 -0
  70. package/dist/chunk-QFTBW7ZZ.cjs +2 -0
  71. package/dist/chunk-QQ5K5TZE.cjs +619 -0
  72. package/dist/chunk-R4V75T7J.js +1 -0
  73. package/dist/chunk-RVFWMGGR.js +77 -0
  74. package/dist/chunk-SGGPJWRQ.js +69 -0
  75. package/dist/chunk-ST5RMVLG.cjs +87 -0
  76. package/dist/chunk-TC2SCOTE.js +605 -0
  77. package/dist/chunk-TTMYHBQM.js +657 -0
  78. package/dist/chunk-U64IJDC5.cjs +109 -0
  79. package/dist/chunk-ULZ6MRTN.cjs +5065 -0
  80. package/dist/chunk-V5D2LIF5.js +68 -0
  81. package/dist/chunk-WQNOATKB.js +103 -0
  82. package/dist/chunk-Y7D2JLKS.js +4 -0
  83. package/dist/chunk-YOQP5T77.js +32 -0
  84. package/dist/chunk-ZCU3PLIL.cjs +2429 -0
  85. package/dist/chunk-ZIZ3CVHN.cjs +120 -0
  86. package/dist/chunk-ZPOUMTTH.cjs +362 -0
  87. package/dist/chunk-ZTPPDHQK.cjs +991 -0
  88. package/dist/chunk-ZZLBNB3U.cjs +12 -0
  89. package/dist/deployer/index.cjs +10 -0
  90. package/dist/deployer/index.d.cts +19 -0
  91. package/dist/deployer/index.d.ts +19 -0
  92. package/dist/deployer/index.js +1 -0
  93. package/dist/di/index.cjs +10 -0
  94. package/dist/di/index.d.cts +1 -0
  95. package/dist/di/index.d.ts +1 -0
  96. package/dist/di/index.js +1 -0
  97. package/dist/error/index.cjs +22 -0
  98. package/dist/error/index.d.cts +86 -0
  99. package/dist/error/index.d.ts +86 -0
  100. package/dist/error/index.js +1 -0
  101. package/dist/eval/index.cjs +14 -0
  102. package/dist/eval/index.d.cts +43 -0
  103. package/dist/eval/index.d.ts +43 -0
  104. package/dist/eval/index.js +1 -0
  105. package/dist/hooks/index.cjs +18 -0
  106. package/dist/hooks/index.d.cts +33 -0
  107. package/dist/hooks/index.d.ts +33 -0
  108. package/dist/hooks/index.js +1 -0
  109. package/dist/index.cjs +285 -0
  110. package/dist/index.d.cts +92 -0
  111. package/dist/index.d.ts +92 -0
  112. package/dist/index.js +112 -0
  113. package/dist/integration/index.cjs +14 -0
  114. package/dist/integration/index.d.cts +65 -0
  115. package/dist/integration/index.d.ts +65 -0
  116. package/dist/integration/index.js +1 -0
  117. package/dist/llm/index.cjs +10 -0
  118. package/dist/llm/index.d.cts +29 -0
  119. package/dist/llm/index.d.ts +29 -0
  120. package/dist/llm/index.js +1 -0
  121. package/dist/logger/index.cjs +43 -0
  122. package/dist/logger/index.d.cts +96 -0
  123. package/dist/logger/index.d.ts +96 -0
  124. package/dist/logger/index.js +2 -0
  125. package/dist/logger-B8XXh6ya.d.cts +159 -0
  126. package/dist/logger-Bpa2oLL4.d.ts +159 -0
  127. package/dist/mastra/index.cjs +10 -0
  128. package/dist/mastra/index.d.cts +29 -0
  129. package/dist/mastra/index.d.ts +29 -0
  130. package/dist/mastra/index.js +1 -0
  131. package/dist/mcp/index.cjs +106 -0
  132. package/dist/mcp/index.d.cts +29 -0
  133. package/dist/mcp/index.d.ts +29 -0
  134. package/dist/mcp/index.js +100 -0
  135. package/dist/memory/index.cjs +18 -0
  136. package/dist/memory/index.d.cts +29 -0
  137. package/dist/memory/index.d.ts +29 -0
  138. package/dist/memory/index.js +1 -0
  139. package/dist/network/index.cjs +311 -0
  140. package/dist/network/index.d.cts +29 -0
  141. package/dist/network/index.d.ts +29 -0
  142. package/dist/network/index.js +309 -0
  143. package/dist/network/vNext/index.cjs +880 -0
  144. package/dist/network/vNext/index.d.cts +29 -0
  145. package/dist/network/vNext/index.d.ts +29 -0
  146. package/dist/network/vNext/index.js +878 -0
  147. package/dist/relevance/index.cjs +18 -0
  148. package/dist/relevance/index.d.cts +50 -0
  149. package/dist/relevance/index.d.ts +50 -0
  150. package/dist/relevance/index.js +1 -0
  151. package/dist/runtime-context/index.cjs +10 -0
  152. package/dist/runtime-context/index.d.cts +52 -0
  153. package/dist/runtime-context/index.d.ts +52 -0
  154. package/dist/runtime-context/index.js +1 -0
  155. package/dist/server/index.cjs +62 -0
  156. package/dist/server/index.d.cts +52 -0
  157. package/dist/server/index.d.ts +52 -0
  158. package/dist/server/index.js +59 -0
  159. package/dist/storage/index.cjs +336 -0
  160. package/dist/storage/index.d.cts +149 -0
  161. package/dist/storage/index.d.ts +149 -0
  162. package/dist/storage/index.js +303 -0
  163. package/dist/telemetry/index.cjs +30 -0
  164. package/dist/telemetry/index.d.cts +75 -0
  165. package/dist/telemetry/index.d.ts +75 -0
  166. package/dist/telemetry/index.js +1 -0
  167. package/dist/telemetry/otel-vendor.cjs +103 -0
  168. package/dist/telemetry/otel-vendor.d.cts +20 -0
  169. package/dist/telemetry/otel-vendor.d.ts +20 -0
  170. package/dist/telemetry/otel-vendor.js +57 -0
  171. package/dist/tools/index.cjs +18 -0
  172. package/dist/tools/index.d.cts +41 -0
  173. package/dist/tools/index.d.ts +41 -0
  174. package/dist/tools/index.js +1 -0
  175. package/dist/tts/index.cjs +10 -0
  176. package/dist/tts/index.d.cts +28 -0
  177. package/dist/tts/index.d.ts +28 -0
  178. package/dist/tts/index.js +1 -0
  179. package/dist/types-Bo1uigWx.d.cts +17 -0
  180. package/dist/types-Bo1uigWx.d.ts +17 -0
  181. package/dist/utils.cjs +62 -0
  182. package/dist/utils.d.cts +150 -0
  183. package/dist/utils.d.ts +150 -0
  184. package/dist/utils.js +1 -0
  185. package/dist/vector/filter/index.cjs +192 -0
  186. package/dist/vector/filter/index.d.cts +128 -0
  187. package/dist/vector/filter/index.d.ts +128 -0
  188. package/dist/vector/filter/index.js +190 -0
  189. package/dist/vector/index.cjs +10 -0
  190. package/dist/vector/index.d.cts +77 -0
  191. package/dist/vector/index.d.ts +77 -0
  192. package/dist/vector/index.js +1 -0
  193. package/dist/voice/index.cjs +18 -0
  194. package/dist/voice/index.d.cts +29 -0
  195. package/dist/voice/index.d.ts +29 -0
  196. package/dist/voice/index.js +1 -0
  197. package/dist/workflows/constants.cjs +10 -0
  198. package/dist/workflows/constants.d.cts +3 -0
  199. package/dist/workflows/constants.d.ts +3 -0
  200. package/dist/workflows/constants.js +1 -0
  201. package/dist/workflows/index.cjs +42 -0
  202. package/dist/workflows/index.d.cts +285 -0
  203. package/dist/workflows/index.d.ts +285 -0
  204. package/dist/workflows/index.js +1 -0
  205. package/dist/workflows/legacy/index.cjs +90 -0
  206. package/dist/workflows/legacy/index.d.cts +91 -0
  207. package/dist/workflows/legacy/index.d.ts +91 -0
  208. package/dist/workflows/legacy/index.js +1 -0
  209. package/error.d.ts +1 -0
  210. package/eval.d.ts +1 -0
  211. package/hooks.d.ts +1 -0
  212. package/integration.d.ts +1 -0
  213. package/llm.d.ts +1 -0
  214. package/logger.d.ts +1 -0
  215. package/mastra.d.ts +1 -0
  216. package/mcp.d.ts +1 -0
  217. package/memory.d.ts +1 -0
  218. package/network/vNext.d.ts +1 -0
  219. package/network.d.ts +1 -0
  220. package/package.json +2 -3
  221. package/relevance.d.ts +1 -0
  222. package/runtime-context.d.ts +1 -0
  223. package/server.d.ts +1 -0
  224. package/storage.d.ts +1 -0
  225. package/telemetry/otel-vendor.d.ts +1 -0
  226. package/telemetry.d.ts +1 -0
  227. package/tools.d.ts +1 -0
  228. package/tts.d.ts +1 -0
  229. package/utils.d.ts +1 -0
  230. package/vector/filter.d.ts +1 -0
  231. package/vector.d.ts +1 -0
  232. package/voice.d.ts +1 -0
  233. package/workflows/_constants.d.ts +1 -0
  234. package/workflows/legacy.d.ts +1 -0
  235. package/workflows.d.ts +1 -0
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var chunk4Z3OU5RY_cjs = require('../chunk-4Z3OU5RY.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "Tool", {
8
+ enumerable: true,
9
+ get: function () { return chunk4Z3OU5RY_cjs.Tool; }
10
+ });
11
+ Object.defineProperty(exports, "createTool", {
12
+ enumerable: true,
13
+ get: function () { return chunk4Z3OU5RY_cjs.createTool; }
14
+ });
15
+ Object.defineProperty(exports, "isVercelTool", {
16
+ enumerable: true,
17
+ get: function () { return chunk4Z3OU5RY_cjs.isVercelTool; }
18
+ });
@@ -0,0 +1,41 @@
1
+ import { V as VercelTool, c as ToolAction } from '../base-CTj7ESwt.cjs';
2
+ export { C as CoreTool, at as InternalCoreTool, ar as Tool, au as ToolExecutionContext, as as createTool } from '../base-CTj7ESwt.cjs';
3
+ import '../base-B_y9sMg0.cjs';
4
+ import 'ai';
5
+ import 'json-schema';
6
+ import 'zod';
7
+ import '../logger-B8XXh6ya.cjs';
8
+ import '../error/index.cjs';
9
+ import 'stream';
10
+ import '../types-Bo1uigWx.cjs';
11
+ import 'sift';
12
+ import '../runtime-context/index.cjs';
13
+ import '@opentelemetry/api';
14
+ import 'xstate';
15
+ import 'node:events';
16
+ import '../vector/index.cjs';
17
+ import '../vector/filter/index.cjs';
18
+ import '../tts/index.cjs';
19
+ import '@opentelemetry/sdk-trace-base';
20
+ import 'node:http';
21
+ import 'hono';
22
+ import 'stream/web';
23
+ import 'events';
24
+ import 'node:stream/web';
25
+ import '../workflows/constants.cjs';
26
+ import 'ai/test';
27
+ import '../deployer/index.cjs';
28
+ import '../bundler/index.cjs';
29
+ import 'hono/cors';
30
+ import 'hono-openapi';
31
+
32
+ type ToolToConvert = VercelTool | ToolAction<any, any, any>;
33
+
34
+ /**
35
+ * Checks if a tool is a Vercel Tool
36
+ * @param tool - The tool to check
37
+ * @returns True if the tool is a Vercel Tool, false otherwise
38
+ */
39
+ declare function isVercelTool(tool?: ToolToConvert): tool is VercelTool;
40
+
41
+ export { ToolAction, VercelTool, isVercelTool };
@@ -0,0 +1,41 @@
1
+ import { V as VercelTool, c as ToolAction } from '../base-qVqAnB-c.js';
2
+ export { C as CoreTool, at as InternalCoreTool, ar as Tool, au as ToolExecutionContext, as as createTool } from '../base-qVqAnB-c.js';
3
+ import '../base-ClrXcCRx.js';
4
+ import 'ai';
5
+ import 'json-schema';
6
+ import 'zod';
7
+ import '../logger-Bpa2oLL4.js';
8
+ import '../error/index.js';
9
+ import 'stream';
10
+ import '../types-Bo1uigWx.js';
11
+ import 'sift';
12
+ import '../runtime-context/index.js';
13
+ import '@opentelemetry/api';
14
+ import 'xstate';
15
+ import 'node:events';
16
+ import '../vector/index.js';
17
+ import '../vector/filter/index.js';
18
+ import '../tts/index.js';
19
+ import '@opentelemetry/sdk-trace-base';
20
+ import 'node:http';
21
+ import 'hono';
22
+ import 'stream/web';
23
+ import 'events';
24
+ import 'node:stream/web';
25
+ import '../workflows/constants.js';
26
+ import 'ai/test';
27
+ import '../deployer/index.js';
28
+ import '../bundler/index.js';
29
+ import 'hono/cors';
30
+ import 'hono-openapi';
31
+
32
+ type ToolToConvert = VercelTool | ToolAction<any, any, any>;
33
+
34
+ /**
35
+ * Checks if a tool is a Vercel Tool
36
+ * @param tool - The tool to check
37
+ * @returns True if the tool is a Vercel Tool, false otherwise
38
+ */
39
+ declare function isVercelTool(tool?: ToolToConvert): tool is VercelTool;
40
+
41
+ export { ToolAction, VercelTool, isVercelTool };
@@ -0,0 +1 @@
1
+ export { Tool, createTool, isVercelTool } from '../chunk-C4LMN2IR.js';
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var chunkGWFS5DAR_cjs = require('../chunk-GWFS5DAR.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "MastraTTS", {
8
+ enumerable: true,
9
+ get: function () { return chunkGWFS5DAR_cjs.MastraTTS; }
10
+ });
@@ -0,0 +1,28 @@
1
+ import { M as MastraBase } from '../base-B_y9sMg0.cjs';
2
+ import '@opentelemetry/api';
3
+ import '../logger-B8XXh6ya.cjs';
4
+ import '../error/index.cjs';
5
+ import 'stream';
6
+ import '@opentelemetry/sdk-trace-base';
7
+
8
+ interface BuiltInModelConfig {
9
+ provider: string;
10
+ name: string;
11
+ apiKey?: string;
12
+ }
13
+ interface TTSConfig {
14
+ model: BuiltInModelConfig;
15
+ }
16
+ declare abstract class MastraTTS extends MastraBase {
17
+ model: BuiltInModelConfig;
18
+ constructor({ model }: TTSConfig);
19
+ traced<T extends Function>(method: T, methodName: string): T;
20
+ abstract generate({ text }: {
21
+ text: string;
22
+ }): Promise<any>;
23
+ abstract stream({ text }: {
24
+ text: string;
25
+ }): Promise<any>;
26
+ }
27
+
28
+ export { MastraTTS, type TTSConfig };
@@ -0,0 +1,28 @@
1
+ import { M as MastraBase } from '../base-ClrXcCRx.js';
2
+ import '@opentelemetry/api';
3
+ import '../logger-Bpa2oLL4.js';
4
+ import '../error/index.js';
5
+ import 'stream';
6
+ import '@opentelemetry/sdk-trace-base';
7
+
8
+ interface BuiltInModelConfig {
9
+ provider: string;
10
+ name: string;
11
+ apiKey?: string;
12
+ }
13
+ interface TTSConfig {
14
+ model: BuiltInModelConfig;
15
+ }
16
+ declare abstract class MastraTTS extends MastraBase {
17
+ model: BuiltInModelConfig;
18
+ constructor({ model }: TTSConfig);
19
+ traced<T extends Function>(method: T, methodName: string): T;
20
+ abstract generate({ text }: {
21
+ text: string;
22
+ }): Promise<any>;
23
+ abstract stream({ text }: {
24
+ text: string;
25
+ }): Promise<any>;
26
+ }
27
+
28
+ export { MastraTTS, type TTSConfig };
@@ -0,0 +1 @@
1
+ export { MastraTTS } from '../chunk-GH2KM66J.js';
@@ -0,0 +1,17 @@
1
+ interface MetricResult {
2
+ score: number;
3
+ info?: Record<string, any>;
4
+ }
5
+ declare abstract class Metric {
6
+ abstract measure(input: string, output: string): Promise<MetricResult>;
7
+ }
8
+
9
+ interface TestInfo {
10
+ testName?: string;
11
+ testPath?: string;
12
+ }
13
+ interface EvaluationResult extends MetricResult {
14
+ output: string;
15
+ }
16
+
17
+ export { type EvaluationResult as E, Metric as M, type TestInfo as T, type MetricResult as a };
@@ -0,0 +1,17 @@
1
+ interface MetricResult {
2
+ score: number;
3
+ info?: Record<string, any>;
4
+ }
5
+ declare abstract class Metric {
6
+ abstract measure(input: string, output: string): Promise<MetricResult>;
7
+ }
8
+
9
+ interface TestInfo {
10
+ testName?: string;
11
+ testPath?: string;
12
+ }
13
+ interface EvaluationResult extends MetricResult {
14
+ output: string;
15
+ }
16
+
17
+ export { type EvaluationResult as E, Metric as M, type TestInfo as T, type MetricResult as a };
package/dist/utils.cjs ADDED
@@ -0,0 +1,62 @@
1
+ 'use strict';
2
+
3
+ var chunkLBUQ6YNU_cjs = require('./chunk-LBUQ6YNU.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "checkEvalStorageFields", {
8
+ enumerable: true,
9
+ get: function () { return chunkLBUQ6YNU_cjs.checkEvalStorageFields; }
10
+ });
11
+ Object.defineProperty(exports, "createMastraProxy", {
12
+ enumerable: true,
13
+ get: function () { return chunkLBUQ6YNU_cjs.createMastraProxy; }
14
+ });
15
+ Object.defineProperty(exports, "deepMerge", {
16
+ enumerable: true,
17
+ get: function () { return chunkLBUQ6YNU_cjs.deepMerge; }
18
+ });
19
+ Object.defineProperty(exports, "delay", {
20
+ enumerable: true,
21
+ get: function () { return chunkLBUQ6YNU_cjs.delay; }
22
+ });
23
+ Object.defineProperty(exports, "ensureToolProperties", {
24
+ enumerable: true,
25
+ get: function () { return chunkLBUQ6YNU_cjs.ensureToolProperties; }
26
+ });
27
+ Object.defineProperty(exports, "generateEmptyFromSchema", {
28
+ enumerable: true,
29
+ get: function () { return chunkLBUQ6YNU_cjs.generateEmptyFromSchema; }
30
+ });
31
+ Object.defineProperty(exports, "isCoreMessage", {
32
+ enumerable: true,
33
+ get: function () { return chunkLBUQ6YNU_cjs.isCoreMessage; }
34
+ });
35
+ Object.defineProperty(exports, "isUiMessage", {
36
+ enumerable: true,
37
+ get: function () { return chunkLBUQ6YNU_cjs.isUiMessage; }
38
+ });
39
+ Object.defineProperty(exports, "isZodType", {
40
+ enumerable: true,
41
+ get: function () { return chunkLBUQ6YNU_cjs.isZodType; }
42
+ });
43
+ Object.defineProperty(exports, "makeCoreTool", {
44
+ enumerable: true,
45
+ get: function () { return chunkLBUQ6YNU_cjs.makeCoreTool; }
46
+ });
47
+ Object.defineProperty(exports, "maskStreamTags", {
48
+ enumerable: true,
49
+ get: function () { return chunkLBUQ6YNU_cjs.maskStreamTags; }
50
+ });
51
+ Object.defineProperty(exports, "parseFieldKey", {
52
+ enumerable: true,
53
+ get: function () { return chunkLBUQ6YNU_cjs.parseFieldKey; }
54
+ });
55
+ Object.defineProperty(exports, "parseSqlIdentifier", {
56
+ enumerable: true,
57
+ get: function () { return chunkLBUQ6YNU_cjs.parseSqlIdentifier; }
58
+ });
59
+ Object.defineProperty(exports, "resolveSerializedZodOutput", {
60
+ enumerable: true,
61
+ get: function () { return chunkLBUQ6YNU_cjs.resolveSerializedZodOutput; }
62
+ });
@@ -0,0 +1,150 @@
1
+ import { M as Mastra, a as MastraPrimitives, b as MastraMemory, T as ToolsInput, V as VercelTool, c as ToolAction, C as CoreTool, A as Agent, L as LegacyWorkflow, d as LegacyStep, S as StepExecutionContext, W as WorkflowContext, e as Workflow, f as Step, g as AgentNetwork, N as NewAgentNetwork, h as MCPServerBase } from './base-CTj7ESwt.cjs';
2
+ import { LanguageModelV1, CoreMessage, Message } from 'ai';
3
+ import { MastraTTS } from './tts/index.cjs';
4
+ import { MastraVector } from './vector/index.cjs';
5
+ import { VectorFilter } from './vector/filter/index.cjs';
6
+ import { M as Metric } from './types-Bo1uigWx.cjs';
7
+ import { z } from 'zod';
8
+ import { I as IMastraLogger } from './logger-B8XXh6ya.cjs';
9
+ import './base-B_y9sMg0.cjs';
10
+ import { RuntimeContext } from './runtime-context/index.cjs';
11
+ import 'json-schema';
12
+ import 'sift';
13
+ import '@opentelemetry/api';
14
+ import 'xstate';
15
+ import 'node:events';
16
+ import 'node:http';
17
+ import 'hono';
18
+ import 'stream/web';
19
+ import 'events';
20
+ import 'node:stream/web';
21
+ import './workflows/constants.cjs';
22
+ import 'ai/test';
23
+ import './deployer/index.cjs';
24
+ import './bundler/index.cjs';
25
+ import 'hono/cors';
26
+ import 'hono-openapi';
27
+ import './error/index.cjs';
28
+ import 'stream';
29
+ import '@opentelemetry/sdk-trace-base';
30
+
31
+ declare const delay: (ms: number) => Promise<unknown>;
32
+ /**
33
+ * Deep merges two objects, recursively merging nested objects and arrays
34
+ */
35
+ declare function deepMerge<T extends object = object>(target: T, source: Partial<T>): T;
36
+ declare function generateEmptyFromSchema(schema: string): Record<string, any>;
37
+ interface TagMaskOptions {
38
+ /** Called when masking begins */
39
+ onStart?: () => void;
40
+ /** Called when masking ends */
41
+ onEnd?: () => void;
42
+ /** Called for each chunk that is masked */
43
+ onMask?: (chunk: string) => void;
44
+ }
45
+ /**
46
+ * Transforms a stream by masking content between XML tags.
47
+ * @param stream Input stream to transform
48
+ * @param tag Tag name to mask between (e.g. for <foo>...</foo>, use 'foo')
49
+ * @param options Optional configuration for masking behavior
50
+ */
51
+ declare function maskStreamTags(stream: AsyncIterable<string>, tag: string, options?: TagMaskOptions): AsyncIterable<string>;
52
+ /**
53
+ * Resolve serialized zod output - This function takes the string output ot the `jsonSchemaToZod` function
54
+ * and instantiates the zod object correctly.
55
+ *
56
+ * @param schema - serialized zod object
57
+ * @returns resolved zod object
58
+ */
59
+ declare function resolveSerializedZodOutput(schema: string): z.ZodType;
60
+ interface ToolOptions {
61
+ name: string;
62
+ runId?: string;
63
+ threadId?: string;
64
+ resourceId?: string;
65
+ logger?: IMastraLogger;
66
+ description?: string;
67
+ mastra?: (Mastra & MastraPrimitives) | MastraPrimitives;
68
+ runtimeContext: RuntimeContext;
69
+ memory?: MastraMemory;
70
+ agentName?: string;
71
+ model?: LanguageModelV1;
72
+ }
73
+ type ToolToConvert = VercelTool | ToolAction<any, any, any>;
74
+ /**
75
+ * Checks if a value is a Zod type
76
+ * @param value - The value to check
77
+ * @returns True if the value is a Zod type, false otherwise
78
+ */
79
+ declare function isZodType(value: unknown): value is z.ZodType;
80
+ /**
81
+ * Ensures a tool has an ID and inputSchema by generating one if not present
82
+ * @param tool - The tool to ensure has an ID and inputSchema
83
+ * @returns The tool with an ID and inputSchema
84
+ */
85
+ declare function ensureToolProperties(tools: ToolsInput): ToolsInput;
86
+ /**
87
+ * Converts a Vercel Tool or Mastra Tool into a CoreTool format
88
+ * @param originalTool - The tool to convert (either VercelTool or ToolAction)
89
+ * @param options - Tool options including Mastra-specific settings
90
+ * @param logType - Type of tool to log (tool or toolset)
91
+ * @returns A CoreTool that can be used by the system
92
+ */
93
+ declare function makeCoreTool(originalTool: ToolToConvert, options: ToolOptions, logType?: 'tool' | 'toolset' | 'client-tool'): CoreTool;
94
+ /**
95
+ * Creates a proxy for a Mastra instance to handle deprecated properties
96
+ * @param mastra - The Mastra instance to proxy
97
+ * @param logger - The logger to use for warnings
98
+ * @returns A proxy for the Mastra instance
99
+ */
100
+ declare function createMastraProxy({ mastra, logger }: {
101
+ mastra: Mastra;
102
+ logger: IMastraLogger;
103
+ }): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<any, Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector<VectorFilter>>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, NewAgentNetwork>, Record<string, MCPServerBase>>;
104
+ declare function checkEvalStorageFields(traceObject: any, logger?: IMastraLogger): boolean;
105
+ declare function isUiMessage(message: CoreMessage | Message): message is Message;
106
+ declare function isCoreMessage(message: CoreMessage | Message): message is CoreMessage;
107
+ /** Represents a validated SQL identifier (e.g., table or column name). */
108
+ type SqlIdentifier = string & {
109
+ __brand: 'SqlIdentifier';
110
+ };
111
+ /** Represents a validated dot-separated SQL field key. */
112
+ type FieldKey = string & {
113
+ __brand: 'FieldKey';
114
+ };
115
+ /**
116
+ * Parses and returns a valid SQL identifier (such as a table or column name).
117
+ * The identifier must:
118
+ * - Start with a letter (a-z, A-Z) or underscore (_)
119
+ * - Contain only letters, numbers, or underscores
120
+ * - Be at most 63 characters long
121
+ *
122
+ * @param name - The identifier string to parse.
123
+ * @param kind - Optional label for error messages (e.g., 'table name').
124
+ * @returns The validated identifier as a branded type.
125
+ * @throws {Error} If the identifier does not conform to SQL naming rules.
126
+ *
127
+ * @example
128
+ * const id = parseSqlIdentifier('my_table'); // Ok
129
+ * parseSqlIdentifier('123table'); // Throws error
130
+ */
131
+ declare function parseSqlIdentifier(name: string, kind?: string): SqlIdentifier;
132
+ /**
133
+ * Parses and returns a valid dot-separated SQL field key (e.g., 'user.profile.name').
134
+ * Each segment must:
135
+ * - Start with a letter (a-z, A-Z) or underscore (_)
136
+ * - Contain only letters, numbers, or underscores
137
+ * - Be at most 63 characters long
138
+ *
139
+ * @param key - The dot-separated field key string to parse.
140
+ * @returns The validated field key as a branded type.
141
+ * @throws {Error} If any segment of the key is invalid.
142
+ *
143
+ * @example
144
+ * const key = parseFieldKey('user_profile.name'); // Ok
145
+ * parseFieldKey('user..name'); // Throws error
146
+ * parseFieldKey('user.123name'); // Throws error
147
+ */
148
+ declare function parseFieldKey(key: string): FieldKey;
149
+
150
+ export { type TagMaskOptions, type ToolOptions, checkEvalStorageFields, createMastraProxy, deepMerge, delay, ensureToolProperties, generateEmptyFromSchema, isCoreMessage, isUiMessage, isZodType, makeCoreTool, maskStreamTags, parseFieldKey, parseSqlIdentifier, resolveSerializedZodOutput };
@@ -0,0 +1,150 @@
1
+ import { M as Mastra, a as MastraPrimitives, b as MastraMemory, T as ToolsInput, V as VercelTool, c as ToolAction, C as CoreTool, A as Agent, L as LegacyWorkflow, d as LegacyStep, S as StepExecutionContext, W as WorkflowContext, e as Workflow, f as Step, g as AgentNetwork, N as NewAgentNetwork, h as MCPServerBase } from './base-qVqAnB-c.js';
2
+ import { LanguageModelV1, CoreMessage, Message } from 'ai';
3
+ import { MastraTTS } from './tts/index.js';
4
+ import { MastraVector } from './vector/index.js';
5
+ import { VectorFilter } from './vector/filter/index.js';
6
+ import { M as Metric } from './types-Bo1uigWx.js';
7
+ import { z } from 'zod';
8
+ import { I as IMastraLogger } from './logger-Bpa2oLL4.js';
9
+ import './base-ClrXcCRx.js';
10
+ import { RuntimeContext } from './runtime-context/index.js';
11
+ import 'json-schema';
12
+ import 'sift';
13
+ import '@opentelemetry/api';
14
+ import 'xstate';
15
+ import 'node:events';
16
+ import 'node:http';
17
+ import 'hono';
18
+ import 'stream/web';
19
+ import 'events';
20
+ import 'node:stream/web';
21
+ import './workflows/constants.js';
22
+ import 'ai/test';
23
+ import './deployer/index.js';
24
+ import './bundler/index.js';
25
+ import 'hono/cors';
26
+ import 'hono-openapi';
27
+ import './error/index.js';
28
+ import 'stream';
29
+ import '@opentelemetry/sdk-trace-base';
30
+
31
+ declare const delay: (ms: number) => Promise<unknown>;
32
+ /**
33
+ * Deep merges two objects, recursively merging nested objects and arrays
34
+ */
35
+ declare function deepMerge<T extends object = object>(target: T, source: Partial<T>): T;
36
+ declare function generateEmptyFromSchema(schema: string): Record<string, any>;
37
+ interface TagMaskOptions {
38
+ /** Called when masking begins */
39
+ onStart?: () => void;
40
+ /** Called when masking ends */
41
+ onEnd?: () => void;
42
+ /** Called for each chunk that is masked */
43
+ onMask?: (chunk: string) => void;
44
+ }
45
+ /**
46
+ * Transforms a stream by masking content between XML tags.
47
+ * @param stream Input stream to transform
48
+ * @param tag Tag name to mask between (e.g. for <foo>...</foo>, use 'foo')
49
+ * @param options Optional configuration for masking behavior
50
+ */
51
+ declare function maskStreamTags(stream: AsyncIterable<string>, tag: string, options?: TagMaskOptions): AsyncIterable<string>;
52
+ /**
53
+ * Resolve serialized zod output - This function takes the string output ot the `jsonSchemaToZod` function
54
+ * and instantiates the zod object correctly.
55
+ *
56
+ * @param schema - serialized zod object
57
+ * @returns resolved zod object
58
+ */
59
+ declare function resolveSerializedZodOutput(schema: string): z.ZodType;
60
+ interface ToolOptions {
61
+ name: string;
62
+ runId?: string;
63
+ threadId?: string;
64
+ resourceId?: string;
65
+ logger?: IMastraLogger;
66
+ description?: string;
67
+ mastra?: (Mastra & MastraPrimitives) | MastraPrimitives;
68
+ runtimeContext: RuntimeContext;
69
+ memory?: MastraMemory;
70
+ agentName?: string;
71
+ model?: LanguageModelV1;
72
+ }
73
+ type ToolToConvert = VercelTool | ToolAction<any, any, any>;
74
+ /**
75
+ * Checks if a value is a Zod type
76
+ * @param value - The value to check
77
+ * @returns True if the value is a Zod type, false otherwise
78
+ */
79
+ declare function isZodType(value: unknown): value is z.ZodType;
80
+ /**
81
+ * Ensures a tool has an ID and inputSchema by generating one if not present
82
+ * @param tool - The tool to ensure has an ID and inputSchema
83
+ * @returns The tool with an ID and inputSchema
84
+ */
85
+ declare function ensureToolProperties(tools: ToolsInput): ToolsInput;
86
+ /**
87
+ * Converts a Vercel Tool or Mastra Tool into a CoreTool format
88
+ * @param originalTool - The tool to convert (either VercelTool or ToolAction)
89
+ * @param options - Tool options including Mastra-specific settings
90
+ * @param logType - Type of tool to log (tool or toolset)
91
+ * @returns A CoreTool that can be used by the system
92
+ */
93
+ declare function makeCoreTool(originalTool: ToolToConvert, options: ToolOptions, logType?: 'tool' | 'toolset' | 'client-tool'): CoreTool;
94
+ /**
95
+ * Creates a proxy for a Mastra instance to handle deprecated properties
96
+ * @param mastra - The Mastra instance to proxy
97
+ * @param logger - The logger to use for warnings
98
+ * @returns A proxy for the Mastra instance
99
+ */
100
+ declare function createMastraProxy({ mastra, logger }: {
101
+ mastra: Mastra;
102
+ logger: IMastraLogger;
103
+ }): Mastra<Record<string, Agent<any, ToolsInput, Record<string, Metric>>>, Record<string, LegacyWorkflow<LegacyStep<string, any, any, StepExecutionContext<any, WorkflowContext<any, LegacyStep<string, any, any, any>[], Record<string, any>>>>[], string, any, any>>, Record<string, Workflow<any, Step<string, any, any, any, any, any>[], string, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>, z.ZodType<any, z.ZodTypeDef, any>>>, Record<string, MastraVector<VectorFilter>>, Record<string, MastraTTS>, IMastraLogger, Record<string, AgentNetwork>, Record<string, NewAgentNetwork>, Record<string, MCPServerBase>>;
104
+ declare function checkEvalStorageFields(traceObject: any, logger?: IMastraLogger): boolean;
105
+ declare function isUiMessage(message: CoreMessage | Message): message is Message;
106
+ declare function isCoreMessage(message: CoreMessage | Message): message is CoreMessage;
107
+ /** Represents a validated SQL identifier (e.g., table or column name). */
108
+ type SqlIdentifier = string & {
109
+ __brand: 'SqlIdentifier';
110
+ };
111
+ /** Represents a validated dot-separated SQL field key. */
112
+ type FieldKey = string & {
113
+ __brand: 'FieldKey';
114
+ };
115
+ /**
116
+ * Parses and returns a valid SQL identifier (such as a table or column name).
117
+ * The identifier must:
118
+ * - Start with a letter (a-z, A-Z) or underscore (_)
119
+ * - Contain only letters, numbers, or underscores
120
+ * - Be at most 63 characters long
121
+ *
122
+ * @param name - The identifier string to parse.
123
+ * @param kind - Optional label for error messages (e.g., 'table name').
124
+ * @returns The validated identifier as a branded type.
125
+ * @throws {Error} If the identifier does not conform to SQL naming rules.
126
+ *
127
+ * @example
128
+ * const id = parseSqlIdentifier('my_table'); // Ok
129
+ * parseSqlIdentifier('123table'); // Throws error
130
+ */
131
+ declare function parseSqlIdentifier(name: string, kind?: string): SqlIdentifier;
132
+ /**
133
+ * Parses and returns a valid dot-separated SQL field key (e.g., 'user.profile.name').
134
+ * Each segment must:
135
+ * - Start with a letter (a-z, A-Z) or underscore (_)
136
+ * - Contain only letters, numbers, or underscores
137
+ * - Be at most 63 characters long
138
+ *
139
+ * @param key - The dot-separated field key string to parse.
140
+ * @returns The validated field key as a branded type.
141
+ * @throws {Error} If any segment of the key is invalid.
142
+ *
143
+ * @example
144
+ * const key = parseFieldKey('user_profile.name'); // Ok
145
+ * parseFieldKey('user..name'); // Throws error
146
+ * parseFieldKey('user.123name'); // Throws error
147
+ */
148
+ declare function parseFieldKey(key: string): FieldKey;
149
+
150
+ export { type TagMaskOptions, type ToolOptions, checkEvalStorageFields, createMastraProxy, deepMerge, delay, ensureToolProperties, generateEmptyFromSchema, isCoreMessage, isUiMessage, isZodType, makeCoreTool, maskStreamTags, parseFieldKey, parseSqlIdentifier, resolveSerializedZodOutput };
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ export { checkEvalStorageFields, createMastraProxy, deepMerge, delay, ensureToolProperties, generateEmptyFromSchema, isCoreMessage, isUiMessage, isZodType, makeCoreTool, maskStreamTags, parseFieldKey, parseSqlIdentifier, resolveSerializedZodOutput } from './chunk-IBKM5CLQ.js';