@mastra/core 0.5.0-alpha.9 → 0.5.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.
- package/dist/agent/index.cjs +3 -2140
- package/dist/agent/index.d.cts +1 -1
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/{base-CMEKtEnE.d.cts → base-CIPKleAU.d.cts} +97 -60
- package/dist/{base-B78F6w8S.d.ts → base-C_Oq53qk.d.ts} +97 -60
- package/dist/base.cjs +5 -140
- package/dist/bundler/index.cjs +5 -160
- package/dist/chunk-2W2GYEYQ.cjs +25 -0
- package/dist/chunk-3ASEZT7U.cjs +1586 -0
- package/dist/chunk-43Y7WG5W.cjs +335 -0
- package/dist/{chunk-IM7CM3DU.js → chunk-4Y74D74B.js} +1 -1
- package/dist/chunk-ENT7U27Y.cjs +37 -0
- package/dist/chunk-F5UYWPV4.cjs +14 -0
- package/dist/chunk-FL3GQXQ2.cjs +218 -0
- package/dist/chunk-FRQFWZDN.cjs +2 -0
- package/dist/chunk-GXQRMKSN.cjs +367 -0
- package/dist/chunk-HJPMYDWO.cjs +37 -0
- package/dist/chunk-IIWRJFLQ.cjs +51 -0
- package/dist/chunk-KFQ7Z3PO.cjs +347 -0
- package/dist/{chunk-TWAIC2XA.js → chunk-KP5UAFLN.js} +1 -1
- package/dist/chunk-KPKFLQFR.cjs +12 -0
- package/dist/{chunk-NR5T72G7.js → chunk-MLFXOST6.js} +1 -1
- package/dist/{chunk-6V737PR2.js → chunk-OD7ZMKHY.js} +166 -58
- package/dist/chunk-OTFLHXHZ.cjs +65 -0
- package/dist/chunk-RWTSGWWL.cjs +81 -0
- package/dist/chunk-ST5RMVLG.cjs +87 -0
- package/dist/chunk-SYQ7NK2E.cjs +24 -0
- package/dist/chunk-UZNQG7QO.cjs +1868 -0
- package/dist/chunk-V5ORZPFW.cjs +38 -0
- package/dist/chunk-VA4P7QJT.cjs +443 -0
- package/dist/chunk-WB2HREXE.cjs +166 -0
- package/dist/chunk-WOMOGDGR.cjs +691 -0
- package/dist/chunk-XB2TJ7LX.cjs +408 -0
- package/dist/{chunk-4AQBRUR2.js → chunk-XF2FMJYK.js} +1 -1
- package/dist/chunk-XLSROQ26.cjs +91 -0
- package/dist/chunk-YK3XJ52U.cjs +192 -0
- package/dist/{chunk-EWB556GS.js → chunk-YPD6BQIM.js} +29 -1
- package/dist/deployer/index.cjs +5 -167
- package/dist/eval/index.cjs +9 -105
- package/dist/eval/index.d.cts +1 -1
- package/dist/eval/index.d.ts +1 -1
- package/dist/hooks/index.cjs +14 -83
- package/dist/index.cjs +253 -7516
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/integration/index.cjs +9 -108
- package/dist/integration/index.d.cts +1 -1
- package/dist/integration/index.d.ts +1 -1
- package/dist/llm/index.d.cts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/logger/index.cjs +33 -161
- package/dist/mastra/index.cjs +3 -1755
- package/dist/mastra/index.d.cts +1 -1
- package/dist/mastra/index.d.ts +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.cjs +4 -2050
- package/dist/memory/index.d.cts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/relevance/index.cjs +10 -2201
- package/dist/relevance/index.d.cts +19 -2
- package/dist/relevance/index.d.ts +19 -2
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.cjs +29 -367
- package/dist/storage/index.d.cts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/libsql/index.cjs +9 -798
- package/dist/storage/libsql/index.d.cts +1 -1
- package/dist/storage/libsql/index.d.ts +1 -1
- package/dist/telemetry/index.cjs +21 -408
- package/dist/telemetry/index.d.cts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/tools/index.cjs +11 -22
- package/dist/tools/index.d.cts +3 -3
- package/dist/tools/index.d.ts +3 -3
- package/dist/tts/index.cjs +3 -328
- package/dist/utils.cjs +41 -350
- package/dist/utils.d.cts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +1 -1
- package/dist/vector/filter/index.cjs +7 -189
- package/dist/vector/index.cjs +5 -172
- package/dist/vector/libsql/index.cjs +9 -1047
- package/dist/voice/index.cjs +8 -306
- package/dist/workflows/index.cjs +65 -1936
- package/dist/workflows/index.d.cts +4 -3
- package/dist/workflows/index.d.ts +4 -3
- package/dist/workflows/index.js +1 -1
- package/package.json +27 -27
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../base-DboIg_Cd.cjs';
|
|
2
|
+
import { aw as MastraLanguageModel } from '../base-CIPKleAU.cjs';
|
|
3
|
+
import '@opentelemetry/api';
|
|
4
|
+
import '../index-mKY1XrpK.cjs';
|
|
5
|
+
import 'stream';
|
|
6
|
+
import 'pino';
|
|
7
|
+
import '@opentelemetry/sdk-trace-base';
|
|
8
|
+
import 'ai';
|
|
9
|
+
import 'sift';
|
|
10
|
+
import 'zod';
|
|
11
|
+
import 'json-schema';
|
|
12
|
+
import '../types-CwTG2XyQ.cjs';
|
|
13
|
+
import '../deployer/index.cjs';
|
|
14
|
+
import '../bundler/index.cjs';
|
|
15
|
+
import '../vector/index.cjs';
|
|
16
|
+
import '../vector/filter/index.cjs';
|
|
17
|
+
import '../tts/index.cjs';
|
|
18
|
+
import '../voice/index.cjs';
|
|
2
19
|
|
|
3
20
|
interface RelevanceScoreProvider {
|
|
4
21
|
getRelevanceScore(text1: string, text2: string): Promise<number>;
|
|
@@ -14,7 +31,7 @@ declare class CohereRelevanceScorer implements RelevanceScoreProvider {
|
|
|
14
31
|
|
|
15
32
|
declare class MastraAgentRelevanceScorer implements RelevanceScoreProvider {
|
|
16
33
|
private agent;
|
|
17
|
-
constructor(name: string, model:
|
|
34
|
+
constructor(name: string, model: MastraLanguageModel);
|
|
18
35
|
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
19
36
|
}
|
|
20
37
|
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../base-BZViaFTt.js';
|
|
2
|
+
import { aw as MastraLanguageModel } from '../base-C_Oq53qk.js';
|
|
3
|
+
import '@opentelemetry/api';
|
|
4
|
+
import '../index-mKY1XrpK.js';
|
|
5
|
+
import 'stream';
|
|
6
|
+
import 'pino';
|
|
7
|
+
import '@opentelemetry/sdk-trace-base';
|
|
8
|
+
import 'ai';
|
|
9
|
+
import 'sift';
|
|
10
|
+
import 'zod';
|
|
11
|
+
import 'json-schema';
|
|
12
|
+
import '../types-CwTG2XyQ.js';
|
|
13
|
+
import '../deployer/index.js';
|
|
14
|
+
import '../bundler/index.js';
|
|
15
|
+
import '../vector/index.js';
|
|
16
|
+
import '../vector/filter/index.js';
|
|
17
|
+
import '../tts/index.js';
|
|
18
|
+
import '../voice/index.js';
|
|
2
19
|
|
|
3
20
|
interface RelevanceScoreProvider {
|
|
4
21
|
getRelevanceScore(text1: string, text2: string): Promise<number>;
|
|
@@ -14,7 +31,7 @@ declare class CohereRelevanceScorer implements RelevanceScoreProvider {
|
|
|
14
31
|
|
|
15
32
|
declare class MastraAgentRelevanceScorer implements RelevanceScoreProvider {
|
|
16
33
|
private agent;
|
|
17
|
-
constructor(name: string, model:
|
|
34
|
+
constructor(name: string, model: MastraLanguageModel);
|
|
18
35
|
getRelevanceScore(query: string, text: string): Promise<number>;
|
|
19
36
|
}
|
|
20
37
|
|
package/dist/relevance/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-XF2FMJYK.js';
|
package/dist/storage/index.cjs
CHANGED
|
@@ -1,369 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
options.overrideDefaultTransports ? options?.transports?.default : transportsAry.length === 0 ? pretty__default.default({
|
|
36
|
-
colorize: true,
|
|
37
|
-
levelFirst: true,
|
|
38
|
-
ignore: "pid,hostname",
|
|
39
|
-
colorizeObjects: true,
|
|
40
|
-
translateTime: "SYS:standard",
|
|
41
|
-
singleLine: false
|
|
42
|
-
}) : pino__default.default.multistream([
|
|
43
|
-
...transportsAry.map(([_, transport]) => ({
|
|
44
|
-
stream: transport,
|
|
45
|
-
level: options.level || LogLevel.INFO
|
|
46
|
-
})),
|
|
47
|
-
{
|
|
48
|
-
stream: pretty__default.default({
|
|
49
|
-
colorize: true,
|
|
50
|
-
levelFirst: true,
|
|
51
|
-
ignore: "pid,hostname",
|
|
52
|
-
colorizeObjects: true,
|
|
53
|
-
translateTime: "SYS:standard",
|
|
54
|
-
singleLine: false
|
|
55
|
-
}),
|
|
56
|
-
level: options.level || LogLevel.INFO
|
|
57
|
-
}
|
|
58
|
-
])
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
debug(message, args = {}) {
|
|
62
|
-
this.logger.debug(args, message);
|
|
63
|
-
}
|
|
64
|
-
info(message, args = {}) {
|
|
65
|
-
this.logger.info(args, message);
|
|
66
|
-
}
|
|
67
|
-
warn(message, args = {}) {
|
|
68
|
-
this.logger.warn(args, message);
|
|
69
|
-
}
|
|
70
|
-
error(message, args = {}) {
|
|
71
|
-
this.logger.error(args, message);
|
|
72
|
-
}
|
|
73
|
-
// Stream creation for process output handling
|
|
74
|
-
createStream() {
|
|
75
|
-
return new stream.Transform({
|
|
76
|
-
transform: (chunk, _encoding, callback) => {
|
|
77
|
-
const line = chunk.toString().trim();
|
|
78
|
-
if (line) {
|
|
79
|
-
this.info(line);
|
|
80
|
-
}
|
|
81
|
-
callback(null, chunk);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
async getLogs(transportId) {
|
|
86
|
-
if (!transportId || !this.transports[transportId]) {
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
return this.transports[transportId].getLogs();
|
|
90
|
-
}
|
|
91
|
-
async getLogsByRunId({ runId, transportId }) {
|
|
92
|
-
return this.transports[transportId]?.getLogsByRunId({ runId });
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
function createLogger(options) {
|
|
96
|
-
return new Logger(options);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// src/base.ts
|
|
100
|
-
var MastraBase = class {
|
|
101
|
-
component = RegisteredLogger.LLM;
|
|
102
|
-
logger;
|
|
103
|
-
name;
|
|
104
|
-
telemetry;
|
|
105
|
-
constructor({ component, name }) {
|
|
106
|
-
this.component = component || RegisteredLogger.LLM;
|
|
107
|
-
this.name = name;
|
|
108
|
-
this.logger = createLogger({ name: `${this.component} - ${this.name}` });
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Set the logger for the agent
|
|
112
|
-
* @param logger
|
|
113
|
-
*/
|
|
114
|
-
__setLogger(logger) {
|
|
115
|
-
this.logger = logger;
|
|
116
|
-
this.logger.debug(`Logger updated [component=${this.component}] [name=${this.name}]`);
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Set the telemetry for the
|
|
120
|
-
* @param telemetry
|
|
121
|
-
*/
|
|
122
|
-
__setTelemetry(telemetry) {
|
|
123
|
-
this.telemetry = telemetry;
|
|
124
|
-
this.logger.debug(`Telemetry updated [component=${this.component}] [tracer=${this.telemetry.tracer}]`);
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Get the telemetry on the vector
|
|
128
|
-
* @returns telemetry
|
|
129
|
-
*/
|
|
130
|
-
__getTelemetry() {
|
|
131
|
-
return this.telemetry;
|
|
132
|
-
}
|
|
133
|
-
/*
|
|
134
|
-
get experimental_telemetry config
|
|
135
|
-
*/
|
|
136
|
-
get experimental_telemetry() {
|
|
137
|
-
return this.telemetry ? {
|
|
138
|
-
// tracer: this.telemetry.tracer,
|
|
139
|
-
tracer: this.telemetry.getBaggageTracer(),
|
|
140
|
-
isEnabled: !!this.telemetry.tracer
|
|
141
|
-
} : void 0;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// src/storage/constants.ts
|
|
146
|
-
var TABLE_WORKFLOW_SNAPSHOT = "mastra_workflow_snapshot";
|
|
147
|
-
var TABLE_EVALS = "mastra_evals";
|
|
148
|
-
var TABLE_MESSAGES = "mastra_messages";
|
|
149
|
-
var TABLE_THREADS = "mastra_threads";
|
|
150
|
-
var TABLE_TRACES = "mastra_traces";
|
|
151
|
-
|
|
152
|
-
// src/storage/base.ts
|
|
153
|
-
var MastraStorage = class extends MastraBase {
|
|
154
|
-
/** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */
|
|
155
|
-
static TABLE_WORKFLOW_SNAPSHOT = TABLE_WORKFLOW_SNAPSHOT;
|
|
156
|
-
/** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */
|
|
157
|
-
static TABLE_EVALS = TABLE_EVALS;
|
|
158
|
-
/** @deprecated import from { TABLE_MESSAGES } '@mastra/core/storage' instead */
|
|
159
|
-
static TABLE_MESSAGES = TABLE_MESSAGES;
|
|
160
|
-
/** @deprecated import from { TABLE_THREADS } '@mastra/core/storage' instead */
|
|
161
|
-
static TABLE_THREADS = TABLE_THREADS;
|
|
162
|
-
/** @deprecated import { TABLE_TRACES } from '@mastra/core/storage' instead */
|
|
163
|
-
static TABLE_TRACES = TABLE_TRACES;
|
|
164
|
-
hasInitialized = null;
|
|
165
|
-
shouldCacheInit = true;
|
|
166
|
-
constructor({ name }) {
|
|
167
|
-
super({
|
|
168
|
-
component: "STORAGE",
|
|
169
|
-
name
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
async __batchInsert({
|
|
173
|
-
tableName,
|
|
174
|
-
records
|
|
175
|
-
}) {
|
|
176
|
-
await this.init();
|
|
177
|
-
return this.batchInsert({ tableName, records });
|
|
178
|
-
}
|
|
179
|
-
async __getThreadById({ threadId }) {
|
|
180
|
-
await this.init();
|
|
181
|
-
return this.getThreadById({ threadId });
|
|
182
|
-
}
|
|
183
|
-
async __getThreadsByResourceId({ resourceId }) {
|
|
184
|
-
await this.init();
|
|
185
|
-
return this.getThreadsByResourceId({ resourceId });
|
|
186
|
-
}
|
|
187
|
-
async __saveThread({ thread }) {
|
|
188
|
-
await this.init();
|
|
189
|
-
return this.saveThread({ thread });
|
|
190
|
-
}
|
|
191
|
-
async __updateThread({
|
|
192
|
-
id,
|
|
193
|
-
title,
|
|
194
|
-
metadata
|
|
195
|
-
}) {
|
|
196
|
-
await this.init();
|
|
197
|
-
return this.updateThread({ id, title, metadata });
|
|
198
|
-
}
|
|
199
|
-
async __deleteThread({ threadId }) {
|
|
200
|
-
await this.init();
|
|
201
|
-
return this.deleteThread({ threadId });
|
|
202
|
-
}
|
|
203
|
-
async __getMessages({ threadId, selectBy, threadConfig }) {
|
|
204
|
-
await this.init();
|
|
205
|
-
return this.getMessages({ threadId, selectBy, threadConfig });
|
|
206
|
-
}
|
|
207
|
-
async __saveMessages({ messages }) {
|
|
208
|
-
await this.init();
|
|
209
|
-
return this.saveMessages({ messages });
|
|
210
|
-
}
|
|
211
|
-
async __getTraces({
|
|
212
|
-
scope,
|
|
213
|
-
page,
|
|
214
|
-
perPage,
|
|
215
|
-
attributes
|
|
216
|
-
}) {
|
|
217
|
-
await this.init();
|
|
218
|
-
return this.getTraces({ scope, page, perPage, attributes });
|
|
219
|
-
}
|
|
220
|
-
async init() {
|
|
221
|
-
if (this.shouldCacheInit && await this.hasInitialized) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
this.hasInitialized = Promise.all([
|
|
225
|
-
this.createTable({
|
|
226
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
227
|
-
schema: {
|
|
228
|
-
workflow_name: {
|
|
229
|
-
type: "text"
|
|
230
|
-
},
|
|
231
|
-
run_id: {
|
|
232
|
-
type: "text"
|
|
233
|
-
},
|
|
234
|
-
snapshot: {
|
|
235
|
-
type: "text"
|
|
236
|
-
},
|
|
237
|
-
createdAt: {
|
|
238
|
-
type: "timestamp"
|
|
239
|
-
},
|
|
240
|
-
updatedAt: {
|
|
241
|
-
type: "timestamp"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}),
|
|
245
|
-
this.createTable({
|
|
246
|
-
tableName: TABLE_EVALS,
|
|
247
|
-
schema: {
|
|
248
|
-
input: {
|
|
249
|
-
type: "text"
|
|
250
|
-
},
|
|
251
|
-
output: {
|
|
252
|
-
type: "text"
|
|
253
|
-
},
|
|
254
|
-
result: {
|
|
255
|
-
type: "jsonb"
|
|
256
|
-
},
|
|
257
|
-
agent_name: {
|
|
258
|
-
type: "text"
|
|
259
|
-
},
|
|
260
|
-
metric_name: {
|
|
261
|
-
type: "text"
|
|
262
|
-
},
|
|
263
|
-
instructions: {
|
|
264
|
-
type: "text"
|
|
265
|
-
},
|
|
266
|
-
test_info: {
|
|
267
|
-
type: "jsonb",
|
|
268
|
-
nullable: true
|
|
269
|
-
},
|
|
270
|
-
global_run_id: {
|
|
271
|
-
type: "text"
|
|
272
|
-
},
|
|
273
|
-
run_id: {
|
|
274
|
-
type: "text"
|
|
275
|
-
},
|
|
276
|
-
created_at: {
|
|
277
|
-
type: "timestamp"
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}),
|
|
281
|
-
this.createTable({
|
|
282
|
-
tableName: TABLE_THREADS,
|
|
283
|
-
schema: {
|
|
284
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
285
|
-
resourceId: { type: "text", nullable: false },
|
|
286
|
-
title: { type: "text", nullable: false },
|
|
287
|
-
metadata: { type: "text", nullable: true },
|
|
288
|
-
createdAt: { type: "timestamp", nullable: false },
|
|
289
|
-
updatedAt: { type: "timestamp", nullable: false }
|
|
290
|
-
}
|
|
291
|
-
}),
|
|
292
|
-
this.createTable({
|
|
293
|
-
tableName: TABLE_MESSAGES,
|
|
294
|
-
schema: {
|
|
295
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
296
|
-
thread_id: { type: "text", nullable: false },
|
|
297
|
-
content: { type: "text", nullable: false },
|
|
298
|
-
role: { type: "text", nullable: false },
|
|
299
|
-
type: { type: "text", nullable: false },
|
|
300
|
-
createdAt: { type: "timestamp", nullable: false }
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
this.createTable({
|
|
304
|
-
tableName: TABLE_TRACES,
|
|
305
|
-
schema: {
|
|
306
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
307
|
-
parentSpanId: { type: "text", nullable: true },
|
|
308
|
-
name: { type: "text", nullable: false },
|
|
309
|
-
traceId: { type: "text", nullable: false },
|
|
310
|
-
scope: { type: "text", nullable: false },
|
|
311
|
-
kind: { type: "integer", nullable: false },
|
|
312
|
-
attributes: { type: "jsonb", nullable: true },
|
|
313
|
-
status: { type: "jsonb", nullable: true },
|
|
314
|
-
events: { type: "jsonb", nullable: true },
|
|
315
|
-
links: { type: "jsonb", nullable: true },
|
|
316
|
-
other: { type: "text", nullable: true },
|
|
317
|
-
startTime: { type: "bigint", nullable: false },
|
|
318
|
-
endTime: { type: "bigint", nullable: false },
|
|
319
|
-
createdAt: { type: "timestamp", nullable: false }
|
|
320
|
-
}
|
|
321
|
-
})
|
|
322
|
-
]).then(() => true);
|
|
323
|
-
await this.hasInitialized;
|
|
324
|
-
}
|
|
325
|
-
async persistWorkflowSnapshot({
|
|
326
|
-
workflowName,
|
|
327
|
-
runId,
|
|
328
|
-
snapshot
|
|
329
|
-
}) {
|
|
330
|
-
await this.init();
|
|
331
|
-
const data = {
|
|
332
|
-
workflow_name: workflowName,
|
|
333
|
-
run_id: runId,
|
|
334
|
-
snapshot,
|
|
335
|
-
createdAt: /* @__PURE__ */ new Date(),
|
|
336
|
-
updatedAt: /* @__PURE__ */ new Date()
|
|
337
|
-
};
|
|
338
|
-
this.logger.debug("Persisting workflow snapshot", { workflowName, runId, data });
|
|
339
|
-
await this.insert({
|
|
340
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
341
|
-
record: data
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
async loadWorkflowSnapshot({
|
|
345
|
-
workflowName,
|
|
346
|
-
runId
|
|
347
|
-
}) {
|
|
348
|
-
if (!this.hasInitialized) {
|
|
349
|
-
await this.init();
|
|
350
|
-
}
|
|
351
|
-
this.logger.debug("Loading workflow snapshot", { workflowName, runId });
|
|
352
|
-
const d = await this.load({
|
|
353
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
354
|
-
keys: { workflow_name: workflowName, run_id: runId }
|
|
355
|
-
});
|
|
356
|
-
return d ? d.snapshot : null;
|
|
357
|
-
}
|
|
358
|
-
async __getEvalsByAgentName(agentName, type) {
|
|
359
|
-
await this.init();
|
|
360
|
-
return this.getEvalsByAgentName(agentName, type);
|
|
361
|
-
}
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
exports.MastraStorage = MastraStorage;
|
|
365
|
-
exports.TABLE_EVALS = TABLE_EVALS;
|
|
366
|
-
exports.TABLE_MESSAGES = TABLE_MESSAGES;
|
|
367
|
-
exports.TABLE_THREADS = TABLE_THREADS;
|
|
368
|
-
exports.TABLE_TRACES = TABLE_TRACES;
|
|
369
|
-
exports.TABLE_WORKFLOW_SNAPSHOT = TABLE_WORKFLOW_SNAPSHOT;
|
|
3
|
+
var chunkFL3GQXQ2_cjs = require('../chunk-FL3GQXQ2.cjs');
|
|
4
|
+
var chunkF5UYWPV4_cjs = require('../chunk-F5UYWPV4.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, "MastraStorage", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return chunkFL3GQXQ2_cjs.MastraStorage; }
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "TABLE_EVALS", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return chunkF5UYWPV4_cjs.TABLE_EVALS; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "TABLE_MESSAGES", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return chunkF5UYWPV4_cjs.TABLE_MESSAGES; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "TABLE_THREADS", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return chunkF5UYWPV4_cjs.TABLE_THREADS; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "TABLE_TRACES", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return chunkF5UYWPV4_cjs.TABLE_TRACES; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return chunkF5UYWPV4_cjs.TABLE_WORKFLOW_SNAPSHOT; }
|
|
31
|
+
});
|
package/dist/storage/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EvalRow,
|
|
1
|
+
export { E as EvalRow, f as MastraStorage, h as StorageColumn, k as StorageGetMessagesArg, aB as TABLE_EVALS, aC as TABLE_MESSAGES, g as TABLE_NAMES, aD as TABLE_THREADS, aE as TABLE_TRACES, aA as TABLE_WORKFLOW_SNAPSHOT, o as WorkflowRow } from '../base-CIPKleAU.cjs';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-DboIg_Cd.cjs';
|
|
4
4
|
import '@opentelemetry/api';
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { E as EvalRow,
|
|
1
|
+
export { E as EvalRow, f as MastraStorage, h as StorageColumn, k as StorageGetMessagesArg, aB as TABLE_EVALS, aC as TABLE_MESSAGES, g as TABLE_NAMES, aD as TABLE_THREADS, aE as TABLE_TRACES, aA as TABLE_WORKFLOW_SNAPSHOT, o as WorkflowRow } from '../base-C_Oq53qk.js';
|
|
2
2
|
import 'ai';
|
|
3
3
|
import '../base-BZViaFTt.js';
|
|
4
4
|
import '@opentelemetry/api';
|