@mastra/core 0.7.0 → 0.8.0-alpha.2

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 (149) hide show
  1. package/README.md +76 -74
  2. package/dist/agent/index.cjs +2 -2
  3. package/dist/agent/index.d.cts +5 -3
  4. package/dist/agent/index.d.ts +5 -3
  5. package/dist/agent/index.js +1 -1
  6. package/dist/{base-Cmunaaxb.d.ts → base-BA_in99t.d.ts} +4 -1
  7. package/dist/{base-Cyl73WbV.d.ts → base-CQuRWXAH.d.ts} +985 -913
  8. package/dist/{base-ObPJ-w8K.d.cts → base-CvQbEqGB.d.cts} +4 -1
  9. package/dist/{base-C0wILuA9.d.cts → base-Dpt4tO56.d.cts} +985 -913
  10. package/dist/base.cjs +2 -2
  11. package/dist/base.d.cts +1 -1
  12. package/dist/base.d.ts +1 -1
  13. package/dist/base.js +1 -1
  14. package/dist/bundler/index.cjs +2 -2
  15. package/dist/bundler/index.d.cts +1 -1
  16. package/dist/bundler/index.d.ts +1 -1
  17. package/dist/bundler/index.js +1 -1
  18. package/dist/{chunk-L7CR75HA.js → chunk-2BVZNKLX.js} +1 -1
  19. package/dist/{chunk-V5ORZPFW.cjs → chunk-3C6V2FEP.cjs} +1 -1
  20. package/dist/chunk-3HE5CJBG.cjs +4604 -0
  21. package/dist/{chunk-PNZK456O.js → chunk-4RMSGSQN.js} +4 -4
  22. package/dist/{chunk-WESJ2ZY7.cjs → chunk-57LXIDIK.cjs} +2 -2
  23. package/dist/chunk-5RRJEWMA.cjs +107 -0
  24. package/dist/{chunk-3CNO7YB5.js → chunk-5TFGORLG.js} +1 -1
  25. package/dist/{chunk-5FAJ6HUC.cjs → chunk-64VPB7ZD.cjs} +23 -2
  26. package/dist/chunk-6XLV4KSD.js +100 -0
  27. package/dist/{chunk-XLSROQ26.cjs → chunk-7I7AKQH3.cjs} +5 -5
  28. package/dist/{chunk-RUA6BSB6.cjs → chunk-7JBINHJX.cjs} +2 -2
  29. package/dist/chunk-A6MBM56X.js +268 -0
  30. package/dist/{chunk-2YF5JYTJ.js → chunk-BC5B4EGI.js} +21 -2
  31. package/dist/chunk-BF7ZLRGO.cjs +271 -0
  32. package/dist/{chunk-SMBKF6K5.js → chunk-BRBHQ6KS.js} +10 -1
  33. package/dist/{chunk-VN4M67DA.js → chunk-CLJQYXNM.js} +1 -1
  34. package/dist/{chunk-PL7PVTGF.cjs → chunk-D63P5O4Q.cjs} +4 -4
  35. package/dist/chunk-DCGLGWHI.cjs +141 -0
  36. package/dist/{chunk-YXJQFZOW.cjs → chunk-DL4QPJKI.cjs} +24 -10
  37. package/dist/{chunk-ZABXT2MN.js → chunk-FY57LEMC.js} +1 -1
  38. package/dist/{chunk-XLXJUYKH.js → chunk-GHK3HBWN.js} +1 -1
  39. package/dist/{chunk-ONDCHP6G.cjs → chunk-GO2D7FEK.cjs} +2 -2
  40. package/dist/{chunk-7VTZI3YN.js → chunk-H6ZU5N2C.js} +1 -1
  41. package/dist/{chunk-WBE5RTFI.js → chunk-HAWAUEWK.js} +2 -2
  42. package/dist/chunk-HCDXBSMK.js +4577 -0
  43. package/dist/{chunk-RU7CSPAV.js → chunk-JGJMVCJ4.js} +7 -84
  44. package/dist/{chunk-W5HVJX45.js → chunk-N5ZYOQBL.js} +46 -5
  45. package/dist/{chunk-NPOKIPWC.cjs → chunk-O7IW545H.cjs} +1 -1
  46. package/dist/{chunk-XB2TJ7LX.cjs → chunk-PHWEC4VD.cjs} +47 -6
  47. package/dist/{chunk-NUDAZEOG.js → chunk-PK5QRKSG.js} +1 -1
  48. package/dist/{chunk-43SD5CUE.js → chunk-QDHRRKQ5.js} +63 -9
  49. package/dist/{chunk-ZBKJDQPM.js → chunk-RBWBJC6D.js} +17 -3
  50. package/dist/{chunk-4PYORXWM.cjs → chunk-RXDLSCBA.cjs} +4 -4
  51. package/dist/{chunk-IQLRSKED.cjs → chunk-RZCYBC7D.cjs} +2 -2
  52. package/dist/{chunk-ASFUEC75.cjs → chunk-TNNHN4ZY.cjs} +67 -12
  53. package/dist/{chunk-QM6WIIPM.js → chunk-UF4LZV3D.js} +1 -1
  54. package/dist/{chunk-JJ4YQTFT.cjs → chunk-WAW7QBY4.cjs} +2 -2
  55. package/dist/{chunk-U7ONOIBO.cjs → chunk-YZDUZFVZ.cjs} +11 -2
  56. package/dist/deployer/index.cjs +2 -2
  57. package/dist/deployer/index.d.cts +1 -1
  58. package/dist/deployer/index.d.ts +1 -1
  59. package/dist/deployer/index.js +1 -1
  60. package/dist/eval/index.cjs +3 -3
  61. package/dist/eval/index.d.cts +8 -5
  62. package/dist/eval/index.d.ts +8 -5
  63. package/dist/eval/index.js +1 -1
  64. package/dist/hooks/index.d.cts +1 -1
  65. package/dist/hooks/index.d.ts +1 -1
  66. package/dist/index.cjs +102 -92
  67. package/dist/index.d.cts +11 -9
  68. package/dist/index.d.ts +11 -9
  69. package/dist/index.js +18 -19
  70. package/dist/integration/index.cjs +3 -3
  71. package/dist/integration/index.d.cts +5 -3
  72. package/dist/integration/index.d.ts +5 -3
  73. package/dist/integration/index.js +1 -1
  74. package/dist/llm/index.d.cts +5 -3
  75. package/dist/llm/index.d.ts +5 -3
  76. package/dist/logger/index.cjs +9 -9
  77. package/dist/logger/index.js +1 -1
  78. package/dist/mastra/index.cjs +2 -2
  79. package/dist/mastra/index.d.cts +5 -3
  80. package/dist/mastra/index.d.ts +5 -3
  81. package/dist/mastra/index.js +1 -1
  82. package/dist/memory/index.cjs +6 -2
  83. package/dist/memory/index.d.cts +5 -3
  84. package/dist/memory/index.d.ts +5 -3
  85. package/dist/memory/index.js +1 -1
  86. package/dist/network/index.cjs +8 -8
  87. package/dist/network/index.d.cts +5 -3
  88. package/dist/network/index.d.ts +5 -3
  89. package/dist/network/index.js +4 -4
  90. package/dist/relevance/index.cjs +4 -4
  91. package/dist/relevance/index.d.cts +10 -8
  92. package/dist/relevance/index.d.ts +10 -8
  93. package/dist/relevance/index.js +1 -1
  94. package/dist/server/index.cjs +17 -0
  95. package/dist/server/index.d.cts +37 -0
  96. package/dist/server/index.d.ts +37 -0
  97. package/dist/server/index.js +15 -0
  98. package/dist/storage/index.cjs +12 -8
  99. package/dist/storage/index.d.cts +5 -3
  100. package/dist/storage/index.d.ts +5 -3
  101. package/dist/storage/index.js +2 -2
  102. package/dist/storage/libsql/index.cjs +24 -24
  103. package/dist/storage/libsql/index.d.cts +5 -3
  104. package/dist/storage/libsql/index.d.ts +5 -3
  105. package/dist/storage/libsql/index.js +12 -12
  106. package/dist/telemetry/index.cjs +6 -6
  107. package/dist/telemetry/index.d.cts +5 -3
  108. package/dist/telemetry/index.d.ts +5 -3
  109. package/dist/telemetry/index.js +1 -1
  110. package/dist/tools/index.cjs +7 -3
  111. package/dist/tools/index.d.cts +6 -3
  112. package/dist/tools/index.d.ts +6 -3
  113. package/dist/tools/index.js +1 -1
  114. package/dist/tts/index.cjs +2 -2
  115. package/dist/tts/index.d.cts +1 -1
  116. package/dist/tts/index.d.ts +1 -1
  117. package/dist/tts/index.js +1 -1
  118. package/dist/{types-CwTG2XyQ.d.cts → types-BtMyV38I.d.cts} +4 -1
  119. package/dist/{types-CwTG2XyQ.d.ts → types-BtMyV38I.d.ts} +4 -1
  120. package/dist/utils.cjs +13 -13
  121. package/dist/utils.d.cts +7 -5
  122. package/dist/utils.d.ts +7 -5
  123. package/dist/utils.js +1 -1
  124. package/dist/vector/index.cjs +2 -2
  125. package/dist/vector/index.d.cts +1 -1
  126. package/dist/vector/index.d.ts +1 -1
  127. package/dist/vector/index.js +1 -1
  128. package/dist/vector/libsql/index.cjs +3 -3
  129. package/dist/vector/libsql/index.d.cts +1 -1
  130. package/dist/vector/libsql/index.d.ts +1 -1
  131. package/dist/vector/libsql/index.js +1 -1
  132. package/dist/voice/index.cjs +13 -249
  133. package/dist/voice/index.d.cts +22 -8
  134. package/dist/voice/index.d.ts +22 -8
  135. package/dist/voice/index.js +1 -252
  136. package/dist/workflows/index.cjs +28 -20
  137. package/dist/workflows/index.d.cts +18 -7
  138. package/dist/workflows/index.d.ts +18 -7
  139. package/dist/workflows/index.js +1 -1
  140. package/package.json +5 -3
  141. package/dist/chunk-2W2GYEYQ.cjs +0 -25
  142. package/dist/chunk-C6BBAS4I.cjs +0 -1715
  143. package/dist/chunk-F5UYWPV4.cjs +0 -14
  144. package/dist/chunk-GG6TEAMJ.cjs +0 -2289
  145. package/dist/chunk-R2M5CZ5U.js +0 -2264
  146. package/dist/chunk-RG66XEJT.js +0 -8
  147. package/dist/chunk-VNQRLYIA.js +0 -1715
  148. package/dist/chunk-WVVKLIUW.cjs +0 -218
  149. package/dist/chunk-ZINPRHAN.js +0 -22
