@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.
- package/README.md +76 -74
- package/dist/agent/index.cjs +2 -2
- package/dist/agent/index.d.cts +5 -3
- package/dist/agent/index.d.ts +5 -3
- package/dist/agent/index.js +1 -1
- package/dist/{base-Cmunaaxb.d.ts → base-BA_in99t.d.ts} +4 -1
- package/dist/{base-Cyl73WbV.d.ts → base-CQuRWXAH.d.ts} +985 -913
- package/dist/{base-ObPJ-w8K.d.cts → base-CvQbEqGB.d.cts} +4 -1
- package/dist/{base-C0wILuA9.d.cts → base-Dpt4tO56.d.cts} +985 -913
- package/dist/base.cjs +2 -2
- package/dist/base.d.cts +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/bundler/index.cjs +2 -2
- package/dist/bundler/index.d.cts +1 -1
- package/dist/bundler/index.d.ts +1 -1
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-L7CR75HA.js → chunk-2BVZNKLX.js} +1 -1
- package/dist/{chunk-V5ORZPFW.cjs → chunk-3C6V2FEP.cjs} +1 -1
- package/dist/chunk-3HE5CJBG.cjs +4604 -0
- package/dist/{chunk-PNZK456O.js → chunk-4RMSGSQN.js} +4 -4
- package/dist/{chunk-WESJ2ZY7.cjs → chunk-57LXIDIK.cjs} +2 -2
- package/dist/chunk-5RRJEWMA.cjs +107 -0
- package/dist/{chunk-3CNO7YB5.js → chunk-5TFGORLG.js} +1 -1
- package/dist/{chunk-5FAJ6HUC.cjs → chunk-64VPB7ZD.cjs} +23 -2
- package/dist/chunk-6XLV4KSD.js +100 -0
- package/dist/{chunk-XLSROQ26.cjs → chunk-7I7AKQH3.cjs} +5 -5
- package/dist/{chunk-RUA6BSB6.cjs → chunk-7JBINHJX.cjs} +2 -2
- package/dist/chunk-A6MBM56X.js +268 -0
- package/dist/{chunk-2YF5JYTJ.js → chunk-BC5B4EGI.js} +21 -2
- package/dist/chunk-BF7ZLRGO.cjs +271 -0
- package/dist/{chunk-SMBKF6K5.js → chunk-BRBHQ6KS.js} +10 -1
- package/dist/{chunk-VN4M67DA.js → chunk-CLJQYXNM.js} +1 -1
- package/dist/{chunk-PL7PVTGF.cjs → chunk-D63P5O4Q.cjs} +4 -4
- package/dist/chunk-DCGLGWHI.cjs +141 -0
- package/dist/{chunk-YXJQFZOW.cjs → chunk-DL4QPJKI.cjs} +24 -10
- package/dist/{chunk-ZABXT2MN.js → chunk-FY57LEMC.js} +1 -1
- package/dist/{chunk-XLXJUYKH.js → chunk-GHK3HBWN.js} +1 -1
- package/dist/{chunk-ONDCHP6G.cjs → chunk-GO2D7FEK.cjs} +2 -2
- package/dist/{chunk-7VTZI3YN.js → chunk-H6ZU5N2C.js} +1 -1
- package/dist/{chunk-WBE5RTFI.js → chunk-HAWAUEWK.js} +2 -2
- package/dist/chunk-HCDXBSMK.js +4577 -0
- package/dist/{chunk-RU7CSPAV.js → chunk-JGJMVCJ4.js} +7 -84
- package/dist/{chunk-W5HVJX45.js → chunk-N5ZYOQBL.js} +46 -5
- package/dist/{chunk-NPOKIPWC.cjs → chunk-O7IW545H.cjs} +1 -1
- package/dist/{chunk-XB2TJ7LX.cjs → chunk-PHWEC4VD.cjs} +47 -6
- package/dist/{chunk-NUDAZEOG.js → chunk-PK5QRKSG.js} +1 -1
- package/dist/{chunk-43SD5CUE.js → chunk-QDHRRKQ5.js} +63 -9
- package/dist/{chunk-ZBKJDQPM.js → chunk-RBWBJC6D.js} +17 -3
- package/dist/{chunk-4PYORXWM.cjs → chunk-RXDLSCBA.cjs} +4 -4
- package/dist/{chunk-IQLRSKED.cjs → chunk-RZCYBC7D.cjs} +2 -2
- package/dist/{chunk-ASFUEC75.cjs → chunk-TNNHN4ZY.cjs} +67 -12
- package/dist/{chunk-QM6WIIPM.js → chunk-UF4LZV3D.js} +1 -1
- package/dist/{chunk-JJ4YQTFT.cjs → chunk-WAW7QBY4.cjs} +2 -2
- package/dist/{chunk-U7ONOIBO.cjs → chunk-YZDUZFVZ.cjs} +11 -2
- package/dist/deployer/index.cjs +2 -2
- package/dist/deployer/index.d.cts +1 -1
- package/dist/deployer/index.d.ts +1 -1
- package/dist/deployer/index.js +1 -1
- package/dist/eval/index.cjs +3 -3
- package/dist/eval/index.d.cts +8 -5
- package/dist/eval/index.d.ts +8 -5
- package/dist/eval/index.js +1 -1
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/index.cjs +102 -92
- package/dist/index.d.cts +11 -9
- package/dist/index.d.ts +11 -9
- package/dist/index.js +18 -19
- package/dist/integration/index.cjs +3 -3
- package/dist/integration/index.d.cts +5 -3
- package/dist/integration/index.d.ts +5 -3
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.d.cts +5 -3
- package/dist/llm/index.d.ts +5 -3
- package/dist/logger/index.cjs +9 -9
- package/dist/logger/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.cts +5 -3
- package/dist/mastra/index.d.ts +5 -3
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +6 -2
- package/dist/memory/index.d.cts +5 -3
- package/dist/memory/index.d.ts +5 -3
- package/dist/memory/index.js +1 -1
- package/dist/network/index.cjs +8 -8
- package/dist/network/index.d.cts +5 -3
- package/dist/network/index.d.ts +5 -3
- package/dist/network/index.js +4 -4
- package/dist/relevance/index.cjs +4 -4
- package/dist/relevance/index.d.cts +10 -8
- package/dist/relevance/index.d.ts +10 -8
- package/dist/relevance/index.js +1 -1
- package/dist/server/index.cjs +17 -0
- package/dist/server/index.d.cts +37 -0
- package/dist/server/index.d.ts +37 -0
- package/dist/server/index.js +15 -0
- package/dist/storage/index.cjs +12 -8
- package/dist/storage/index.d.cts +5 -3
- package/dist/storage/index.d.ts +5 -3
- package/dist/storage/index.js +2 -2
- package/dist/storage/libsql/index.cjs +24 -24
- package/dist/storage/libsql/index.d.cts +5 -3
- package/dist/storage/libsql/index.d.ts +5 -3
- package/dist/storage/libsql/index.js +12 -12
- package/dist/telemetry/index.cjs +6 -6
- package/dist/telemetry/index.d.cts +5 -3
- package/dist/telemetry/index.d.ts +5 -3
- package/dist/telemetry/index.js +1 -1
- package/dist/tools/index.cjs +7 -3
- package/dist/tools/index.d.cts +6 -3
- package/dist/tools/index.d.ts +6 -3
- package/dist/tools/index.js +1 -1
- package/dist/tts/index.cjs +2 -2
- package/dist/tts/index.d.cts +1 -1
- package/dist/tts/index.d.ts +1 -1
- package/dist/tts/index.js +1 -1
- package/dist/{types-CwTG2XyQ.d.cts → types-BtMyV38I.d.cts} +4 -1
- package/dist/{types-CwTG2XyQ.d.ts → types-BtMyV38I.d.ts} +4 -1
- package/dist/utils.cjs +13 -13
- package/dist/utils.d.cts +7 -5
- package/dist/utils.d.ts +7 -5
- package/dist/utils.js +1 -1
- package/dist/vector/index.cjs +2 -2
- package/dist/vector/index.d.cts +1 -1
- package/dist/vector/index.d.ts +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/vector/libsql/index.cjs +3 -3
- package/dist/vector/libsql/index.d.cts +1 -1
- package/dist/vector/libsql/index.d.ts +1 -1
- package/dist/vector/libsql/index.js +1 -1
- package/dist/voice/index.cjs +13 -249
- package/dist/voice/index.d.cts +22 -8
- package/dist/voice/index.d.ts +22 -8
- package/dist/voice/index.js +1 -252
- package/dist/workflows/index.cjs +28 -20
- package/dist/workflows/index.d.cts +18 -7
- package/dist/workflows/index.d.ts +18 -7
- package/dist/workflows/index.js +1 -1
- package/package.json +5 -3
- package/dist/chunk-2W2GYEYQ.cjs +0 -25
- package/dist/chunk-C6BBAS4I.cjs +0 -1715
- package/dist/chunk-F5UYWPV4.cjs +0 -14
- package/dist/chunk-GG6TEAMJ.cjs +0 -2289
- package/dist/chunk-R2M5CZ5U.js +0 -2264
- package/dist/chunk-RG66XEJT.js +0 -8
- package/dist/chunk-VNQRLYIA.js +0 -1715
- package/dist/chunk-WVVKLIUW.cjs +0 -218
- package/dist/chunk-ZINPRHAN.js +0 -22
package/dist/chunk-WVVKLIUW.cjs
DELETED
|
@@ -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;
|
package/dist/chunk-ZINPRHAN.js
DELETED
|
@@ -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 };
|