@mastra/mongodb 0.11.0-alpha.1 → 0.11.1-alpha.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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +45 -0
- package/dist/_tsup-dts-rollup.d.cts +10 -0
- package/dist/_tsup-dts-rollup.d.ts +10 -0
- package/dist/index.cjs +4 -0
- package/dist/index.js +4 -0
- package/docker-compose.yaml +1 -1
- package/package.json +4 -4
- package/src/storage/index.ts +12 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/mongodb@0.11.
|
|
2
|
+
> @mastra/mongodb@0.11.1-alpha.0 build /home/runner/work/mastra/mastra/stores/mongodb
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 8959ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/mongodb/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/mongodb/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 12741ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m34.
|
|
21
|
-
[32mCJS[39m ⚡️ Build success in
|
|
22
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
23
|
-
[32mESM[39m ⚡️ Build success in
|
|
20
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m34.22 KB[39m
|
|
21
|
+
[32mCJS[39m ⚡️ Build success in 1124ms
|
|
22
|
+
[32mESM[39m [1mdist/index.js [22m[32m34.09 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 1126ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @mastra/mongodb
|
|
2
2
|
|
|
3
|
+
## 0.11.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
|
|
8
|
+
- Updated dependencies [d8f2d19]
|
|
9
|
+
- Updated dependencies [9d52b17]
|
|
10
|
+
- Updated dependencies [8ba1b51]
|
|
11
|
+
- @mastra/core@0.10.7-alpha.0
|
|
12
|
+
|
|
13
|
+
## 0.11.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 704d1ca: Thread Timestamp Auto-Update Enhancement
|
|
18
|
+
Added automatic thread updatedAt timestamp updates when messages are saved across all storage providers
|
|
19
|
+
Enhanced user experience: Threads now accurately reflect their latest activity with automatic timestamp updates when new messages are added
|
|
20
|
+
Universal implementation: Consistent behavior across all 7 storage backends (ClickHouse, Cloudflare D1, DynamoDB, MongoDB, PostgreSQL, Upstash, LibSQL)
|
|
21
|
+
Performance optimized: Updates execute in parallel with message saving operations for minimal performance impact
|
|
22
|
+
Backwards compatible: No breaking changes - existing code continues to work unchanged
|
|
23
|
+
Improved conversation ordering: Chat interfaces can now properly sort threads by actual last activity
|
|
24
|
+
This enhancement resolves the issue where active conversations appeared stale due to outdated thread timestamps, providing better conversation management and user experience in chat applications.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- 63f6b7d: dependencies updates:
|
|
29
|
+
- Updated dependency [`cloudflare@^4.3.0` ↗︎](https://www.npmjs.com/package/cloudflare/v/4.3.0) (from `^4.1.0`, in `dependencies`)
|
|
30
|
+
- Updated dependency [`mongodb@^6.17.0` ↗︎](https://www.npmjs.com/package/mongodb/v/6.17.0) (from `^6.15.0`, in `dependencies`)
|
|
31
|
+
- Updated dependencies [63f6b7d]
|
|
32
|
+
- Updated dependencies [12a95fc]
|
|
33
|
+
- Updated dependencies [4b0f8a6]
|
|
34
|
+
- Updated dependencies [51264a5]
|
|
35
|
+
- Updated dependencies [8e6f677]
|
|
36
|
+
- Updated dependencies [d70c420]
|
|
37
|
+
- Updated dependencies [ee9af57]
|
|
38
|
+
- Updated dependencies [36f1c36]
|
|
39
|
+
- Updated dependencies [2a16996]
|
|
40
|
+
- Updated dependencies [10d352e]
|
|
41
|
+
- Updated dependencies [9589624]
|
|
42
|
+
- Updated dependencies [53d3c37]
|
|
43
|
+
- Updated dependencies [751c894]
|
|
44
|
+
- Updated dependencies [577ce3a]
|
|
45
|
+
- Updated dependencies [9260b3a]
|
|
46
|
+
- @mastra/core@0.10.6
|
|
47
|
+
|
|
3
48
|
## 0.11.0-alpha.1
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
|
@@ -5,6 +5,7 @@ import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
|
5
5
|
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
6
6
|
import type { EvalRow } from '@mastra/core/storage';
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
|
+
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
8
9
|
import type { MastraMessageV1 } from '@mastra/core/memory';
|
|
9
10
|
import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
10
11
|
import { MastraStorage } from '@mastra/core/storage';
|
|
@@ -187,6 +188,15 @@ declare class MongoDBStore extends MastraStorage {
|
|
|
187
188
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
188
189
|
}>;
|
|
189
190
|
close(): Promise<void>;
|
|
191
|
+
updateMessages(_args: {
|
|
192
|
+
messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
193
|
+
id: string;
|
|
194
|
+
content?: {
|
|
195
|
+
metadata?: MastraMessageContentV2['metadata'];
|
|
196
|
+
content?: MastraMessageContentV2['content'];
|
|
197
|
+
};
|
|
198
|
+
}[];
|
|
199
|
+
}): Promise<MastraMessageV2[]>;
|
|
190
200
|
}
|
|
191
201
|
export { MongoDBStore }
|
|
192
202
|
export { MongoDBStore as MongoDBStore_alias_1 }
|
|
@@ -5,6 +5,7 @@ import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
|
5
5
|
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
6
6
|
import type { EvalRow } from '@mastra/core/storage';
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
|
+
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
8
9
|
import type { MastraMessageV1 } from '@mastra/core/memory';
|
|
9
10
|
import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
10
11
|
import { MastraStorage } from '@mastra/core/storage';
|
|
@@ -187,6 +188,15 @@ declare class MongoDBStore extends MastraStorage {
|
|
|
187
188
|
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
188
189
|
}>;
|
|
189
190
|
close(): Promise<void>;
|
|
191
|
+
updateMessages(_args: {
|
|
192
|
+
messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
193
|
+
id: string;
|
|
194
|
+
content?: {
|
|
195
|
+
metadata?: MastraMessageContentV2['metadata'];
|
|
196
|
+
content?: MastraMessageContentV2['content'];
|
|
197
|
+
};
|
|
198
|
+
}[];
|
|
199
|
+
}): Promise<MastraMessageV2[]>;
|
|
190
200
|
}
|
|
191
201
|
export { MongoDBStore }
|
|
192
202
|
export { MongoDBStore as MongoDBStore_alias_1 }
|
package/dist/index.cjs
CHANGED
|
@@ -954,6 +954,10 @@ var MongoDBStore = class extends storage.MastraStorage {
|
|
|
954
954
|
async close() {
|
|
955
955
|
await this.#client.close();
|
|
956
956
|
}
|
|
957
|
+
async updateMessages(_args) {
|
|
958
|
+
this.logger.error("updateMessages is not yet implemented in MongoDBStore");
|
|
959
|
+
throw new Error("Method not implemented");
|
|
960
|
+
}
|
|
957
961
|
};
|
|
958
962
|
|
|
959
963
|
// src/vector/prompt.ts
|
package/dist/index.js
CHANGED
|
@@ -952,6 +952,10 @@ var MongoDBStore = class extends MastraStorage {
|
|
|
952
952
|
async close() {
|
|
953
953
|
await this.#client.close();
|
|
954
954
|
}
|
|
955
|
+
async updateMessages(_args) {
|
|
956
|
+
this.logger.error("updateMessages is not yet implemented in MongoDBStore");
|
|
957
|
+
throw new Error("Method not implemented");
|
|
958
|
+
}
|
|
955
959
|
};
|
|
956
960
|
|
|
957
961
|
// src/vector/prompt.ts
|
package/docker-compose.yaml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mongodb",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1-alpha.0",
|
|
4
4
|
"description": "MongoDB provider for Mastra - includes vector store capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"tsup": "^8.5.0",
|
|
32
32
|
"typescript": "^5.8.3",
|
|
33
33
|
"vitest": "^3.2.3",
|
|
34
|
-
"@internal/lint": "0.0.
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
34
|
+
"@internal/lint": "0.0.13",
|
|
35
|
+
"@mastra/core": "0.10.7-alpha.0",
|
|
36
|
+
"@internal/storage-test-utils": "0.0.9"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@mastra/core": ">=0.10.4-0 <0.11.0"
|
package/src/storage/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MessageList } from '@mastra/core/agent';
|
|
2
|
+
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
2
3
|
import type { MetricResult, TestInfo } from '@mastra/core/eval';
|
|
3
4
|
import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
|
|
4
5
|
import type {
|
|
@@ -741,4 +742,15 @@ export class MongoDBStore extends MastraStorage {
|
|
|
741
742
|
async close(): Promise<void> {
|
|
742
743
|
await this.#client.close();
|
|
743
744
|
}
|
|
745
|
+
|
|
746
|
+
async updateMessages(_args: {
|
|
747
|
+
messages: Partial<Omit<MastraMessageV2, 'createdAt'>> &
|
|
748
|
+
{
|
|
749
|
+
id: string;
|
|
750
|
+
content?: { metadata?: MastraMessageContentV2['metadata']; content?: MastraMessageContentV2['content'] };
|
|
751
|
+
}[];
|
|
752
|
+
}): Promise<MastraMessageV2[]> {
|
|
753
|
+
this.logger.error('updateMessages is not yet implemented in MongoDBStore');
|
|
754
|
+
throw new Error('Method not implemented');
|
|
755
|
+
}
|
|
744
756
|
}
|