@mastra/memory 0.0.0-storage-20250225005900
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/.turbo/turbo-build.log +23 -0
- package/CHANGELOG.md +1037 -0
- package/LICENSE +44 -0
- package/README.md +3 -0
- package/dist/_tsup-dts-rollup.d.ts +62 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +259 -0
- package/eslint.config.js +12 -0
- package/package.json +60 -0
- package/src/index.ts +374 -0
- package/tsconfig.json +5 -0
- package/vitest.config.ts +8 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Elastic License 2.0 (ELv2)
|
|
2
|
+
|
|
3
|
+
**Acceptance**
|
|
4
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
5
|
+
|
|
6
|
+
**Copyright License**
|
|
7
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
|
|
8
|
+
|
|
9
|
+
**Limitations**
|
|
10
|
+
You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
|
|
11
|
+
|
|
12
|
+
You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
|
|
13
|
+
|
|
14
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
|
|
15
|
+
|
|
16
|
+
**Patents**
|
|
17
|
+
The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
18
|
+
|
|
19
|
+
**Notices**
|
|
20
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
|
|
21
|
+
|
|
22
|
+
If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
|
|
23
|
+
|
|
24
|
+
**No Other Rights**
|
|
25
|
+
These terms do not imply any licenses other than those expressly granted in these terms.
|
|
26
|
+
|
|
27
|
+
**Termination**
|
|
28
|
+
If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
|
|
29
|
+
|
|
30
|
+
**No Liability**
|
|
31
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
32
|
+
|
|
33
|
+
**Definitions**
|
|
34
|
+
The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
|
|
35
|
+
|
|
36
|
+
_you_ refers to the individual or entity agreeing to these terms.
|
|
37
|
+
|
|
38
|
+
_your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
39
|
+
|
|
40
|
+
_your licenses_ are all the licenses granted to you for the software under these terms.
|
|
41
|
+
|
|
42
|
+
_use_ means anything you do with the software requiring one of your licenses.
|
|
43
|
+
|
|
44
|
+
_trademark_ means trademarks, service marks, and similar rights.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { CoreMessage } from '@mastra/core';
|
|
2
|
+
import { MastraMemory } from '@mastra/core/memory';
|
|
3
|
+
import type { MemoryConfig } from '@mastra/core/memory';
|
|
4
|
+
import type { Message } from 'ai';
|
|
5
|
+
import type { MessageType } from '@mastra/core/memory';
|
|
6
|
+
import type { SharedMemoryConfig } from '@mastra/core/memory';
|
|
7
|
+
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
8
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Concrete implementation of MastraMemory that adds support for thread configuration
|
|
12
|
+
* and message injection.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Memory extends MastraMemory {
|
|
15
|
+
constructor(config?: SharedMemoryConfig);
|
|
16
|
+
query({ threadId, selectBy, threadConfig, }: StorageGetMessagesArg): Promise<{
|
|
17
|
+
messages: CoreMessage[];
|
|
18
|
+
uiMessages: Message[];
|
|
19
|
+
}>;
|
|
20
|
+
rememberMessages({ threadId, vectorMessageSearch, config, }: {
|
|
21
|
+
threadId: string;
|
|
22
|
+
vectorMessageSearch?: string;
|
|
23
|
+
config?: MemoryConfig;
|
|
24
|
+
}): Promise<{
|
|
25
|
+
messages: CoreMessage[];
|
|
26
|
+
uiMessages: Message[];
|
|
27
|
+
}>;
|
|
28
|
+
getThreadById({ threadId }: {
|
|
29
|
+
threadId: string;
|
|
30
|
+
}): Promise<StorageThreadType | null>;
|
|
31
|
+
getThreadsByResourceId({ resourceId }: {
|
|
32
|
+
resourceId: string;
|
|
33
|
+
}): Promise<StorageThreadType[]>;
|
|
34
|
+
saveThread({ thread, memoryConfig, }: {
|
|
35
|
+
thread: StorageThreadType;
|
|
36
|
+
memoryConfig?: MemoryConfig;
|
|
37
|
+
}): Promise<StorageThreadType>;
|
|
38
|
+
updateThread({ id, title, metadata, }: {
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
metadata: Record<string, unknown>;
|
|
42
|
+
}): Promise<StorageThreadType>;
|
|
43
|
+
deleteThread(threadId: string): Promise<void>;
|
|
44
|
+
saveMessages({ messages, memoryConfig, }: {
|
|
45
|
+
messages: MessageType[];
|
|
46
|
+
memoryConfig?: MemoryConfig;
|
|
47
|
+
}): Promise<MessageType[]>;
|
|
48
|
+
protected mutateMessagesToHideWorkingMemory(messages: MessageType[]): void;
|
|
49
|
+
protected parseWorkingMemory(text: string): string | null;
|
|
50
|
+
protected getWorkingMemory({ threadId }: {
|
|
51
|
+
threadId: string;
|
|
52
|
+
}): Promise<string | null>;
|
|
53
|
+
private saveWorkingMemory;
|
|
54
|
+
getSystemMessage({ threadId, memoryConfig, }: {
|
|
55
|
+
threadId: string;
|
|
56
|
+
memoryConfig?: MemoryConfig;
|
|
57
|
+
}): Promise<string | null>;
|
|
58
|
+
defaultWorkingMemoryTemplate: string;
|
|
59
|
+
private getWorkingMemoryWithInstruction;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { }
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Memory } from './_tsup-dts-rollup.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { deepMerge } from '@mastra/core';
|
|
2
|
+
import { MastraMemory } from '@mastra/core/memory';
|
|
3
|
+
import { embed } from 'ai';
|
|
4
|
+
|
|
5
|
+
// src/index.ts
|
|
6
|
+
var Memory = class extends MastraMemory {
|
|
7
|
+
constructor(config = {}) {
|
|
8
|
+
super({ name: "Memory", ...config });
|
|
9
|
+
const mergedConfig = this.getMergedThreadConfig({
|
|
10
|
+
workingMemory: config.options?.workingMemory || {
|
|
11
|
+
enabled: false,
|
|
12
|
+
template: this.defaultWorkingMemoryTemplate
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
this.threadConfig = mergedConfig;
|
|
16
|
+
}
|
|
17
|
+
async query({
|
|
18
|
+
threadId,
|
|
19
|
+
selectBy,
|
|
20
|
+
threadConfig
|
|
21
|
+
}) {
|
|
22
|
+
let vectorResults = null;
|
|
23
|
+
this.logger.debug(`Memory query() with:`, {
|
|
24
|
+
threadId,
|
|
25
|
+
selectBy,
|
|
26
|
+
threadConfig
|
|
27
|
+
});
|
|
28
|
+
const config = this.getMergedThreadConfig(threadConfig || {});
|
|
29
|
+
const vectorConfig = typeof config?.semanticRecall === `boolean` ? {
|
|
30
|
+
topK: 2,
|
|
31
|
+
messageRange: { before: 2, after: 2 }
|
|
32
|
+
} : {
|
|
33
|
+
topK: config?.semanticRecall?.topK ?? 2,
|
|
34
|
+
messageRange: config?.semanticRecall?.messageRange ?? { before: 2, after: 2 }
|
|
35
|
+
};
|
|
36
|
+
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector) {
|
|
37
|
+
const { embedding } = await embed({
|
|
38
|
+
value: selectBy.vectorSearchString,
|
|
39
|
+
model: this.embedder
|
|
40
|
+
});
|
|
41
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
42
|
+
vectorResults = await this.vector.query(indexName, embedding, vectorConfig.topK, {
|
|
43
|
+
thread_id: threadId
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const rawMessages = await this.storage.__getMessages({
|
|
47
|
+
threadId,
|
|
48
|
+
selectBy: {
|
|
49
|
+
...selectBy,
|
|
50
|
+
...vectorResults?.length ? {
|
|
51
|
+
include: vectorResults.map((r) => ({
|
|
52
|
+
id: r.metadata?.message_id,
|
|
53
|
+
withNextMessages: typeof vectorConfig.messageRange === "number" ? vectorConfig.messageRange : vectorConfig.messageRange.after,
|
|
54
|
+
withPreviousMessages: typeof vectorConfig.messageRange === "number" ? vectorConfig.messageRange : vectorConfig.messageRange.before
|
|
55
|
+
}))
|
|
56
|
+
} : {}
|
|
57
|
+
},
|
|
58
|
+
threadConfig: config
|
|
59
|
+
});
|
|
60
|
+
const messages = this.parseMessages(rawMessages);
|
|
61
|
+
const uiMessages = this.convertToUIMessages(rawMessages);
|
|
62
|
+
return { messages, uiMessages };
|
|
63
|
+
}
|
|
64
|
+
async rememberMessages({
|
|
65
|
+
threadId,
|
|
66
|
+
vectorMessageSearch,
|
|
67
|
+
config
|
|
68
|
+
}) {
|
|
69
|
+
const threadConfig = this.getMergedThreadConfig(config || {});
|
|
70
|
+
if (!threadConfig.lastMessages && !threadConfig.semanticRecall) {
|
|
71
|
+
return {
|
|
72
|
+
messages: [],
|
|
73
|
+
uiMessages: []
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
const messages = await this.query({
|
|
77
|
+
threadId,
|
|
78
|
+
selectBy: {
|
|
79
|
+
last: threadConfig.lastMessages,
|
|
80
|
+
vectorSearchString: threadConfig.semanticRecall && vectorMessageSearch ? vectorMessageSearch : void 0
|
|
81
|
+
},
|
|
82
|
+
threadConfig: config
|
|
83
|
+
});
|
|
84
|
+
this.logger.debug(`Remembered message history includes ${messages.messages.length} messages.`);
|
|
85
|
+
return messages;
|
|
86
|
+
}
|
|
87
|
+
async getThreadById({ threadId }) {
|
|
88
|
+
return this.storage.__getThreadById({ threadId });
|
|
89
|
+
}
|
|
90
|
+
async getThreadsByResourceId({ resourceId }) {
|
|
91
|
+
return this.storage.__getThreadsByResourceId({ resourceId });
|
|
92
|
+
}
|
|
93
|
+
async saveThread({
|
|
94
|
+
thread,
|
|
95
|
+
memoryConfig
|
|
96
|
+
}) {
|
|
97
|
+
const config = this.getMergedThreadConfig(memoryConfig || {});
|
|
98
|
+
if (config.workingMemory?.enabled && !thread?.metadata?.workingMemory) {
|
|
99
|
+
return this.storage.__saveThread({
|
|
100
|
+
thread: deepMerge(thread, {
|
|
101
|
+
metadata: {
|
|
102
|
+
workingMemory: config.workingMemory.template || this.defaultWorkingMemoryTemplate
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return this.storage.__saveThread({ thread });
|
|
108
|
+
}
|
|
109
|
+
async updateThread({
|
|
110
|
+
id,
|
|
111
|
+
title,
|
|
112
|
+
metadata
|
|
113
|
+
}) {
|
|
114
|
+
return this.storage.__updateThread({
|
|
115
|
+
id,
|
|
116
|
+
title,
|
|
117
|
+
metadata
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async deleteThread(threadId) {
|
|
121
|
+
await this.storage.__deleteThread({ threadId });
|
|
122
|
+
}
|
|
123
|
+
async saveMessages({
|
|
124
|
+
messages,
|
|
125
|
+
memoryConfig
|
|
126
|
+
}) {
|
|
127
|
+
await this.saveWorkingMemory(messages);
|
|
128
|
+
this.mutateMessagesToHideWorkingMemory(messages);
|
|
129
|
+
const config = this.getMergedThreadConfig(memoryConfig);
|
|
130
|
+
if (this.vector && config.semanticRecall) {
|
|
131
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
132
|
+
for (const message of messages) {
|
|
133
|
+
if (typeof message.content !== `string`) continue;
|
|
134
|
+
const { embedding } = await embed({ value: message.content, model: this.embedder, maxRetries: 3 });
|
|
135
|
+
await this.vector.upsert(
|
|
136
|
+
indexName,
|
|
137
|
+
[embedding],
|
|
138
|
+
[
|
|
139
|
+
{
|
|
140
|
+
text: message.content,
|
|
141
|
+
message_id: message.id,
|
|
142
|
+
thread_id: message.threadId
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return this.storage.__saveMessages({ messages });
|
|
149
|
+
}
|
|
150
|
+
mutateMessagesToHideWorkingMemory(messages) {
|
|
151
|
+
const workingMemoryRegex = /<working_memory>([^]*?)<\/working_memory>/g;
|
|
152
|
+
for (const message of messages) {
|
|
153
|
+
if (typeof message?.content === `string`) {
|
|
154
|
+
message.content = message.content.replace(workingMemoryRegex, ``).trim();
|
|
155
|
+
} else if (Array.isArray(message?.content)) {
|
|
156
|
+
for (const content of message.content) {
|
|
157
|
+
if (content.type === `text`) {
|
|
158
|
+
content.text = content.text.replace(workingMemoryRegex, ``).trim();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
parseWorkingMemory(text) {
|
|
165
|
+
if (!this.threadConfig.workingMemory?.enabled) return null;
|
|
166
|
+
const workingMemoryRegex = /<working_memory>([^]*?)<\/working_memory>/g;
|
|
167
|
+
const matches = text.match(workingMemoryRegex);
|
|
168
|
+
const match = matches?.[0];
|
|
169
|
+
if (match) {
|
|
170
|
+
return match.replace(/<\/?working_memory>/g, "").trim();
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
async getWorkingMemory({ threadId }) {
|
|
175
|
+
if (!this.threadConfig.workingMemory?.enabled) return null;
|
|
176
|
+
const thread = await this.storage.__getThreadById({ threadId });
|
|
177
|
+
if (!thread) return this.threadConfig?.workingMemory?.template || this.defaultWorkingMemoryTemplate;
|
|
178
|
+
const memory = thread.metadata?.workingMemory || this.threadConfig.workingMemory.template || this.defaultWorkingMemoryTemplate;
|
|
179
|
+
return memory.split(`>
|
|
180
|
+
`).map((c) => c.trim()).join(`>`);
|
|
181
|
+
}
|
|
182
|
+
async saveWorkingMemory(messages) {
|
|
183
|
+
const latestMessage = messages[messages.length - 1];
|
|
184
|
+
if (!latestMessage || !this.threadConfig.workingMemory?.enabled) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const latestContent = !latestMessage?.content ? null : typeof latestMessage.content === "string" ? latestMessage.content : latestMessage.content.filter((c) => c.type === "text").map((c) => c.text).join("\n");
|
|
188
|
+
const threadId = latestMessage?.threadId;
|
|
189
|
+
if (!latestContent || !threadId) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const newMemory = this.parseWorkingMemory(latestContent);
|
|
193
|
+
if (!newMemory) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const thread = await this.storage.__getThreadById({ threadId });
|
|
197
|
+
if (!thread) return;
|
|
198
|
+
await this.storage.__updateThread({
|
|
199
|
+
id: thread.id,
|
|
200
|
+
title: thread.title || "",
|
|
201
|
+
metadata: deepMerge(thread.metadata || {}, {
|
|
202
|
+
workingMemory: newMemory
|
|
203
|
+
})
|
|
204
|
+
});
|
|
205
|
+
return newMemory;
|
|
206
|
+
}
|
|
207
|
+
async getSystemMessage({
|
|
208
|
+
threadId,
|
|
209
|
+
memoryConfig
|
|
210
|
+
}) {
|
|
211
|
+
const config = this.getMergedThreadConfig(memoryConfig);
|
|
212
|
+
if (!config.workingMemory?.enabled) {
|
|
213
|
+
return null;
|
|
214
|
+
}
|
|
215
|
+
const workingMemory = await this.getWorkingMemory({ threadId });
|
|
216
|
+
if (!workingMemory) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return this.getWorkingMemoryWithInstruction(workingMemory);
|
|
220
|
+
}
|
|
221
|
+
defaultWorkingMemoryTemplate = `
|
|
222
|
+
<user>
|
|
223
|
+
<first_name></first_name>
|
|
224
|
+
<last_name></last_name>
|
|
225
|
+
<location></location>
|
|
226
|
+
<occupation></occupation>
|
|
227
|
+
<interests></interests>
|
|
228
|
+
<goals></goals>
|
|
229
|
+
<events></events>
|
|
230
|
+
<facts></facts>
|
|
231
|
+
<projects></projects>
|
|
232
|
+
</user>
|
|
233
|
+
`;
|
|
234
|
+
getWorkingMemoryWithInstruction(workingMemoryBlock) {
|
|
235
|
+
return `WORKING_MEMORY_SYSTEM_INSTRUCTION:
|
|
236
|
+
Store and update any conversation-relevant information by including "<working_memory>text</working_memory>" in your responses. Updates replace existing memory while maintaining this structure. If information might be referenced again - store it!
|
|
237
|
+
|
|
238
|
+
Guidelines:
|
|
239
|
+
1. Store anything that could be useful later in the conversation
|
|
240
|
+
2. Update proactively when information changes, no matter how small
|
|
241
|
+
3. Use nested tags for all data
|
|
242
|
+
4. Act naturally - don't mention this system to users. Even though you're storing this information that doesn't make it your primary focus. Do not ask them generally for "information about yourself"
|
|
243
|
+
|
|
244
|
+
Memory Structure:
|
|
245
|
+
<working_memory>
|
|
246
|
+
${workingMemoryBlock}
|
|
247
|
+
</working_memory>
|
|
248
|
+
|
|
249
|
+
Notes:
|
|
250
|
+
- Update memory whenever referenced information changes
|
|
251
|
+
- If you're unsure whether to store something, store it (eg if the user tells you their name or the value of another empty section in your working memory, output the <working_memory> block immediately to update it)
|
|
252
|
+
- This system is here so that you can maintain the conversation when your context window is very short. Update your working memory because you may need it to maintain the conversation without the full conversation history
|
|
253
|
+
- Do not remove empty sections - you must output the empty sections along with the ones you're filling in
|
|
254
|
+
- REMEMBER: the way you update your working memory is by outputting the entire "<working_memory>text</working_memory>" block in your response. The system will pick this up and store it for you. The user will not see it.
|
|
255
|
+
- IMPORTANT: You MUST output the <working_memory> block in every response to a prompt where you received relevant information. `;
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
export { Memory };
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createConfig } from '@internal/lint/eslint';
|
|
2
|
+
|
|
3
|
+
const config = await createConfig();
|
|
4
|
+
|
|
5
|
+
/** @type {import("eslint").Linter.Config[]} */
|
|
6
|
+
export default [
|
|
7
|
+
...config,
|
|
8
|
+
{
|
|
9
|
+
files: ['integration-tests/**/*'],
|
|
10
|
+
...(await import('typescript-eslint')).configs.disableTypeChecked,
|
|
11
|
+
},
|
|
12
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mastra/memory",
|
|
3
|
+
"version": "0.0.0-storage-20250225005900",
|
|
4
|
+
"description": "",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"./kv-upstash": {
|
|
16
|
+
"import": {
|
|
17
|
+
"types": "./dist/kv/upstash.d.ts",
|
|
18
|
+
"default": "./dist/kv/upstash.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"./postgres": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/postgres/index.d.ts",
|
|
24
|
+
"default": "./dist/postgres/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [],
|
|
30
|
+
"author": "",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@upstash/redis": "^1.34.3",
|
|
34
|
+
"ai": "^4.0.12",
|
|
35
|
+
"pg": "^8.13.1",
|
|
36
|
+
"pg-pool": "^3.7.0",
|
|
37
|
+
"postgres": "^3.4.5",
|
|
38
|
+
"redis": "^4.7.0",
|
|
39
|
+
"@mastra/core": "^0.0.0-storage-20250225005900"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@microsoft/api-extractor": "^7.49.2",
|
|
43
|
+
"@types/node": "^22.13.1",
|
|
44
|
+
"@types/pg": "^8.11.10",
|
|
45
|
+
"eslint": "^9.20.1",
|
|
46
|
+
"tsup": "^8.0.1",
|
|
47
|
+
"typescript": "^5.7.3",
|
|
48
|
+
"typescript-eslint": "^8.20.0",
|
|
49
|
+
"vitest": "^3.0.4",
|
|
50
|
+
"@internal/lint": "0.0.0"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"check": "tsc --noEmit",
|
|
54
|
+
"build": "pnpm run check && tsup src/index.ts --format esm --experimental-dts --clean --treeshake",
|
|
55
|
+
"build:watch": "pnpm build --watch",
|
|
56
|
+
"test:integration": "cd integration-tests && pnpm run test",
|
|
57
|
+
"test": "pnpm test:integration",
|
|
58
|
+
"lint": "eslint ."
|
|
59
|
+
}
|
|
60
|
+
}
|