@@ -1,218 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkF5UYWPV4_cjs = require('./chunk-F5UYWPV4.cjs');
4
- var chunkPL7PVTGF_cjs = require('./chunk-PL7PVTGF.cjs');
5
-
6
- // src/storage/base.ts
7
- var MastraStorage = class extends chunkPL7PVTGF_cjs.MastraBase {
8
- /** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */
9
- static TABLE_WORKFLOW_SNAPSHOT = chunkF5UYWPV4_cjs.TABLE_WORKFLOW_SNAPSHOT;
10
- /** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */
11
- static TABLE_EVALS = chunkF5UYWPV4_cjs.TABLE_EVALS;
12
- /** @deprecated import from { TABLE_MESSAGES } '@mastra/core/storage' instead */
13
- static TABLE_MESSAGES = chunkF5UYWPV4_cjs.TABLE_MESSAGES;
14
- /** @deprecated import from { TABLE_THREADS } '@mastra/core/storage' instead */
15
- static TABLE_THREADS = chunkF5UYWPV4_cjs.TABLE_THREADS;
16
- /** @deprecated import { TABLE_TRACES } from '@mastra/core/storage' instead */
17
- static TABLE_TRACES = chunkF5UYWPV4_cjs.TABLE_TRACES;
18
- hasInitialized = null;
19
- shouldCacheInit = true;
20
- constructor({ name }) {
21
- super({
22
- component: "STORAGE",
23
- name
24
- });
25
- }
26
- async __batchInsert({
27
- tableName,
28
- records
29
- }) {
30
- await this.init();
31
- return this.batchInsert({ tableName, records });
32
- }
33
- async __getThreadById({ threadId }) {
34
- await this.init();
35
- return this.getThreadById({ threadId });
36
- }
37
- async __getThreadsByResourceId({ resourceId }) {
38
- await this.init();
39
- return this.getThreadsByResourceId({ resourceId });
40
- }
41
- async __saveThread({ thread }) {
42
- await this.init();
43
- return this.saveThread({ thread });
44
- }
45
- async __updateThread({
46
- id,
47
- title,
48
- metadata
49
- }) {
50
- await this.init();
51
- return this.updateThread({ id, title, metadata });
52
- }
53
- async __deleteThread({ threadId }) {
54
- await this.init();
55
- return this.deleteThread({ threadId });
56
- }
57
- async __getMessages({ threadId, selectBy, threadConfig }) {
58
- await this.init();
59
- return this.getMessages({ threadId, selectBy, threadConfig });
60
- }
61
- async __saveMessages({ messages }) {
62
- await this.init();
63
- return this.saveMessages({ messages });
64
- }
65
- async __getTraces({
66
- scope,
67
- page,
68
- perPage,
69
- attributes
70
- }) {
71
- await this.init();
72
- return this.getTraces({ scope, page, perPage, attributes });
73
- }
74
- async init() {
75
- if (this.shouldCacheInit && await this.hasInitialized) {
76
- return;
77
- }
78
- this.hasInitialized = Promise.all([
79
- this.createTable({
80
- tableName: chunkF5UYWPV4_cjs.TABLE_WORKFLOW_SNAPSHOT,
81
- schema: {
82
- workflow_name: {
83
- type: "text"
84
- },
85
- run_id: {
86
- type: "text"
87
- },
88
- snapshot: {
89
- type: "text"
90
- },
91
- createdAt: {
92
- type: "timestamp"
93
- },
94
- updatedAt: {
95
- type: "timestamp"
96
- }
97
- }
98
- }),
99
- this.createTable({
100
- tableName: chunkF5UYWPV4_cjs.TABLE_EVALS,
101
- schema: {
102
- input: {
103
- type: "text"
104
- },
105
- output: {
106
- type: "text"
107
- },
108
- result: {
109
- type: "jsonb"
110
- },
111
- agent_name: {
112
- type: "text"
113
- },
114
- metric_name: {
115
- type: "text"
116
- },
117
- instructions: {
118
- type: "text"
119
- },
120
- test_info: {
121
- type: "jsonb",
122
- nullable: true
123
- },
124
- global_run_id: {
125
- type: "text"
126
- },
127
- run_id: {
128
- type: "text"
129
- },
130
- created_at: {
131
- type: "timestamp"
132
- }
133
- }
134
- }),
135
- this.createTable({
136
- tableName: chunkF5UYWPV4_cjs.TABLE_THREADS,
137
- schema: {
138
- id: { type: "text", nullable: false, primaryKey: true },
139
- resourceId: { type: "text", nullable: false },
140
- title: { type: "text", nullable: false },
141
- metadata: { type: "text", nullable: true },
142
- createdAt: { type: "timestamp", nullable: false },
143
- updatedAt: { type: "timestamp", nullable: false }
144
- }
145
- }),
146
- this.createTable({
147
- tableName: chunkF5UYWPV4_cjs.TABLE_MESSAGES,
148
- schema: {
149
- id: { type: "text", nullable: false, primaryKey: true },
150
- thread_id: { type: "text", nullable: false },
151
- content: { type: "text", nullable: false },
152
- role: { type: "text", nullable: false },
153
- type: { type: "text", nullable: false },
154
- createdAt: { type: "timestamp", nullable: false }
155
- }
156
- }),
157
- this.createTable({
158
- tableName: chunkF5UYWPV4_cjs.TABLE_TRACES,
159
- schema: {
160
- id: { type: "text", nullable: false, primaryKey: true },
161
- parentSpanId: { type: "text", nullable: true },
162
- name: { type: "text", nullable: false },
163
- traceId: { type: "text", nullable: false },
164
- scope: { type: "text", nullable: false },
165
- kind: { type: "integer", nullable: false },
166
- attributes: { type: "jsonb", nullable: true },
167
- status: { type: "jsonb", nullable: true },
168
- events: { type: "jsonb", nullable: true },
169
- links: { type: "jsonb", nullable: true },
170
- other: { type: "text", nullable: true },
171
- startTime: { type: "bigint", nullable: false },
172
- endTime: { type: "bigint", nullable: false },
173
- createdAt: { type: "timestamp", nullable: false }
174
- }
175
- })
176
- ]).then(() => true);
177
- await this.hasInitialized;
178
- }
179
- async persistWorkflowSnapshot({
180
- workflowName,
181
- runId,
182
- snapshot
183
- }) {
184
- await this.init();
185
- const data = {
186
- workflow_name: workflowName,
187
- run_id: runId,
188
- snapshot,
189
- createdAt: /* @__PURE__ */ new Date(),
190
- updatedAt: /* @__PURE__ */ new Date()
191
- };
192
- this.logger.debug("Persisting workflow snapshot", { workflowName, runId, data });
193
- await this.insert({
194
- tableName: chunkF5UYWPV4_cjs.TABLE_WORKFLOW_SNAPSHOT,
195
- record: data
196
- });
197
- }
198
- async loadWorkflowSnapshot({
199
- workflowName,
200
- runId
201
- }) {
202
- if (!this.hasInitialized) {
203
- await this.init();
204
- }
205
- this.logger.debug("Loading workflow snapshot", { workflowName, runId });
206
- const d = await this.load({
207
- tableName: chunkF5UYWPV4_cjs.TABLE_WORKFLOW_SNAPSHOT,
208
- keys: { workflow_name: workflowName, run_id: runId }
209
- });
210
- return d ? d.snapshot : null;
211
- }
212
- async __getEvalsByAgentName(agentName, type) {
213
- await this.init();
214
- return this.getEvalsByAgentName(agentName, type);
215
- }
216
- };
217
-
218
- exports.MastraStorage = MastraStorage;
@@ -1,22 +0,0 @@
1
- // src/tools/tool.ts
2
- var Tool = class {
3
- id;
4
- description;
5
- inputSchema;
6
- outputSchema;
7
- execute;
8
- mastra;
9
- constructor(opts) {
10
- this.id = opts.id;
11
- this.description = opts.description;
12
- this.inputSchema = opts.inputSchema;
13
- this.outputSchema = opts.outputSchema;
14
- this.execute = opts.execute;
15
- this.mastra = opts.mastra;
16
- }
17
- };
18
- function createTool(opts) {
19
- return new Tool(opts);
20
- }
21
-
22
- export { Tool, createTool };