@mastra/core 0.4.2-alpha.0 → 0.4.2-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/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +1 -1
- package/dist/{base-eWkcLLSb.d.ts → base-D90KQ4XI.d.ts} +1 -1
- package/dist/{base-BdNHFjqH.d.ts → base-hk-xmLC1.d.ts} +30 -23
- package/dist/base.d.ts +3 -3
- package/dist/base.js +1 -1
- package/dist/bundler/index.d.ts +3 -3
- package/dist/bundler/index.js +1 -1
- package/dist/{chunk-LKOVXFLE.js → chunk-33GSTUNK.js} +4 -4
- package/dist/{chunk-Z735LDV7.js → chunk-4YRYBCOZ.js} +1 -1
- package/dist/chunk-55NFNRKO.js +10 -0
- package/dist/chunk-5XPCMNGW.js +215 -0
- package/dist/{chunk-ORM3OCHX.js → chunk-7TG2Y45H.js} +118 -17
- package/dist/{chunk-HPIB5X7E.js → chunk-KM7PRKJ2.js} +5 -5
- package/dist/{chunk-XD7K4XPP.js → chunk-M626YCHO.js} +106 -6
- package/dist/{chunk-6RDA4JYW.js → chunk-OZ4XVJ6F.js} +1 -1
- package/dist/{chunk-KP5SHTKA.js → chunk-PHMSPCTC.js} +2 -2
- package/dist/{chunk-N7KZVQDK.js → chunk-PL6URKH2.js} +1 -1
- package/dist/{chunk-NDQR6IPC.js → chunk-QAAJAHDB.js} +2 -2
- package/dist/{chunk-YUOADWSP.js → chunk-SVEAENO7.js} +2 -2
- package/dist/{chunk-4ZRHVG25.js → chunk-W5HVJX45.js} +5 -5
- package/dist/{chunk-TCMOYQ74.js → chunk-XVS6QFTX.js} +20 -4
- package/dist/{chunk-JIV6PDIN.js → chunk-YLCBP7MP.js} +7 -217
- package/dist/deployer/index.d.ts +3 -3
- package/dist/deployer/index.js +1 -1
- package/dist/eval/index.d.ts +4 -4
- package/dist/{index-C5uPdbs4.d.ts → index-mKY1XrpK.d.ts} +2 -2
- package/dist/index.d.ts +11 -19
- package/dist/index.js +15 -26
- package/dist/integration/index.d.ts +5 -5
- package/dist/llm/index.d.ts +4 -4
- package/dist/logger/index.d.ts +2 -2
- package/dist/logger/index.js +1 -1
- package/dist/mastra/index.d.ts +5 -5
- package/dist/mastra/index.js +1 -1
- package/dist/memory/index.d.ts +4 -4
- package/dist/memory/index.js +1 -1
- package/dist/relevance/index.js +1 -1
- package/dist/storage/index.d.ts +7 -76
- package/dist/storage/index.js +1 -2
- package/dist/storage/libsql/index.d.ts +81 -0
- package/dist/storage/libsql/index.js +1 -0
- package/dist/telemetry/index.d.ts +4 -4
- package/dist/telemetry/index.js +1 -1
- package/dist/tools/index.d.ts +6 -6
- package/dist/tts/index.d.ts +3 -3
- package/dist/tts/index.js +1 -1
- package/dist/vector/index.d.ts +4 -7
- package/dist/vector/index.js +1 -1
- package/dist/vector/libsql/index.d.ts +5 -6
- package/dist/vector/libsql/index.js +1 -1
- package/dist/voice/index.d.ts +3 -3
- package/dist/voice/index.js +2 -2
- package/dist/{workflow-CbKcJz7a.d.ts → workflow-BxyFP9Wv.d.ts} +3 -3
- package/dist/workflows/index.d.ts +6 -6
- package/dist/workflows/index.js +1 -1
- package/package.json +9 -12
- package/dist/chunk-7NPRQT5A.js +0 -111
|
@@ -1,218 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createClient } from '@libsql/client';
|
|
1
|
+
import { MastraStorage } from './chunk-5XPCMNGW.js';
|
|
2
|
+
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_THREADS, TABLE_MESSAGES, TABLE_EVALS, TABLE_TRACES } from './chunk-RG66XEJT.js';
|
|
4
3
|
import { join } from 'node:path';
|
|
4
|
+
import { createClient } from '@libsql/client';
|
|
5
5
|
|
|
6
|
-
// src/storage/base.ts
|
|
7
|
-
var MastraStorage = class extends MastraBase {
|
|
8
|
-
/** @deprecated import from { TABLE_WORKFLOW_SNAPSHOT } '@mastra/core/storage' instead */
|
|
9
|
-
static TABLE_WORKFLOW_SNAPSHOT = TABLE_WORKFLOW_SNAPSHOT;
|
|
10
|
-
/** @deprecated import from { TABLE_EVALS } '@mastra/core/storage' instead */
|
|
11
|
-
static TABLE_EVALS = TABLE_EVALS;
|
|
12
|
-
/** @deprecated import from { TABLE_MESSAGES } '@mastra/core/storage' instead */
|
|
13
|
-
static TABLE_MESSAGES = TABLE_MESSAGES;
|
|
14
|
-
/** @deprecated import from { TABLE_THREADS } '@mastra/core/storage' instead */
|
|
15
|
-
static TABLE_THREADS = TABLE_THREADS;
|
|
16
|
-
/** @deprecated import { TABLE_TRACES } from '@mastra/core/storage' instead */
|
|
17
|
-
static TABLE_TRACES = TABLE_TRACES;
|
|
18
|
-
hasInitialized = null;
|
|
19
|
-
constructor({ name }) {
|
|
20
|
-
super({
|
|
21
|
-
component: "STORAGE",
|
|
22
|
-
name
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
async __batchInsert({
|
|
26
|
-
tableName,
|
|
27
|
-
records
|
|
28
|
-
}) {
|
|
29
|
-
await this.init();
|
|
30
|
-
return this.batchInsert({ tableName, records });
|
|
31
|
-
}
|
|
32
|
-
async __getThreadById({ threadId }) {
|
|
33
|
-
await this.init();
|
|
34
|
-
return this.getThreadById({ threadId });
|
|
35
|
-
}
|
|
36
|
-
async __getThreadsByResourceId({ resourceId }) {
|
|
37
|
-
await this.init();
|
|
38
|
-
return this.getThreadsByResourceId({ resourceId });
|
|
39
|
-
}
|
|
40
|
-
async __saveThread({ thread }) {
|
|
41
|
-
await this.init();
|
|
42
|
-
return this.saveThread({ thread });
|
|
43
|
-
}
|
|
44
|
-
async __updateThread({
|
|
45
|
-
id,
|
|
46
|
-
title,
|
|
47
|
-
metadata
|
|
48
|
-
}) {
|
|
49
|
-
await this.init();
|
|
50
|
-
return this.updateThread({ id, title, metadata });
|
|
51
|
-
}
|
|
52
|
-
async __deleteThread({ threadId }) {
|
|
53
|
-
await this.init();
|
|
54
|
-
return this.deleteThread({ threadId });
|
|
55
|
-
}
|
|
56
|
-
async __getMessages({ threadId, selectBy, threadConfig }) {
|
|
57
|
-
await this.init();
|
|
58
|
-
return this.getMessages({ threadId, selectBy, threadConfig });
|
|
59
|
-
}
|
|
60
|
-
async __saveMessages({ messages }) {
|
|
61
|
-
await this.init();
|
|
62
|
-
return this.saveMessages({ messages });
|
|
63
|
-
}
|
|
64
|
-
async __getTraces({
|
|
65
|
-
scope,
|
|
66
|
-
page,
|
|
67
|
-
perPage,
|
|
68
|
-
attributes
|
|
69
|
-
}) {
|
|
70
|
-
await this.init();
|
|
71
|
-
return this.getTraces({ scope, page, perPage, attributes });
|
|
72
|
-
}
|
|
73
|
-
async init() {
|
|
74
|
-
if (await this.hasInitialized) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this.hasInitialized = Promise.all([
|
|
78
|
-
this.createTable({
|
|
79
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
80
|
-
schema: {
|
|
81
|
-
workflow_name: {
|
|
82
|
-
type: "text"
|
|
83
|
-
},
|
|
84
|
-
run_id: {
|
|
85
|
-
type: "text"
|
|
86
|
-
},
|
|
87
|
-
snapshot: {
|
|
88
|
-
type: "text"
|
|
89
|
-
},
|
|
90
|
-
createdAt: {
|
|
91
|
-
type: "timestamp"
|
|
92
|
-
},
|
|
93
|
-
updatedAt: {
|
|
94
|
-
type: "timestamp"
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}),
|
|
98
|
-
this.createTable({
|
|
99
|
-
tableName: TABLE_EVALS,
|
|
100
|
-
schema: {
|
|
101
|
-
input: {
|
|
102
|
-
type: "text"
|
|
103
|
-
},
|
|
104
|
-
output: {
|
|
105
|
-
type: "text"
|
|
106
|
-
},
|
|
107
|
-
result: {
|
|
108
|
-
type: "jsonb"
|
|
109
|
-
},
|
|
110
|
-
agent_name: {
|
|
111
|
-
type: "text"
|
|
112
|
-
},
|
|
113
|
-
metric_name: {
|
|
114
|
-
type: "text"
|
|
115
|
-
},
|
|
116
|
-
instructions: {
|
|
117
|
-
type: "text"
|
|
118
|
-
},
|
|
119
|
-
test_info: {
|
|
120
|
-
type: "jsonb",
|
|
121
|
-
nullable: true
|
|
122
|
-
},
|
|
123
|
-
global_run_id: {
|
|
124
|
-
type: "text"
|
|
125
|
-
},
|
|
126
|
-
run_id: {
|
|
127
|
-
type: "text"
|
|
128
|
-
},
|
|
129
|
-
created_at: {
|
|
130
|
-
type: "timestamp"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}),
|
|
134
|
-
this.createTable({
|
|
135
|
-
tableName: TABLE_THREADS,
|
|
136
|
-
schema: {
|
|
137
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
138
|
-
resourceId: { type: "text", nullable: false },
|
|
139
|
-
title: { type: "text", nullable: false },
|
|
140
|
-
metadata: { type: "text", nullable: true },
|
|
141
|
-
createdAt: { type: "timestamp", nullable: false },
|
|
142
|
-
updatedAt: { type: "timestamp", nullable: false }
|
|
143
|
-
}
|
|
144
|
-
}),
|
|
145
|
-
this.createTable({
|
|
146
|
-
tableName: TABLE_MESSAGES,
|
|
147
|
-
schema: {
|
|
148
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
149
|
-
thread_id: { type: "text", nullable: false },
|
|
150
|
-
content: { type: "text", nullable: false },
|
|
151
|
-
role: { type: "text", nullable: false },
|
|
152
|
-
type: { type: "text", nullable: false },
|
|
153
|
-
createdAt: { type: "timestamp", nullable: false }
|
|
154
|
-
}
|
|
155
|
-
}),
|
|
156
|
-
this.createTable({
|
|
157
|
-
tableName: TABLE_TRACES,
|
|
158
|
-
schema: {
|
|
159
|
-
id: { type: "text", nullable: false, primaryKey: true },
|
|
160
|
-
parentSpanId: { type: "text", nullable: true },
|
|
161
|
-
name: { type: "text", nullable: false },
|
|
162
|
-
traceId: { type: "text", nullable: false },
|
|
163
|
-
scope: { type: "text", nullable: false },
|
|
164
|
-
kind: { type: "integer", nullable: false },
|
|
165
|
-
attributes: { type: "jsonb", nullable: true },
|
|
166
|
-
status: { type: "jsonb", nullable: true },
|
|
167
|
-
events: { type: "jsonb", nullable: true },
|
|
168
|
-
links: { type: "jsonb", nullable: true },
|
|
169
|
-
other: { type: "text", nullable: true },
|
|
170
|
-
startTime: { type: "bigint", nullable: false },
|
|
171
|
-
endTime: { type: "bigint", nullable: false },
|
|
172
|
-
createdAt: { type: "timestamp", nullable: false }
|
|
173
|
-
}
|
|
174
|
-
})
|
|
175
|
-
]).then(() => true);
|
|
176
|
-
await this.hasInitialized;
|
|
177
|
-
}
|
|
178
|
-
async persistWorkflowSnapshot({
|
|
179
|
-
workflowName,
|
|
180
|
-
runId,
|
|
181
|
-
snapshot
|
|
182
|
-
}) {
|
|
183
|
-
await this.init();
|
|
184
|
-
const data = {
|
|
185
|
-
workflow_name: workflowName,
|
|
186
|
-
run_id: runId,
|
|
187
|
-
snapshot,
|
|
188
|
-
createdAt: /* @__PURE__ */ new Date(),
|
|
189
|
-
updatedAt: /* @__PURE__ */ new Date()
|
|
190
|
-
};
|
|
191
|
-
this.logger.debug("Persisting workflow snapshot", { workflowName, runId, data });
|
|
192
|
-
await this.insert({
|
|
193
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
194
|
-
record: data
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
async loadWorkflowSnapshot({
|
|
198
|
-
workflowName,
|
|
199
|
-
runId
|
|
200
|
-
}) {
|
|
201
|
-
if (!this.hasInitialized) {
|
|
202
|
-
await this.init();
|
|
203
|
-
}
|
|
204
|
-
this.logger.debug("Loading workflow snapshot", { workflowName, runId });
|
|
205
|
-
const d = await this.load({
|
|
206
|
-
tableName: TABLE_WORKFLOW_SNAPSHOT,
|
|
207
|
-
keys: { workflow_name: workflowName, run_id: runId }
|
|
208
|
-
});
|
|
209
|
-
return d ? d.snapshot : null;
|
|
210
|
-
}
|
|
211
|
-
async __getEvalsByAgentName(agentName, type) {
|
|
212
|
-
await this.init();
|
|
213
|
-
return this.getEvalsByAgentName(agentName, type);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
6
|
function safelyParseJSON(jsonString) {
|
|
217
7
|
try {
|
|
218
8
|
return JSON.parse(jsonString);
|
|
@@ -220,10 +10,10 @@ function safelyParseJSON(jsonString) {
|
|
|
220
10
|
return {};
|
|
221
11
|
}
|
|
222
12
|
}
|
|
223
|
-
var
|
|
13
|
+
var LibSQLStore = class extends MastraStorage {
|
|
224
14
|
client;
|
|
225
15
|
constructor({ config }) {
|
|
226
|
-
super({ name: `
|
|
16
|
+
super({ name: `LibSQLStore` });
|
|
227
17
|
this.client = createClient({
|
|
228
18
|
url: this.rewriteDbUrl(config.url),
|
|
229
19
|
authToken: config.authToken
|
|
@@ -411,7 +201,7 @@ var DefaultStorage = class extends MastraStorage {
|
|
|
411
201
|
let content = row.content;
|
|
412
202
|
try {
|
|
413
203
|
content = JSON.parse(row.content);
|
|
414
|
-
} catch
|
|
204
|
+
} catch {
|
|
415
205
|
}
|
|
416
206
|
return {
|
|
417
207
|
id: row.id,
|
|
@@ -623,4 +413,4 @@ var DefaultStorage = class extends MastraStorage {
|
|
|
623
413
|
}
|
|
624
414
|
};
|
|
625
415
|
|
|
626
|
-
export {
|
|
416
|
+
export { LibSQLStore };
|
package/dist/deployer/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MastraBundler, IBundler } from '../bundler/index.js';
|
|
2
|
-
import '../base-
|
|
2
|
+
import '../base-D90KQ4XI.js';
|
|
3
3
|
import '@opentelemetry/api';
|
|
4
|
-
import '../index-
|
|
5
|
-
import 'pino';
|
|
4
|
+
import '../index-mKY1XrpK.js';
|
|
6
5
|
import 'stream';
|
|
6
|
+
import 'pino';
|
|
7
7
|
import '@opentelemetry/sdk-trace-base';
|
|
8
8
|
|
|
9
9
|
interface IDeployer extends IBundler {
|
package/dist/deployer/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraDeployer } from '../chunk-
|
|
1
|
+
export { MastraDeployer } from '../chunk-4YRYBCOZ.js';
|
package/dist/eval/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as Metric, T as TestInfo, M as MetricResult } from '../types-m9RryK9a.js';
|
|
2
|
-
import { A as Agent } from '../base-
|
|
2
|
+
import { A as Agent } from '../base-hk-xmLC1.js';
|
|
3
3
|
import 'ai';
|
|
4
|
-
import '../base-
|
|
4
|
+
import '../base-D90KQ4XI.js';
|
|
5
5
|
import '@opentelemetry/api';
|
|
6
|
-
import '../index-
|
|
7
|
-
import 'pino';
|
|
6
|
+
import '../index-mKY1XrpK.js';
|
|
8
7
|
import 'stream';
|
|
8
|
+
import 'pino';
|
|
9
9
|
import '@opentelemetry/sdk-trace-base';
|
|
10
10
|
import 'sift';
|
|
11
11
|
import 'zod';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import pino from 'pino';
|
|
2
1
|
import { Transform } from 'stream';
|
|
2
|
+
import pino from 'pino';
|
|
3
3
|
|
|
4
4
|
type RunStatus = 'created' | 'running' | 'completed' | 'failed';
|
|
5
5
|
type Run = {
|
|
@@ -39,7 +39,7 @@ interface BaseLogMessage extends Run {
|
|
|
39
39
|
}
|
|
40
40
|
declare class LoggerTransport extends Transform {
|
|
41
41
|
constructor(opts?: any);
|
|
42
|
-
getLogsByRunId(
|
|
42
|
+
getLogsByRunId(_args: {
|
|
43
43
|
runId: string;
|
|
44
44
|
}): Promise<BaseLogMessage[]>;
|
|
45
45
|
getLogs(): Promise<BaseLogMessage[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { a as Metric } from './types-m9RryK9a.js';
|
|
2
2
|
export { M as MetricResult, T as TestInfo } from './types-m9RryK9a.js';
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
import { M as MastraBase$1 } from './base-
|
|
6
|
-
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-
|
|
7
|
-
import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-
|
|
8
|
-
export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-
|
|
3
|
+
import { m as ToolAction, A as Agent$1, n as AgentConfig, M as MastraStorage$1, a as MastraMemory$1, o as ToolExecutionContext, W as WorkflowOptions } from './base-hk-xmLC1.js';
|
|
4
|
+
export { Z as ActionContext, Y as BaseCondition, B as BaseStructuredOutputType, r as CoreAssistantMessage, C as CoreMessage, q as CoreSystemMessage, U as CoreTool, t as CoreToolMessage, s as CoreUserMessage, a6 as DependencyCheckOutput, v as EmbedManyResult, u as EmbedResult, E as EvalRow, ac as ExtractSchemaFromStep, af as ExtractSchemaType, ad as ExtractStepResult, G as GenerateReturn, J as LLMInnerStreamOptions, K as LLMStreamObjectOptions, H as LLMStreamOptions, F as LLMTextObjectOptions, D as LLMTextOptions, L as LanguageModel, P as MemoryConfig, N as MessageResponse, c as MessageType, O as OutputType, ag as PathsToStringProps, a3 as ResolverFunctionInput, a4 as ResolverFunctionOutput, R as RetryConfig, Q as SharedMemoryConfig, f as StepAction, $ as StepCondition, i as StepConfig, _ as StepDef, e as StepExecutionContext, l as StepGraph, ab as StepId, ae as StepInputType, V as StepNode, j as StepResult, h as StepVariableType, S as StorageColumn, d as StorageGetMessagesArg, b as StorageThreadType, z as StreamReturn, y as StructuredOutput, x as StructuredOutputArrayItem, w as StructuredOutputType, a5 as SubscriberFunctionOutput, X as VariableReference, a8 as WorkflowActionParams, a9 as WorkflowActions, a7 as WorkflowActors, a0 as WorkflowContext, a2 as WorkflowEvent, a1 as WorkflowLogMessage, p as WorkflowRow, k as WorkflowRunState, aa as WorkflowState } from './base-hk-xmLC1.js';
|
|
5
|
+
import { M as MastraBase$1 } from './base-D90KQ4XI.js';
|
|
6
|
+
export { O as OtelConfig, S as SamplingStrategy, T as Telemetry } from './base-D90KQ4XI.js';
|
|
7
|
+
import { R as RegisteredLogger, a as LogLevel, T as TransportMap, L as Logger } from './index-mKY1XrpK.js';
|
|
8
|
+
export { B as BaseLogMessage, b as LoggerTransport, M as MultiLogger, c as combineLoggers, n as noopLogger } from './index-mKY1XrpK.js';
|
|
9
9
|
import { MastraDeployer as MastraDeployer$1 } from './deployer/index.js';
|
|
10
|
-
import { MastraStorageLibSql as DefaultStorage, LibSQLConfig } from './storage/index.js';
|
|
11
10
|
export { evaluate } from './eval/index.js';
|
|
12
11
|
import { Integration as Integration$1, OpenAPIToolset as OpenAPIToolset$1 } from './integration/index.js';
|
|
13
12
|
export { Config, Mastra } from './mastra/index.js';
|
|
@@ -19,21 +18,20 @@ export { createTool } from './tools/index.js';
|
|
|
19
18
|
import { MastraTTS as MastraTTS$1, TTSConfig } from './tts/index.js';
|
|
20
19
|
export { TagMaskOptions, deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './utils.js';
|
|
21
20
|
import { MastraVector as MastraVector$1 } from './vector/index.js';
|
|
22
|
-
export { IndexStats, QueryResult
|
|
23
|
-
import { S as Step, W as Workflow$1 } from './workflow-
|
|
24
|
-
export { c as createStep } from './workflow-
|
|
21
|
+
export { IndexStats, QueryResult } from './vector/index.js';
|
|
22
|
+
import { S as Step, W as Workflow$1 } from './workflow-BxyFP9Wv.js';
|
|
23
|
+
export { c as createStep } from './workflow-BxyFP9Wv.js';
|
|
25
24
|
export { getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './workflows/index.js';
|
|
26
25
|
export { AvailableHooks, executeHook, registerHook } from './hooks/index.js';
|
|
27
26
|
export { ArrayOperator, BaseFilterTranslator, BasicOperator, ElementOperator, FieldCondition, Filter, LogicalOperator, NumericOperator, OperatorCondition, OperatorSupport, QueryOperator, RegexOperator } from './filter/index.js';
|
|
28
|
-
export { LibSQLVector as DefaultVectorDB, LibSQLVector } from './vector/libsql/index.js';
|
|
29
27
|
export { Message as AiMessageType } from 'ai';
|
|
30
28
|
import 'sift';
|
|
31
29
|
import 'json-schema';
|
|
32
30
|
import './voice/index.js';
|
|
33
31
|
import '@opentelemetry/api';
|
|
34
32
|
import '@opentelemetry/sdk-trace-base';
|
|
35
|
-
import 'pino';
|
|
36
33
|
import 'stream';
|
|
34
|
+
import 'pino';
|
|
37
35
|
import './bundler/index.js';
|
|
38
36
|
import 'xstate';
|
|
39
37
|
import '@opentelemetry/core';
|
|
@@ -63,12 +61,6 @@ declare abstract class MastraStorage extends MastraStorage$1 {
|
|
|
63
61
|
});
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
declare class MastraStorageLibSql extends DefaultStorage {
|
|
67
|
-
constructor(args: {
|
|
68
|
-
config: LibSQLConfig;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
64
|
declare class Integration<ToolsParams = void, ApiClient = void> extends Integration$1<ToolsParams, ApiClient> {
|
|
73
65
|
constructor();
|
|
74
66
|
}
|
|
@@ -103,4 +95,4 @@ declare class Workflow<TSteps extends Step<any, any, any>[] = any, TTriggerSchem
|
|
|
103
95
|
constructor(args: WorkflowOptions<TTriggerSchema>);
|
|
104
96
|
}
|
|
105
97
|
|
|
106
|
-
export { Agent,
|
|
98
|
+
export { Agent, Integration, LogLevel, Logger, MastraBase, MastraDeployer, MastraMemory, MastraStorage, MastraTTS, MastraVector, Metric, OpenAPIToolset, RegisteredLogger, Step, TTSConfig, Tool, ToolAction, ToolExecutionContext, TransportMap, Workflow, WorkflowOptions, createLogger };
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
import { MastraTTS } from './chunk-
|
|
2
|
-
import { Workflow } from './chunk-
|
|
3
|
-
export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-
|
|
1
|
+
import { MastraTTS } from './chunk-QAAJAHDB.js';
|
|
2
|
+
import { Workflow } from './chunk-XVS6QFTX.js';
|
|
3
|
+
export { Step, createStep, getStepResult, isErrorEvent, isTransitionEvent, isVariableReference } from './chunk-XVS6QFTX.js';
|
|
4
4
|
import { Integration, OpenAPIToolset } from './chunk-PNZK456O.js';
|
|
5
5
|
import { Tool } from './chunk-ZINPRHAN.js';
|
|
6
6
|
export { createTool } from './chunk-ZINPRHAN.js';
|
|
7
|
-
export { Mastra } from './chunk-
|
|
8
|
-
import { MastraMemory } from './chunk-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export { defaultEmbedder } from './chunk-7NPRQT5A.js';
|
|
15
|
-
import { Agent } from './chunk-ORM3OCHX.js';
|
|
16
|
-
export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from './chunk-4ZRHVG25.js';
|
|
7
|
+
export { Mastra } from './chunk-KM7PRKJ2.js';
|
|
8
|
+
import { MastraMemory } from './chunk-M626YCHO.js';
|
|
9
|
+
import { MastraVector } from './chunk-55NFNRKO.js';
|
|
10
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from './chunk-PL6URKH2.js';
|
|
11
|
+
import { MastraStorage } from './chunk-5XPCMNGW.js';
|
|
12
|
+
import { Agent } from './chunk-7TG2Y45H.js';
|
|
13
|
+
export { InstrumentClass, OTLPTraceExporter as OTLPStorageExporter, Telemetry, hasActiveTelemetry, withSpan } from './chunk-W5HVJX45.js';
|
|
17
14
|
export { deepMerge, delay, jsonSchemaPropertiesToTSTypes, jsonSchemaToModel, maskStreamTags } from './chunk-WIBGG4X6.js';
|
|
18
|
-
import { MastraDeployer } from './chunk-
|
|
19
|
-
import { MastraBase } from './chunk-
|
|
20
|
-
import { createLogger } from './chunk-
|
|
21
|
-
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-
|
|
15
|
+
import { MastraDeployer } from './chunk-4YRYBCOZ.js';
|
|
16
|
+
import { MastraBase } from './chunk-OZ4XVJ6F.js';
|
|
17
|
+
import { createLogger } from './chunk-PHMSPCTC.js';
|
|
18
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, noopLogger } from './chunk-PHMSPCTC.js';
|
|
22
19
|
export { Metric, evaluate } from './chunk-NUDAZEOG.js';
|
|
23
20
|
export { AvailableHooks, executeHook, registerHook } from './chunk-BB4KXGBU.js';
|
|
24
21
|
export { BaseFilterTranslator } from './chunk-SIFBBGY6.js';
|
|
@@ -57,14 +54,6 @@ var MastraStorage2 = class extends MastraStorage {
|
|
|
57
54
|
}
|
|
58
55
|
};
|
|
59
56
|
|
|
60
|
-
// src/storage/libsql.warning.ts
|
|
61
|
-
var MastraStorageLibSql = class extends DefaultStorage {
|
|
62
|
-
constructor(args) {
|
|
63
|
-
super(args);
|
|
64
|
-
this.logger.warn('Please import "MastraStorageLibSql" from "@mastra/core/storage" instead of "@mastra/core"');
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
57
|
// src/integration/integration.warning.ts
|
|
69
58
|
var Integration2 = class extends Integration {
|
|
70
59
|
constructor() {
|
|
@@ -127,4 +116,4 @@ var Workflow2 = class extends Workflow {
|
|
|
127
116
|
}
|
|
128
117
|
};
|
|
129
118
|
|
|
130
|
-
export { Agent2 as Agent, Integration2 as Integration, MastraBase2 as MastraBase, MastraDeployer2 as MastraDeployer, MastraMemory2 as MastraMemory, MastraStorage2 as MastraStorage,
|
|
119
|
+
export { Agent2 as Agent, Integration2 as Integration, MastraBase2 as MastraBase, MastraDeployer2 as MastraDeployer, MastraMemory2 as MastraMemory, MastraStorage2 as MastraStorage, MastraTTS2 as MastraTTS, MastraVector2 as MastraVector, OpenAPIToolset2 as OpenAPIToolset, Tool2 as Tool, Workflow2 as Workflow, createLogger2 as createLogger };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { W as Workflow } from '../workflow-
|
|
2
|
-
import '../base-
|
|
3
|
-
import {
|
|
1
|
+
import { W as Workflow } from '../workflow-BxyFP9Wv.js';
|
|
2
|
+
import '../base-D90KQ4XI.js';
|
|
3
|
+
import { m as ToolAction } from '../base-hk-xmLC1.js';
|
|
4
4
|
import 'xstate';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import '@opentelemetry/api';
|
|
7
|
-
import '../index-
|
|
8
|
-
import 'pino';
|
|
7
|
+
import '../index-mKY1XrpK.js';
|
|
9
8
|
import 'stream';
|
|
9
|
+
import 'pino';
|
|
10
10
|
import '@opentelemetry/sdk-trace-base';
|
|
11
11
|
import 'ai';
|
|
12
12
|
import '../types-m9RryK9a.js';
|
package/dist/llm/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import 'ai';
|
|
2
2
|
import 'json-schema';
|
|
3
3
|
import 'zod';
|
|
4
|
-
export { B as BaseStructuredOutputType,
|
|
5
|
-
import '../index-
|
|
6
|
-
import '../base-
|
|
4
|
+
export { B as BaseStructuredOutputType, r as CoreAssistantMessage, C as CoreMessage, q as CoreSystemMessage, t as CoreToolMessage, s as CoreUserMessage, v as EmbedManyResult, u as EmbedResult, G as GenerateReturn, J as LLMInnerStreamOptions, K as LLMStreamObjectOptions, H as LLMStreamOptions, F as LLMTextObjectOptions, D as LLMTextOptions, L as LanguageModel, O as OutputType, z as StreamReturn, y as StructuredOutput, x as StructuredOutputArrayItem, w as StructuredOutputType } from '../base-hk-xmLC1.js';
|
|
5
|
+
import '../index-mKY1XrpK.js';
|
|
6
|
+
import '../base-D90KQ4XI.js';
|
|
7
7
|
import '@opentelemetry/api';
|
|
8
8
|
import '@opentelemetry/sdk-trace-base';
|
|
9
9
|
import '../types-m9RryK9a.js';
|
|
10
10
|
import 'sift';
|
|
11
11
|
import '../vector/index.js';
|
|
12
|
-
import 'pino';
|
|
13
12
|
import 'stream';
|
|
13
|
+
import 'pino';
|
|
14
14
|
import '../voice/index.js';
|
|
15
15
|
import '../tts/index.js';
|
package/dist/logger/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import 'pino';
|
|
2
1
|
import 'stream';
|
|
3
|
-
|
|
2
|
+
import 'pino';
|
|
3
|
+
export { B as BaseLogMessage, a as LogLevel, L as Logger, b as LoggerTransport, M as MultiLogger, R as RegisteredLogger, T as TransportMap, c as combineLoggers, e as createLogger, n as noopLogger } from '../index-mKY1XrpK.js';
|
package/dist/logger/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-
|
|
1
|
+
export { LogLevel, Logger, LoggerTransport, MultiLogger, RegisteredLogger, combineLoggers, createLogger, noopLogger } from '../chunk-PHMSPCTC.js';
|
package/dist/mastra/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-
|
|
2
|
-
import { L as Logger, B as BaseLogMessage } from '../index-
|
|
3
|
-
import { W as Workflow } from '../workflow-
|
|
1
|
+
import { A as Agent, M as MastraStorage, a as MastraMemory } from '../base-hk-xmLC1.js';
|
|
2
|
+
import { L as Logger, B as BaseLogMessage } from '../index-mKY1XrpK.js';
|
|
3
|
+
import { W as Workflow } from '../workflow-BxyFP9Wv.js';
|
|
4
4
|
import { MastraVector } from '../vector/index.js';
|
|
5
|
-
import { O as OtelConfig, T as Telemetry } from '../base-
|
|
5
|
+
import { O as OtelConfig, T as Telemetry } from '../base-D90KQ4XI.js';
|
|
6
6
|
import { MastraTTS } from '../tts/index.js';
|
|
7
7
|
import { MastraDeployer } from '../deployer/index.js';
|
|
8
8
|
import 'ai';
|
|
@@ -11,8 +11,8 @@ import 'sift';
|
|
|
11
11
|
import 'zod';
|
|
12
12
|
import 'json-schema';
|
|
13
13
|
import '../voice/index.js';
|
|
14
|
-
import 'pino';
|
|
15
14
|
import 'stream';
|
|
15
|
+
import 'pino';
|
|
16
16
|
import 'xstate';
|
|
17
17
|
import '@opentelemetry/api';
|
|
18
18
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/mastra/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Mastra } from '../chunk-
|
|
1
|
+
export { Mastra } from '../chunk-KM7PRKJ2.js';
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { a as MastraMemory,
|
|
1
|
+
export { a as MastraMemory, P as MemoryConfig, N as MessageResponse, c as MessageType, Q as SharedMemoryConfig, b as StorageThreadType } from '../base-hk-xmLC1.js';
|
|
2
2
|
export { Message as AiMessageType } from 'ai';
|
|
3
|
-
import '../base-
|
|
3
|
+
import '../base-D90KQ4XI.js';
|
|
4
4
|
import '@opentelemetry/api';
|
|
5
|
-
import '../index-
|
|
6
|
-
import 'pino';
|
|
5
|
+
import '../index-mKY1XrpK.js';
|
|
7
6
|
import 'stream';
|
|
7
|
+
import 'pino';
|
|
8
8
|
import '@opentelemetry/sdk-trace-base';
|
|
9
9
|
import '../types-m9RryK9a.js';
|
|
10
10
|
import 'sift';
|
package/dist/memory/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MastraMemory } from '../chunk-
|
|
1
|
+
export { MastraMemory } from '../chunk-M626YCHO.js';
|
package/dist/relevance/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-
|
|
1
|
+
export { CohereRelevanceScorer, MastraAgentRelevanceScorer, createSimilarityPrompt } from '../chunk-PL6URKH2.js';
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,84 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export { ai as TABLE_EVALS, aj as TABLE_MESSAGES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, l as WorkflowRow } from '../base-BdNHFjqH.js';
|
|
3
|
-
import '../base-eWkcLLSb.js';
|
|
4
|
-
export { LibSQLVector as DefaultVectorDB, LibSQLVector } from '../vector/libsql/index.js';
|
|
1
|
+
export { E as EvalRow, M as MastraStorage, S as StorageColumn, d as StorageGetMessagesArg, ai as TABLE_EVALS, aj as TABLE_MESSAGES, T as TABLE_NAMES, ak as TABLE_THREADS, al as TABLE_TRACES, ah as TABLE_WORKFLOW_SNAPSHOT, p as WorkflowRow } from '../base-hk-xmLC1.js';
|
|
5
2
|
import 'ai';
|
|
3
|
+
import '../base-D90KQ4XI.js';
|
|
4
|
+
import '@opentelemetry/api';
|
|
5
|
+
import '../index-mKY1XrpK.js';
|
|
6
|
+
import 'stream';
|
|
7
|
+
import 'pino';
|
|
8
|
+
import '@opentelemetry/sdk-trace-base';
|
|
6
9
|
import '../types-m9RryK9a.js';
|
|
7
10
|
import 'sift';
|
|
8
11
|
import 'zod';
|
|
9
12
|
import 'json-schema';
|
|
10
13
|
import '../vector/index.js';
|
|
11
|
-
import '@opentelemetry/api';
|
|
12
|
-
import '../index-C5uPdbs4.js';
|
|
13
|
-
import 'pino';
|
|
14
|
-
import 'stream';
|
|
15
|
-
import '@opentelemetry/sdk-trace-base';
|
|
16
14
|
import '../voice/index.js';
|
|
17
15
|
import '../tts/index.js';
|
|
18
|
-
import '../filter/index.js';
|
|
19
|
-
|
|
20
|
-
interface LibSQLConfig {
|
|
21
|
-
url: string;
|
|
22
|
-
authToken?: string;
|
|
23
|
-
}
|
|
24
|
-
declare class DefaultStorage extends MastraStorage {
|
|
25
|
-
private client;
|
|
26
|
-
constructor({ config }: {
|
|
27
|
-
config: LibSQLConfig;
|
|
28
|
-
});
|
|
29
|
-
protected rewriteDbUrl(url: string): string;
|
|
30
|
-
private getCreateTableSQL;
|
|
31
|
-
createTable({ tableName, schema, }: {
|
|
32
|
-
tableName: TABLE_NAMES;
|
|
33
|
-
schema: Record<string, StorageColumn>;
|
|
34
|
-
}): Promise<void>;
|
|
35
|
-
clearTable({ tableName }: {
|
|
36
|
-
tableName: TABLE_NAMES;
|
|
37
|
-
}): Promise<void>;
|
|
38
|
-
private prepareStatement;
|
|
39
|
-
insert({ tableName, record }: {
|
|
40
|
-
tableName: TABLE_NAMES;
|
|
41
|
-
record: Record<string, any>;
|
|
42
|
-
}): Promise<void>;
|
|
43
|
-
batchInsert({ tableName, records }: {
|
|
44
|
-
tableName: TABLE_NAMES;
|
|
45
|
-
records: Record<string, any>[];
|
|
46
|
-
}): Promise<void>;
|
|
47
|
-
load<R>({ tableName, keys }: {
|
|
48
|
-
tableName: TABLE_NAMES;
|
|
49
|
-
keys: Record<string, string>;
|
|
50
|
-
}): Promise<R | null>;
|
|
51
|
-
getThreadById({ threadId }: {
|
|
52
|
-
threadId: string;
|
|
53
|
-
}): Promise<StorageThreadType | null>;
|
|
54
|
-
getThreadsByResourceId({ resourceId }: {
|
|
55
|
-
resourceId: string;
|
|
56
|
-
}): Promise<StorageThreadType[]>;
|
|
57
|
-
saveThread({ thread }: {
|
|
58
|
-
thread: StorageThreadType;
|
|
59
|
-
}): Promise<StorageThreadType>;
|
|
60
|
-
updateThread({ id, title, metadata, }: {
|
|
61
|
-
id: string;
|
|
62
|
-
title: string;
|
|
63
|
-
metadata: Record<string, unknown>;
|
|
64
|
-
}): Promise<StorageThreadType>;
|
|
65
|
-
deleteThread({ threadId }: {
|
|
66
|
-
threadId: string;
|
|
67
|
-
}): Promise<void>;
|
|
68
|
-
private parseRow;
|
|
69
|
-
getMessages<T extends MessageType[]>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
|
|
70
|
-
saveMessages({ messages }: {
|
|
71
|
-
messages: MessageType[];
|
|
72
|
-
}): Promise<MessageType[]>;
|
|
73
|
-
private transformEvalRow;
|
|
74
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
75
|
-
getTraces({ name, scope, page, perPage, attributes, }?: {
|
|
76
|
-
name?: string;
|
|
77
|
-
scope?: string;
|
|
78
|
-
page: number;
|
|
79
|
-
perPage: number;
|
|
80
|
-
attributes?: Record<string, string>;
|
|
81
|
-
}): Promise<any[]>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { DefaultStorage, EvalRow, type LibSQLConfig, MastraStorage, DefaultStorage as MastraStorageLibSql, StorageColumn, StorageGetMessagesArg, TABLE_NAMES };
|
package/dist/storage/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { DefaultVectorDB, DefaultVectorDB as LibSQLVector } from '../chunk-LKOVXFLE.js';
|
|
1
|
+
export { MastraStorage } from '../chunk-5XPCMNGW.js';
|
|
3
2
|
export { TABLE_EVALS, TABLE_MESSAGES, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT } from '../chunk-RG66XEJT.js';
|