@mastra/core 0.10.13 → 0.10.14
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/a2a.d.ts +1 -0
- package/agent.d.ts +1 -0
- package/base.d.ts +1 -0
- package/bundler.d.ts +1 -0
- package/deployer.d.ts +1 -0
- package/di.d.ts +1 -0
- package/dist/a2a/index.cjs +79 -0
- package/dist/a2a/index.d.cts +780 -0
- package/dist/a2a/index.d.ts +780 -0
- package/dist/a2a/index.js +68 -0
- package/dist/agent/index.cjs +15 -0
- package/dist/agent/index.d.cts +29 -0
- package/dist/agent/index.d.ts +29 -0
- package/dist/agent/index.js +2 -0
- package/dist/base-B_y9sMg0.d.cts +162 -0
- package/dist/base-CS5eSXbL.d.cts +4117 -0
- package/dist/base-ClrXcCRx.d.ts +162 -0
- package/dist/base-DBhKcre4.d.ts +4117 -0
- package/dist/base.cjs +10 -0
- package/dist/base.d.cts +6 -0
- package/dist/base.d.ts +6 -0
- package/dist/base.js +1 -0
- package/dist/bundler/index.cjs +10 -0
- package/dist/bundler/index.d.cts +30 -0
- package/dist/bundler/index.d.ts +30 -0
- package/dist/bundler/index.js +1 -0
- package/dist/chunk-2GRYVZ2O.cjs +244 -0
- package/dist/chunk-2HDFKWFU.js +2249 -0
- package/dist/chunk-32C7JDIZ.js +1 -0
- package/dist/chunk-4UBOJFSL.js +989 -0
- package/dist/chunk-4UWPFBC6.js +88 -0
- package/dist/chunk-4Z3OU5RY.cjs +31 -0
- package/dist/chunk-5HTMDAXP.js +359 -0
- package/dist/chunk-5IEKR756.js +53 -0
- package/dist/chunk-5YDTZN2X.js +114 -0
- package/dist/chunk-6UNGH46J.js +75 -0
- package/dist/chunk-6Y4UL5Z6.cjs +94 -0
- package/dist/chunk-7F6BQXE2.cjs +425 -0
- package/dist/chunk-7H2GET5Z.cjs +668 -0
- package/dist/chunk-7HZ6NIAF.cjs +2 -0
- package/dist/chunk-7MZNOW6W.cjs +2263 -0
- package/dist/chunk-7XQIPES3.js +668 -0
- package/dist/chunk-AKYTYALY.js +70 -0
- package/dist/chunk-ATXBSEFT.js +22 -0
- package/dist/chunk-B6TOBUS6.cjs +80 -0
- package/dist/chunk-B7SQOKEC.cjs +91 -0
- package/dist/chunk-BB4KXGBU.js +83 -0
- package/dist/chunk-BB6DPGIV.cjs +6 -0
- package/dist/chunk-C4LMN2IR.js +27 -0
- package/dist/chunk-DFFVEKIG.js +407 -0
- package/dist/chunk-E7AX3U6M.cjs +659 -0
- package/dist/chunk-EWCOOO3H.js +5007 -0
- package/dist/chunk-F2WMR75C.cjs +183 -0
- package/dist/chunk-FBKJ3652.cjs +5034 -0
- package/dist/chunk-FEYYOBBG.cjs +24 -0
- package/dist/chunk-FL5SZ2XU.js +181 -0
- package/dist/chunk-GH2KM66J.js +37 -0
- package/dist/chunk-GWFS5DAR.cjs +37 -0
- package/dist/chunk-HNEE7IF4.js +60 -0
- package/dist/chunk-HSVOEWAM.cjs +2 -0
- package/dist/chunk-J52TXHZV.cjs +73 -0
- package/dist/chunk-JNMQKJH4.js +10 -0
- package/dist/chunk-JQOMTERC.js +89 -0
- package/dist/chunk-LABUWBKX.cjs +71 -0
- package/dist/chunk-LXFZUKP3.cjs +34 -0
- package/dist/chunk-MP2QBLUJ.cjs +70 -0
- package/dist/chunk-MUNFCOMB.cjs +62 -0
- package/dist/chunk-NH5WJNNS.js +1 -0
- package/dist/chunk-P3Q73CAW.cjs +55 -0
- package/dist/chunk-PA2YIVIT.js +61 -0
- package/dist/chunk-QFTBW7ZZ.cjs +2 -0
- package/dist/chunk-QQ5K5TZE.cjs +619 -0
- package/dist/chunk-QUSEDVYI.cjs +991 -0
- package/dist/chunk-R4V75T7J.js +1 -0
- package/dist/chunk-SGGPJWRQ.js +69 -0
- package/dist/chunk-ST5RMVLG.cjs +87 -0
- package/dist/chunk-TC2SCOTE.js +605 -0
- package/dist/chunk-U64IJDC5.cjs +109 -0
- package/dist/chunk-UX3B6S2I.cjs +65 -0
- package/dist/chunk-V5D2LIF5.js +68 -0
- package/dist/chunk-VG4OPO2R.js +240 -0
- package/dist/chunk-WQNOATKB.js +103 -0
- package/dist/chunk-Y7D2JLKS.js +4 -0
- package/dist/chunk-YJEHXYK5.js +657 -0
- package/dist/chunk-YOQP5T77.js +32 -0
- package/dist/chunk-ZIZ3CVHN.cjs +120 -0
- package/dist/chunk-ZPOUMTTH.cjs +362 -0
- package/dist/chunk-ZZLBNB3U.cjs +12 -0
- package/dist/deployer/index.cjs +10 -0
- package/dist/deployer/index.d.cts +19 -0
- package/dist/deployer/index.d.ts +19 -0
- package/dist/deployer/index.js +1 -0
- package/dist/di/index.cjs +10 -0
- package/dist/di/index.d.cts +1 -0
- package/dist/di/index.d.ts +1 -0
- package/dist/di/index.js +1 -0
- package/dist/error/index.cjs +22 -0
- package/dist/error/index.d.cts +86 -0
- package/dist/error/index.d.ts +86 -0
- package/dist/error/index.js +1 -0
- package/dist/eval/index.cjs +14 -0
- package/dist/eval/index.d.cts +43 -0
- package/dist/eval/index.d.ts +43 -0
- package/dist/eval/index.js +1 -0
- package/dist/hooks/index.cjs +18 -0
- package/dist/hooks/index.d.cts +33 -0
- package/dist/hooks/index.d.ts +33 -0
- package/dist/hooks/index.js +1 -0
- package/dist/index.cjs +281 -0
- package/dist/index.d.cts +92 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +112 -0
- package/dist/integration/index.cjs +14 -0
- package/dist/integration/index.d.cts +65 -0
- package/dist/integration/index.d.ts +65 -0
- package/dist/integration/index.js +1 -0
- package/dist/llm/index.cjs +10 -0
- package/dist/llm/index.d.cts +29 -0
- package/dist/llm/index.d.ts +29 -0
- package/dist/llm/index.js +1 -0
- package/dist/logger/index.cjs +43 -0
- package/dist/logger/index.d.cts +96 -0
- package/dist/logger/index.d.ts +96 -0
- package/dist/logger/index.js +2 -0
- package/dist/logger-B8XXh6ya.d.cts +159 -0
- package/dist/logger-Bpa2oLL4.d.ts +159 -0
- package/dist/mastra/index.cjs +10 -0
- package/dist/mastra/index.d.cts +29 -0
- package/dist/mastra/index.d.ts +29 -0
- package/dist/mastra/index.js +1 -0
- package/dist/mcp/index.cjs +106 -0
- package/dist/mcp/index.d.cts +29 -0
- package/dist/mcp/index.d.ts +29 -0
- package/dist/mcp/index.js +100 -0
- package/dist/memory/index.cjs +18 -0
- package/dist/memory/index.d.cts +29 -0
- package/dist/memory/index.d.ts +29 -0
- package/dist/memory/index.js +1 -0
- package/dist/network/index.cjs +311 -0
- package/dist/network/index.d.cts +29 -0
- package/dist/network/index.d.ts +29 -0
- package/dist/network/index.js +309 -0
- package/dist/network/vNext/index.cjs +873 -0
- package/dist/network/vNext/index.d.cts +29 -0
- package/dist/network/vNext/index.d.ts +29 -0
- package/dist/network/vNext/index.js +871 -0
- package/dist/relevance/index.cjs +18 -0
- package/dist/relevance/index.d.cts +49 -0
- package/dist/relevance/index.d.ts +49 -0
- package/dist/relevance/index.js +1 -0
- package/dist/runtime-context/index.cjs +10 -0
- package/dist/runtime-context/index.d.cts +52 -0
- package/dist/runtime-context/index.d.ts +52 -0
- package/dist/runtime-context/index.js +1 -0
- package/dist/server/index.cjs +62 -0
- package/dist/server/index.d.cts +52 -0
- package/dist/server/index.d.ts +52 -0
- package/dist/server/index.js +59 -0
- package/dist/storage/index.cjs +336 -0
- package/dist/storage/index.d.cts +149 -0
- package/dist/storage/index.d.ts +149 -0
- package/dist/storage/index.js +303 -0
- package/dist/telemetry/index.cjs +30 -0
- package/dist/telemetry/index.d.cts +75 -0
- package/dist/telemetry/index.d.ts +75 -0
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/otel-vendor.cjs +103 -0
- package/dist/telemetry/otel-vendor.d.cts +20 -0
- package/dist/telemetry/otel-vendor.d.ts +20 -0
- package/dist/telemetry/otel-vendor.js +57 -0
- package/dist/tools/index.cjs +18 -0
- package/dist/tools/index.d.cts +41 -0
- package/dist/tools/index.d.ts +41 -0
- package/dist/tools/index.js +1 -0
- package/dist/tts/index.cjs +10 -0
- package/dist/tts/index.d.cts +28 -0
- package/dist/tts/index.d.ts +28 -0
- package/dist/tts/index.js +1 -0
- package/dist/types-Bo1uigWx.d.cts +17 -0
- package/dist/types-Bo1uigWx.d.ts +17 -0
- package/dist/utils.cjs +58 -0
- package/dist/utils.d.cts +149 -0
- package/dist/utils.d.ts +149 -0
- package/dist/utils.js +1 -0
- package/dist/vector/filter/index.cjs +192 -0
- package/dist/vector/filter/index.d.cts +128 -0
- package/dist/vector/filter/index.d.ts +128 -0
- package/dist/vector/filter/index.js +190 -0
- package/dist/vector/index.cjs +10 -0
- package/dist/vector/index.d.cts +77 -0
- package/dist/vector/index.d.ts +77 -0
- package/dist/vector/index.js +1 -0
- package/dist/voice/index.cjs +18 -0
- package/dist/voice/index.d.cts +29 -0
- package/dist/voice/index.d.ts +29 -0
- package/dist/voice/index.js +1 -0
- package/dist/workflows/constants.cjs +10 -0
- package/dist/workflows/constants.d.cts +3 -0
- package/dist/workflows/constants.d.ts +3 -0
- package/dist/workflows/constants.js +1 -0
- package/dist/workflows/index.cjs +42 -0
- package/dist/workflows/index.d.cts +282 -0
- package/dist/workflows/index.d.ts +282 -0
- package/dist/workflows/index.js +1 -0
- package/dist/workflows/legacy/index.cjs +90 -0
- package/dist/workflows/legacy/index.d.cts +91 -0
- package/dist/workflows/legacy/index.d.ts +91 -0
- package/dist/workflows/legacy/index.js +1 -0
- package/error.d.ts +1 -0
- package/eval.d.ts +1 -0
- package/hooks.d.ts +1 -0
- package/integration.d.ts +1 -0
- package/llm.d.ts +1 -0
- package/logger.d.ts +1 -0
- package/mastra.d.ts +1 -0
- package/mcp.d.ts +1 -0
- package/memory.d.ts +1 -0
- package/network/vNext.d.ts +1 -0
- package/network.d.ts +1 -0
- package/package.json +1 -1
- package/relevance.d.ts +1 -0
- package/runtime-context.d.ts +1 -0
- package/server.d.ts +1 -0
- package/storage.d.ts +1 -0
- package/telemetry/otel-vendor.d.ts +1 -0
- package/telemetry.d.ts +1 -0
- package/tools.d.ts +1 -0
- package/tts.d.ts +1 -0
- package/utils.d.ts +1 -0
- package/vector/filter.d.ts +1 -0
- package/vector.d.ts +1 -0
- package/voice.d.ts +1 -0
- package/workflows/_constants.d.ts +1 -0
- package/workflows/legacy.d.ts +1 -0
- package/workflows.d.ts +1 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkF2WMR75C_cjs = require('../chunk-F2WMR75C.cjs');
|
|
4
|
+
var chunkQUSEDVYI_cjs = require('../chunk-QUSEDVYI.cjs');
|
|
5
|
+
var chunkQQ5K5TZE_cjs = require('../chunk-QQ5K5TZE.cjs');
|
|
6
|
+
|
|
7
|
+
// src/storage/mock.ts
|
|
8
|
+
var MockStore = class extends chunkF2WMR75C_cjs.MastraStorage {
|
|
9
|
+
data = {
|
|
10
|
+
mastra_workflow_snapshot: {},
|
|
11
|
+
mastra_evals: {},
|
|
12
|
+
mastra_messages: {},
|
|
13
|
+
mastra_threads: {},
|
|
14
|
+
mastra_traces: {},
|
|
15
|
+
mastra_resources: {}
|
|
16
|
+
};
|
|
17
|
+
constructor() {
|
|
18
|
+
super({ name: "MockStore" });
|
|
19
|
+
this.hasInitialized = Promise.resolve(true);
|
|
20
|
+
}
|
|
21
|
+
async createTable(_) {
|
|
22
|
+
}
|
|
23
|
+
async alterTable({
|
|
24
|
+
tableName
|
|
25
|
+
}) {
|
|
26
|
+
this.logger.debug(`MockStore: alterTable called for ${tableName}`);
|
|
27
|
+
}
|
|
28
|
+
async clearTable({ tableName }) {
|
|
29
|
+
this.logger.debug(`MockStore: clearTable called for ${tableName}`);
|
|
30
|
+
this.data[tableName] = {};
|
|
31
|
+
}
|
|
32
|
+
async insert({ tableName, record }) {
|
|
33
|
+
this.logger.debug(`MockStore: insert called for ${tableName}`, record);
|
|
34
|
+
this.data[tableName][record.run_id] = JSON.parse(JSON.stringify(record));
|
|
35
|
+
}
|
|
36
|
+
async batchInsert({ tableName, records }) {
|
|
37
|
+
this.logger.debug(`MockStore: batchInsert called for ${tableName} with ${records.length} records`);
|
|
38
|
+
for (const record of records) {
|
|
39
|
+
this.data[tableName][record.run_id] = JSON.parse(JSON.stringify(record));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async load({ tableName, keys }) {
|
|
43
|
+
this.logger.debug(`MockStore: load called for ${tableName} with keys`, keys);
|
|
44
|
+
const record = this.data[tableName][keys.run_id];
|
|
45
|
+
return record ? record : null;
|
|
46
|
+
}
|
|
47
|
+
async getThreadById({ threadId }) {
|
|
48
|
+
this.logger.debug(`MockStore: getThreadById called for ${threadId}`);
|
|
49
|
+
const thread = Object.values(this.data.mastra_threads).find((t) => t.id === threadId);
|
|
50
|
+
return thread ? thread : null;
|
|
51
|
+
}
|
|
52
|
+
async getThreadsByResourceId({ resourceId }) {
|
|
53
|
+
this.logger.debug(`MockStore: getThreadsByResourceId called for ${resourceId}`);
|
|
54
|
+
const threads = Object.values(this.data.mastra_threads).filter((t) => t.resourceId === resourceId);
|
|
55
|
+
return threads;
|
|
56
|
+
}
|
|
57
|
+
async saveThread({ thread }) {
|
|
58
|
+
this.logger.debug(`MockStore: saveThread called for ${thread.id}`);
|
|
59
|
+
const key = thread.id;
|
|
60
|
+
this.data.mastra_threads[key] = thread;
|
|
61
|
+
return thread;
|
|
62
|
+
}
|
|
63
|
+
async updateThread({
|
|
64
|
+
id,
|
|
65
|
+
title,
|
|
66
|
+
metadata
|
|
67
|
+
}) {
|
|
68
|
+
this.logger.debug(`MockStore: updateThread called for ${id}`);
|
|
69
|
+
const thread = this.data.mastra_threads[id];
|
|
70
|
+
if (thread) {
|
|
71
|
+
thread.title = title;
|
|
72
|
+
thread.metadata = { ...thread.metadata, ...metadata };
|
|
73
|
+
thread.updatedAt = /* @__PURE__ */ new Date();
|
|
74
|
+
}
|
|
75
|
+
return thread;
|
|
76
|
+
}
|
|
77
|
+
async deleteThread({ threadId }) {
|
|
78
|
+
this.logger.debug(`MockStore: deleteThread called for ${threadId}`);
|
|
79
|
+
delete this.data.mastra_threads[threadId];
|
|
80
|
+
this.data.mastra_messages = Object.fromEntries(
|
|
81
|
+
Object.entries(this.data.mastra_messages).filter(([, msg]) => msg.threadId !== threadId)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
async getResourceById({ resourceId }) {
|
|
85
|
+
this.logger.debug(`MockStore: getResourceById called for ${resourceId}`);
|
|
86
|
+
const resource = this.data.mastra_resources[resourceId];
|
|
87
|
+
return resource ? resource : null;
|
|
88
|
+
}
|
|
89
|
+
async saveResource({ resource }) {
|
|
90
|
+
this.logger.debug(`MockStore: saveResource called for ${resource.id}`);
|
|
91
|
+
this.data.mastra_resources[resource.id] = JSON.parse(JSON.stringify(resource));
|
|
92
|
+
return resource;
|
|
93
|
+
}
|
|
94
|
+
async updateResource({
|
|
95
|
+
resourceId,
|
|
96
|
+
workingMemory,
|
|
97
|
+
metadata
|
|
98
|
+
}) {
|
|
99
|
+
this.logger.debug(`MockStore: updateResource called for ${resourceId}`);
|
|
100
|
+
let resource = this.data.mastra_resources[resourceId];
|
|
101
|
+
if (!resource) {
|
|
102
|
+
resource = {
|
|
103
|
+
id: resourceId,
|
|
104
|
+
workingMemory,
|
|
105
|
+
metadata: metadata || {},
|
|
106
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
107
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
108
|
+
};
|
|
109
|
+
} else {
|
|
110
|
+
resource = {
|
|
111
|
+
...resource,
|
|
112
|
+
workingMemory: workingMemory !== void 0 ? workingMemory : resource.workingMemory,
|
|
113
|
+
metadata: {
|
|
114
|
+
...resource.metadata,
|
|
115
|
+
...metadata
|
|
116
|
+
},
|
|
117
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
this.data.mastra_resources[resourceId] = resource;
|
|
121
|
+
return resource;
|
|
122
|
+
}
|
|
123
|
+
async getMessages({ threadId, selectBy }) {
|
|
124
|
+
this.logger.debug(`MockStore: getMessages called for thread ${threadId}`);
|
|
125
|
+
let messages = Object.values(this.data.mastra_messages).filter((msg) => msg.threadId === threadId);
|
|
126
|
+
if (selectBy?.last) {
|
|
127
|
+
messages = messages.slice(-selectBy.last);
|
|
128
|
+
}
|
|
129
|
+
messages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
130
|
+
return messages;
|
|
131
|
+
}
|
|
132
|
+
async saveMessages(args) {
|
|
133
|
+
const { messages, format = "v1" } = args;
|
|
134
|
+
this.logger.debug(`MockStore: saveMessages called with ${messages.length} messages`);
|
|
135
|
+
for (const message of messages) {
|
|
136
|
+
const key = message.id;
|
|
137
|
+
this.data.mastra_messages[key] = message;
|
|
138
|
+
}
|
|
139
|
+
const list = new chunkQUSEDVYI_cjs.MessageList().add(messages, "memory");
|
|
140
|
+
if (format === `v2`) return list.get.all.v2();
|
|
141
|
+
return list.get.all.v1();
|
|
142
|
+
}
|
|
143
|
+
async updateMessages(args) {
|
|
144
|
+
this.logger.debug(`MockStore: updateMessages called with ${args.messages.length} messages`);
|
|
145
|
+
const messages = args.messages.map((m) => this.data.mastra_messages[m.id]);
|
|
146
|
+
return messages;
|
|
147
|
+
}
|
|
148
|
+
async getTraces({
|
|
149
|
+
name,
|
|
150
|
+
scope,
|
|
151
|
+
page,
|
|
152
|
+
perPage,
|
|
153
|
+
attributes,
|
|
154
|
+
filters,
|
|
155
|
+
fromDate,
|
|
156
|
+
toDate
|
|
157
|
+
}) {
|
|
158
|
+
this.logger.debug(`MockStore: getTraces called`);
|
|
159
|
+
let traces = Object.values(this.data.mastra_traces);
|
|
160
|
+
if (name) traces = traces.filter((t) => t.name?.startsWith(name));
|
|
161
|
+
if (scope) traces = traces.filter((t) => t.scope === scope);
|
|
162
|
+
if (attributes) {
|
|
163
|
+
traces = traces.filter(
|
|
164
|
+
(t) => Object.entries(attributes).every(([key, value]) => t.attributes?.[key] === value)
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
if (filters) {
|
|
168
|
+
traces = traces.filter((t) => Object.entries(filters).every(([key, value]) => t[key] === value));
|
|
169
|
+
}
|
|
170
|
+
if (fromDate) traces = traces.filter((t) => new Date(t.createdAt) >= fromDate);
|
|
171
|
+
if (toDate) traces = traces.filter((t) => new Date(t.createdAt) <= toDate);
|
|
172
|
+
traces.sort((a, b) => new Date(b.startTime).getTime() - new Date(a.startTime).getTime());
|
|
173
|
+
const start = page * perPage;
|
|
174
|
+
const end = start + perPage;
|
|
175
|
+
return traces.slice(start, end);
|
|
176
|
+
}
|
|
177
|
+
async getEvalsByAgentName(agentName, type) {
|
|
178
|
+
this.logger.debug(`MockStore: getEvalsByAgentName called for ${agentName}`);
|
|
179
|
+
let evals = Object.values(this.data.mastra_evals).filter((e) => e.agentName === agentName);
|
|
180
|
+
if (type === "test") {
|
|
181
|
+
evals = evals.filter((e) => e.testInfo && e.testInfo.testPath);
|
|
182
|
+
} else if (type === "live") {
|
|
183
|
+
evals = evals.filter((e) => !e.testInfo || !e.testInfo.testPath);
|
|
184
|
+
}
|
|
185
|
+
evals.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
186
|
+
return evals;
|
|
187
|
+
}
|
|
188
|
+
async getWorkflowRuns({
|
|
189
|
+
workflowName,
|
|
190
|
+
fromDate,
|
|
191
|
+
toDate,
|
|
192
|
+
limit,
|
|
193
|
+
offset,
|
|
194
|
+
resourceId
|
|
195
|
+
} = {}) {
|
|
196
|
+
this.logger.debug(`MockStore: getWorkflowRuns called`);
|
|
197
|
+
let runs = Object.values(this.data.mastra_workflow_snapshot || {});
|
|
198
|
+
if (workflowName) runs = runs.filter((run) => run.workflow_name === workflowName);
|
|
199
|
+
if (fromDate) runs = runs.filter((run) => new Date(run.createdAt) >= fromDate);
|
|
200
|
+
if (toDate) runs = runs.filter((run) => new Date(run.createdAt) <= toDate);
|
|
201
|
+
if (resourceId) runs = runs.filter((run) => run.resourceId === resourceId);
|
|
202
|
+
const total = runs.length;
|
|
203
|
+
runs.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
204
|
+
if (limit !== void 0 && offset !== void 0) {
|
|
205
|
+
const start = offset;
|
|
206
|
+
const end = start + limit;
|
|
207
|
+
runs = runs.slice(start, end);
|
|
208
|
+
}
|
|
209
|
+
const parsedRuns = runs.map((run) => ({
|
|
210
|
+
...run,
|
|
211
|
+
snapshot: typeof run.snapshot === "string" ? JSON.parse(run.snapshot) : { ...run.snapshot },
|
|
212
|
+
createdAt: new Date(run.createdAt),
|
|
213
|
+
updatedAt: new Date(run.updatedAt),
|
|
214
|
+
runId: run.run_id,
|
|
215
|
+
workflowName: run.workflow_name
|
|
216
|
+
}));
|
|
217
|
+
return { runs: parsedRuns, total };
|
|
218
|
+
}
|
|
219
|
+
async getWorkflowRunById({
|
|
220
|
+
runId,
|
|
221
|
+
workflowName
|
|
222
|
+
}) {
|
|
223
|
+
this.logger.debug(`MockStore: getWorkflowRunById called for runId ${runId}`);
|
|
224
|
+
let run = Object.values(this.data.mastra_workflow_snapshot || {}).find((r) => r.run_id === runId);
|
|
225
|
+
if (run && workflowName && run.workflow_name !== workflowName) {
|
|
226
|
+
run = void 0;
|
|
227
|
+
}
|
|
228
|
+
if (!run) return null;
|
|
229
|
+
const parsedRun = {
|
|
230
|
+
...run,
|
|
231
|
+
snapshot: typeof run.snapshot === "string" ? JSON.parse(run.snapshot) : run.snapshot,
|
|
232
|
+
createdAt: new Date(run.createdAt),
|
|
233
|
+
updatedAt: new Date(run.updatedAt),
|
|
234
|
+
runId: run.run_id,
|
|
235
|
+
workflowName: run.workflow_name
|
|
236
|
+
};
|
|
237
|
+
return parsedRun;
|
|
238
|
+
}
|
|
239
|
+
async getTracesPaginated({
|
|
240
|
+
name,
|
|
241
|
+
scope,
|
|
242
|
+
attributes,
|
|
243
|
+
page,
|
|
244
|
+
perPage,
|
|
245
|
+
fromDate,
|
|
246
|
+
toDate
|
|
247
|
+
}) {
|
|
248
|
+
this.logger.debug(`MockStore: getTracesPaginated called`);
|
|
249
|
+
let traces = Object.values(this.data.mastra_traces);
|
|
250
|
+
if (name) traces = traces.filter((t) => t.name?.startsWith(name));
|
|
251
|
+
if (scope) traces = traces.filter((t) => t.scope === scope);
|
|
252
|
+
if (attributes) {
|
|
253
|
+
traces = traces.filter(
|
|
254
|
+
(t) => Object.entries(attributes).every(([key, value]) => t.attributes?.[key] === value)
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
if (fromDate) traces = traces.filter((t) => new Date(t.createdAt) >= fromDate);
|
|
258
|
+
if (toDate) traces = traces.filter((t) => new Date(t.createdAt) <= toDate);
|
|
259
|
+
traces.sort((a, b) => new Date(b.startTime).getTime() - new Date(a.startTime).getTime());
|
|
260
|
+
const start = page * perPage;
|
|
261
|
+
const end = start + perPage;
|
|
262
|
+
return {
|
|
263
|
+
traces: traces.slice(start, end),
|
|
264
|
+
total: traces.length,
|
|
265
|
+
page,
|
|
266
|
+
perPage,
|
|
267
|
+
hasMore: traces.length > end
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
async getThreadsByResourceIdPaginated(args) {
|
|
271
|
+
this.logger.debug(`MockStore: getThreadsByResourceIdPaginated called for ${args.resourceId}`);
|
|
272
|
+
const threads = Object.values(this.data.mastra_threads).filter((t) => t.resourceId === args.resourceId);
|
|
273
|
+
return {
|
|
274
|
+
threads: threads.slice(args.page * args.perPage, (args.page + 1) * args.perPage),
|
|
275
|
+
total: threads.length,
|
|
276
|
+
page: args.page,
|
|
277
|
+
perPage: args.perPage,
|
|
278
|
+
hasMore: threads.length > (args.page + 1) * args.perPage
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
async getMessagesPaginated({
|
|
282
|
+
threadId,
|
|
283
|
+
selectBy
|
|
284
|
+
}) {
|
|
285
|
+
this.logger.debug(`MockStore: getMessagesPaginated called for thread ${threadId}`);
|
|
286
|
+
const { page = 0, perPage = 40 } = selectBy?.pagination || {};
|
|
287
|
+
let messages = Object.values(this.data.mastra_messages).filter((msg) => msg.threadId === threadId);
|
|
288
|
+
if (selectBy?.last) {
|
|
289
|
+
messages = messages.slice(-selectBy.last);
|
|
290
|
+
}
|
|
291
|
+
messages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
292
|
+
const start = page * perPage;
|
|
293
|
+
const end = start + perPage;
|
|
294
|
+
return {
|
|
295
|
+
messages: messages.slice(start, end),
|
|
296
|
+
total: messages.length,
|
|
297
|
+
page,
|
|
298
|
+
perPage,
|
|
299
|
+
hasMore: messages.length > end
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
Object.defineProperty(exports, "MastraStorage", {
|
|
305
|
+
enumerable: true,
|
|
306
|
+
get: function () { return chunkF2WMR75C_cjs.MastraStorage; }
|
|
307
|
+
});
|
|
308
|
+
Object.defineProperty(exports, "TABLE_EVALS", {
|
|
309
|
+
enumerable: true,
|
|
310
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_EVALS; }
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "TABLE_MESSAGES", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_MESSAGES; }
|
|
315
|
+
});
|
|
316
|
+
Object.defineProperty(exports, "TABLE_RESOURCES", {
|
|
317
|
+
enumerable: true,
|
|
318
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_RESOURCES; }
|
|
319
|
+
});
|
|
320
|
+
Object.defineProperty(exports, "TABLE_SCHEMAS", {
|
|
321
|
+
enumerable: true,
|
|
322
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_SCHEMAS; }
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(exports, "TABLE_THREADS", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_THREADS; }
|
|
327
|
+
});
|
|
328
|
+
Object.defineProperty(exports, "TABLE_TRACES", {
|
|
329
|
+
enumerable: true,
|
|
330
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_TRACES; }
|
|
331
|
+
});
|
|
332
|
+
Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
|
|
333
|
+
enumerable: true,
|
|
334
|
+
get: function () { return chunkQQ5K5TZE_cjs.TABLE_WORKFLOW_SNAPSHOT; }
|
|
335
|
+
});
|
|
336
|
+
exports.MockStore = MockStore;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { o as MastraStorage, p as TABLE_NAMES, q as StorageColumn, r as StorageThreadType, s as StorageResourceType, t as MastraMessageV2, u as StorageGetMessagesArg, v as MastraMessageV1, E as EvalRow, w as WorkflowRuns, x as WorkflowRun, P as PaginationInfo } from '../base-CS5eSXbL.cjs';
|
|
2
|
+
export { z as LegacyWorkflowRun, y as LegacyWorkflowRuns, B as PaginationArgs, D as StorageGetTracesArg, G as TABLE_EVALS, H as TABLE_MESSAGES, K as TABLE_RESOURCES, O as TABLE_SCHEMAS, I as TABLE_THREADS, J as TABLE_TRACES, F as TABLE_WORKFLOW_SNAPSHOT } from '../base-CS5eSXbL.cjs';
|
|
3
|
+
import { T as Trace } from '../base-B_y9sMg0.cjs';
|
|
4
|
+
import 'ai';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../logger-B8XXh6ya.cjs';
|
|
7
|
+
import '../error/index.cjs';
|
|
8
|
+
import 'stream';
|
|
9
|
+
import 'json-schema';
|
|
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 'node:http';
|
|
20
|
+
import 'hono';
|
|
21
|
+
import 'stream/web';
|
|
22
|
+
import 'events';
|
|
23
|
+
import 'node:stream/web';
|
|
24
|
+
import '../workflows/constants.cjs';
|
|
25
|
+
import 'ai/test';
|
|
26
|
+
import '../deployer/index.cjs';
|
|
27
|
+
import '../bundler/index.cjs';
|
|
28
|
+
import 'hono/cors';
|
|
29
|
+
import 'hono-openapi';
|
|
30
|
+
import '@opentelemetry/sdk-trace-base';
|
|
31
|
+
|
|
32
|
+
declare class MockStore extends MastraStorage {
|
|
33
|
+
private data;
|
|
34
|
+
constructor();
|
|
35
|
+
createTable(_: {
|
|
36
|
+
tableName: TABLE_NAMES;
|
|
37
|
+
schema: Record<string, StorageColumn>;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
alterTable({ tableName, }: {
|
|
40
|
+
tableName: TABLE_NAMES;
|
|
41
|
+
schema: Record<string, StorageColumn>;
|
|
42
|
+
ifNotExists: string[];
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
clearTable({ tableName }: {
|
|
45
|
+
tableName: TABLE_NAMES;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
insert({ tableName, record }: {
|
|
48
|
+
tableName: TABLE_NAMES;
|
|
49
|
+
record: Record<string, any>;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
batchInsert({ tableName, records }: {
|
|
52
|
+
tableName: TABLE_NAMES;
|
|
53
|
+
records: Record<string, any>[];
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
load<R>({ tableName, keys }: {
|
|
56
|
+
tableName: TABLE_NAMES;
|
|
57
|
+
keys: Record<string, string>;
|
|
58
|
+
}): Promise<R | null>;
|
|
59
|
+
getThreadById({ threadId }: {
|
|
60
|
+
threadId: string;
|
|
61
|
+
}): Promise<StorageThreadType | null>;
|
|
62
|
+
getThreadsByResourceId({ resourceId }: {
|
|
63
|
+
resourceId: string;
|
|
64
|
+
}): Promise<StorageThreadType[]>;
|
|
65
|
+
saveThread({ thread }: {
|
|
66
|
+
thread: StorageThreadType;
|
|
67
|
+
}): Promise<StorageThreadType>;
|
|
68
|
+
updateThread({ id, title, metadata, }: {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
metadata: Record<string, unknown>;
|
|
72
|
+
}): Promise<StorageThreadType>;
|
|
73
|
+
deleteThread({ threadId }: {
|
|
74
|
+
threadId: string;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
getResourceById({ resourceId }: {
|
|
77
|
+
resourceId: string;
|
|
78
|
+
}): Promise<StorageResourceType | null>;
|
|
79
|
+
saveResource({ resource }: {
|
|
80
|
+
resource: StorageResourceType;
|
|
81
|
+
}): Promise<StorageResourceType>;
|
|
82
|
+
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
83
|
+
resourceId: string;
|
|
84
|
+
workingMemory?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}): Promise<StorageResourceType>;
|
|
87
|
+
getMessages<T extends MastraMessageV2[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
|
|
88
|
+
saveMessages(args: {
|
|
89
|
+
messages: MastraMessageV1[];
|
|
90
|
+
format?: undefined | 'v1';
|
|
91
|
+
}): Promise<MastraMessageV1[]>;
|
|
92
|
+
saveMessages(args: {
|
|
93
|
+
messages: MastraMessageV2[];
|
|
94
|
+
format: 'v2';
|
|
95
|
+
}): Promise<MastraMessageV2[]>;
|
|
96
|
+
updateMessages(args: {
|
|
97
|
+
messages: Partial<MastraMessageV2> & {
|
|
98
|
+
id: string;
|
|
99
|
+
}[];
|
|
100
|
+
}): Promise<MastraMessageV2[]>;
|
|
101
|
+
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: {
|
|
102
|
+
name?: string;
|
|
103
|
+
scope?: string;
|
|
104
|
+
page: number;
|
|
105
|
+
perPage: number;
|
|
106
|
+
attributes?: Record<string, string>;
|
|
107
|
+
filters?: Record<string, any>;
|
|
108
|
+
fromDate?: Date;
|
|
109
|
+
toDate?: Date;
|
|
110
|
+
}): Promise<any[]>;
|
|
111
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
112
|
+
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
113
|
+
workflowName?: string;
|
|
114
|
+
fromDate?: Date;
|
|
115
|
+
toDate?: Date;
|
|
116
|
+
limit?: number;
|
|
117
|
+
offset?: number;
|
|
118
|
+
resourceId?: string;
|
|
119
|
+
}): Promise<WorkflowRuns>;
|
|
120
|
+
getWorkflowRunById({ runId, workflowName, }: {
|
|
121
|
+
runId: string;
|
|
122
|
+
workflowName?: string;
|
|
123
|
+
}): Promise<WorkflowRun | null>;
|
|
124
|
+
getTracesPaginated({ name, scope, attributes, page, perPage, fromDate, toDate, }: {
|
|
125
|
+
name?: string;
|
|
126
|
+
scope?: string;
|
|
127
|
+
attributes?: Record<string, string>;
|
|
128
|
+
page: number;
|
|
129
|
+
perPage: number;
|
|
130
|
+
fromDate?: Date;
|
|
131
|
+
toDate?: Date;
|
|
132
|
+
}): Promise<PaginationInfo & {
|
|
133
|
+
traces: Trace[];
|
|
134
|
+
}>;
|
|
135
|
+
getThreadsByResourceIdPaginated(args: {
|
|
136
|
+
resourceId: string;
|
|
137
|
+
page: number;
|
|
138
|
+
perPage: number;
|
|
139
|
+
}): Promise<PaginationInfo & {
|
|
140
|
+
threads: StorageThreadType[];
|
|
141
|
+
}>;
|
|
142
|
+
getMessagesPaginated({ threadId, selectBy, }: StorageGetMessagesArg & {
|
|
143
|
+
format?: 'v1' | 'v2';
|
|
144
|
+
}): Promise<PaginationInfo & {
|
|
145
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
146
|
+
}>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { EvalRow, MastraStorage, MockStore, PaginationInfo, StorageColumn, StorageGetMessagesArg, StorageResourceType, TABLE_NAMES, WorkflowRun, WorkflowRuns };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { o as MastraStorage, p as TABLE_NAMES, q as StorageColumn, r as StorageThreadType, s as StorageResourceType, t as MastraMessageV2, u as StorageGetMessagesArg, v as MastraMessageV1, E as EvalRow, w as WorkflowRuns, x as WorkflowRun, P as PaginationInfo } from '../base-DBhKcre4.js';
|
|
2
|
+
export { z as LegacyWorkflowRun, y as LegacyWorkflowRuns, B as PaginationArgs, D as StorageGetTracesArg, G as TABLE_EVALS, H as TABLE_MESSAGES, K as TABLE_RESOURCES, O as TABLE_SCHEMAS, I as TABLE_THREADS, J as TABLE_TRACES, F as TABLE_WORKFLOW_SNAPSHOT } from '../base-DBhKcre4.js';
|
|
3
|
+
import { T as Trace } from '../base-ClrXcCRx.js';
|
|
4
|
+
import 'ai';
|
|
5
|
+
import 'zod';
|
|
6
|
+
import '../logger-Bpa2oLL4.js';
|
|
7
|
+
import '../error/index.js';
|
|
8
|
+
import 'stream';
|
|
9
|
+
import 'json-schema';
|
|
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 'node:http';
|
|
20
|
+
import 'hono';
|
|
21
|
+
import 'stream/web';
|
|
22
|
+
import 'events';
|
|
23
|
+
import 'node:stream/web';
|
|
24
|
+
import '../workflows/constants.js';
|
|
25
|
+
import 'ai/test';
|
|
26
|
+
import '../deployer/index.js';
|
|
27
|
+
import '../bundler/index.js';
|
|
28
|
+
import 'hono/cors';
|
|
29
|
+
import 'hono-openapi';
|
|
30
|
+
import '@opentelemetry/sdk-trace-base';
|
|
31
|
+
|
|
32
|
+
declare class MockStore extends MastraStorage {
|
|
33
|
+
private data;
|
|
34
|
+
constructor();
|
|
35
|
+
createTable(_: {
|
|
36
|
+
tableName: TABLE_NAMES;
|
|
37
|
+
schema: Record<string, StorageColumn>;
|
|
38
|
+
}): Promise<void>;
|
|
39
|
+
alterTable({ tableName, }: {
|
|
40
|
+
tableName: TABLE_NAMES;
|
|
41
|
+
schema: Record<string, StorageColumn>;
|
|
42
|
+
ifNotExists: string[];
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
clearTable({ tableName }: {
|
|
45
|
+
tableName: TABLE_NAMES;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
insert({ tableName, record }: {
|
|
48
|
+
tableName: TABLE_NAMES;
|
|
49
|
+
record: Record<string, any>;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
batchInsert({ tableName, records }: {
|
|
52
|
+
tableName: TABLE_NAMES;
|
|
53
|
+
records: Record<string, any>[];
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
load<R>({ tableName, keys }: {
|
|
56
|
+
tableName: TABLE_NAMES;
|
|
57
|
+
keys: Record<string, string>;
|
|
58
|
+
}): Promise<R | null>;
|
|
59
|
+
getThreadById({ threadId }: {
|
|
60
|
+
threadId: string;
|
|
61
|
+
}): Promise<StorageThreadType | null>;
|
|
62
|
+
getThreadsByResourceId({ resourceId }: {
|
|
63
|
+
resourceId: string;
|
|
64
|
+
}): Promise<StorageThreadType[]>;
|
|
65
|
+
saveThread({ thread }: {
|
|
66
|
+
thread: StorageThreadType;
|
|
67
|
+
}): Promise<StorageThreadType>;
|
|
68
|
+
updateThread({ id, title, metadata, }: {
|
|
69
|
+
id: string;
|
|
70
|
+
title: string;
|
|
71
|
+
metadata: Record<string, unknown>;
|
|
72
|
+
}): Promise<StorageThreadType>;
|
|
73
|
+
deleteThread({ threadId }: {
|
|
74
|
+
threadId: string;
|
|
75
|
+
}): Promise<void>;
|
|
76
|
+
getResourceById({ resourceId }: {
|
|
77
|
+
resourceId: string;
|
|
78
|
+
}): Promise<StorageResourceType | null>;
|
|
79
|
+
saveResource({ resource }: {
|
|
80
|
+
resource: StorageResourceType;
|
|
81
|
+
}): Promise<StorageResourceType>;
|
|
82
|
+
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
83
|
+
resourceId: string;
|
|
84
|
+
workingMemory?: string;
|
|
85
|
+
metadata?: Record<string, unknown>;
|
|
86
|
+
}): Promise<StorageResourceType>;
|
|
87
|
+
getMessages<T extends MastraMessageV2[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
|
|
88
|
+
saveMessages(args: {
|
|
89
|
+
messages: MastraMessageV1[];
|
|
90
|
+
format?: undefined | 'v1';
|
|
91
|
+
}): Promise<MastraMessageV1[]>;
|
|
92
|
+
saveMessages(args: {
|
|
93
|
+
messages: MastraMessageV2[];
|
|
94
|
+
format: 'v2';
|
|
95
|
+
}): Promise<MastraMessageV2[]>;
|
|
96
|
+
updateMessages(args: {
|
|
97
|
+
messages: Partial<MastraMessageV2> & {
|
|
98
|
+
id: string;
|
|
99
|
+
}[];
|
|
100
|
+
}): Promise<MastraMessageV2[]>;
|
|
101
|
+
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: {
|
|
102
|
+
name?: string;
|
|
103
|
+
scope?: string;
|
|
104
|
+
page: number;
|
|
105
|
+
perPage: number;
|
|
106
|
+
attributes?: Record<string, string>;
|
|
107
|
+
filters?: Record<string, any>;
|
|
108
|
+
fromDate?: Date;
|
|
109
|
+
toDate?: Date;
|
|
110
|
+
}): Promise<any[]>;
|
|
111
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
112
|
+
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
113
|
+
workflowName?: string;
|
|
114
|
+
fromDate?: Date;
|
|
115
|
+
toDate?: Date;
|
|
116
|
+
limit?: number;
|
|
117
|
+
offset?: number;
|
|
118
|
+
resourceId?: string;
|
|
119
|
+
}): Promise<WorkflowRuns>;
|
|
120
|
+
getWorkflowRunById({ runId, workflowName, }: {
|
|
121
|
+
runId: string;
|
|
122
|
+
workflowName?: string;
|
|
123
|
+
}): Promise<WorkflowRun | null>;
|
|
124
|
+
getTracesPaginated({ name, scope, attributes, page, perPage, fromDate, toDate, }: {
|
|
125
|
+
name?: string;
|
|
126
|
+
scope?: string;
|
|
127
|
+
attributes?: Record<string, string>;
|
|
128
|
+
page: number;
|
|
129
|
+
perPage: number;
|
|
130
|
+
fromDate?: Date;
|
|
131
|
+
toDate?: Date;
|
|
132
|
+
}): Promise<PaginationInfo & {
|
|
133
|
+
traces: Trace[];
|
|
134
|
+
}>;
|
|
135
|
+
getThreadsByResourceIdPaginated(args: {
|
|
136
|
+
resourceId: string;
|
|
137
|
+
page: number;
|
|
138
|
+
perPage: number;
|
|
139
|
+
}): Promise<PaginationInfo & {
|
|
140
|
+
threads: StorageThreadType[];
|
|
141
|
+
}>;
|
|
142
|
+
getMessagesPaginated({ threadId, selectBy, }: StorageGetMessagesArg & {
|
|
143
|
+
format?: 'v1' | 'v2';
|
|
144
|
+
}): Promise<PaginationInfo & {
|
|
145
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
146
|
+
}>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { EvalRow, MastraStorage, MockStore, PaginationInfo, StorageColumn, StorageGetMessagesArg, StorageResourceType, TABLE_NAMES, WorkflowRun, WorkflowRuns };
|