@mastra/dynamodb 0.15.10 → 0.15.11-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/CHANGELOG.md +11 -0
- package/dist/entities/index.d.ts +4 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/score.d.ts +4 -0
- package/dist/entities/score.d.ts.map +1 -1
- package/dist/index.cjs +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/score/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mastra/dynamodb
|
|
2
2
|
|
|
3
|
+
## 0.15.11-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: ensure score responses match saved payloads for Mastra Stores. ([#10570](https://github.com/mastra-ai/mastra/pull/10570))
|
|
8
|
+
|
|
9
|
+
- Fix message sorting in getMessagesPaginated when using semantic recall (include parameter). Messages are now always sorted by createdAt after combining paginated and included messages, ensuring correct chronological ordering of conversation history. All stores now consistently use MessageList for deduplication followed by explicit sorting. ([#10573](https://github.com/mastra-ai/mastra/pull/10573))
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`5657314`](https://github.com/mastra-ai/mastra/commit/5657314a1f9d49019bb53f357fa48f75a69247ca), [`e5aca78`](https://github.com/mastra-ai/mastra/commit/e5aca78bb7f263bb8b470bedae81efe9805d7544), [`33a607a`](https://github.com/mastra-ai/mastra/commit/33a607a1f716c2029d4a1ff1603dd756129a33b3), [`cc10fc1`](https://github.com/mastra-ai/mastra/commit/cc10fc192d9f527c71a23cc9def10d8718935ee1), [`1f7ee84`](https://github.com/mastra-ai/mastra/commit/1f7ee841a643ef12d90392125881f06fdf877293), [`e7d5149`](https://github.com/mastra-ai/mastra/commit/e7d514995260b63b2108308e85c64de37dcd0f71), [`f195082`](https://github.com/mastra-ai/mastra/commit/f1950822a2425d5ccae78c5d010e02ddb027a869), [`d9986dd`](https://github.com/mastra-ai/mastra/commit/d9986dd3513f7ca3244a8e599a440ccf4d8bc28b), [`a45b0f0`](https://github.com/mastra-ai/mastra/commit/a45b0f0cd19eab1fe4deceae3abf029442c22f74), [`f6e8eb3`](https://github.com/mastra-ai/mastra/commit/f6e8eb3dac53b70b06e906b2818b1d2a5b0486d7), [`ce57a2b`](https://github.com/mastra-ai/mastra/commit/ce57a2b62fd0d5f6532e4ecd1ba9ba93ac9b95fc), [`3236f35`](https://github.com/mastra-ai/mastra/commit/3236f352ae13cc8552c2965164e97bd125dae48d), [`ce57a2b`](https://github.com/mastra-ai/mastra/commit/ce57a2b62fd0d5f6532e4ecd1ba9ba93ac9b95fc), [`0230321`](https://github.com/mastra-ai/mastra/commit/02303217870bedea0ef009bea9a952f24ed38aaf), [`7b541f4`](https://github.com/mastra-ai/mastra/commit/7b541f49eda6f5a87b738198edbd136927599475), [`0eea842`](https://github.com/mastra-ai/mastra/commit/0eea8423cbdd37f2111593c6f7d2efcde4b7e4ce), [`63ae8a2`](https://github.com/mastra-ai/mastra/commit/63ae8a22c0c09bbb8b9779f5f38934cd75f616af), [`bf810c5`](https://github.com/mastra-ai/mastra/commit/bf810c5c561bd8ef221c0f6bd84e69770b9a38cc), [`ac7ef07`](https://github.com/mastra-ai/mastra/commit/ac7ef07633caee89707142171d2873c888ffef85), [`522f0b4`](https://github.com/mastra-ai/mastra/commit/522f0b45330719858794eabffffde4f343f55549), [`bf810c5`](https://github.com/mastra-ai/mastra/commit/bf810c5c561bd8ef221c0f6bd84e69770b9a38cc), [`8b51d55`](https://github.com/mastra-ai/mastra/commit/8b51d55bae531edf7e383958d7ecee04df31f5d5), [`2131ac5`](https://github.com/mastra-ai/mastra/commit/2131ac571d5065f0a656c57494bca98691bb7609)]:
|
|
12
|
+
- @mastra/core@0.24.6-alpha.0
|
|
13
|
+
|
|
3
14
|
## 0.15.10
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -554,6 +554,10 @@ export declare function getElectroDbService(client: DynamoDBDocumentClient, tabl
|
|
|
554
554
|
set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
555
555
|
get: (value?: string) => any;
|
|
556
556
|
};
|
|
557
|
+
preprocessPrompt: {
|
|
558
|
+
type: "string";
|
|
559
|
+
required: false;
|
|
560
|
+
};
|
|
557
561
|
preprocessStepResult: {
|
|
558
562
|
type: "string";
|
|
559
563
|
required: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgBpF"}
|
package/dist/entities/score.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export declare const scoreEntity: Entity<string, string, string, {
|
|
|
38
38
|
set: (value?: Record<string, unknown> | string) => string | undefined;
|
|
39
39
|
get: (value?: string) => any;
|
|
40
40
|
};
|
|
41
|
+
preprocessPrompt: {
|
|
42
|
+
type: "string";
|
|
43
|
+
required: false;
|
|
44
|
+
};
|
|
41
45
|
preprocessStepResult: {
|
|
42
46
|
type: "string";
|
|
43
47
|
required: false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../../src/entities/score.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAmCJ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM
|
|
1
|
+
{"version":3,"file":"score.d.ts","sourceRoot":"","sources":["../../src/entities/score.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAmCJ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;;;;;0BAoBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA8CN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;0BAgBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;;;;;0BAoBN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;0BAMhC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuExB,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -425,6 +425,10 @@ var scoreEntity = new electrodb.Entity({
|
|
|
425
425
|
return value;
|
|
426
426
|
}
|
|
427
427
|
},
|
|
428
|
+
preprocessPrompt: {
|
|
429
|
+
type: "string",
|
|
430
|
+
required: false
|
|
431
|
+
},
|
|
428
432
|
preprocessStepResult: {
|
|
429
433
|
type: "string",
|
|
430
434
|
required: false,
|
|
@@ -1568,7 +1572,8 @@ var MemoryStorageDynamoDB = class extends storage.MemoryStorage {
|
|
|
1568
1572
|
const paginatedMessages = messages.slice(start, end);
|
|
1569
1573
|
const hasMore = end < total;
|
|
1570
1574
|
const list = new agent.MessageList({ threadId, resourceId }).add(paginatedMessages, "memory");
|
|
1571
|
-
|
|
1575
|
+
let finalMessages = format === "v2" ? list.get.all.v2() : list.get.all.v1();
|
|
1576
|
+
finalMessages = finalMessages.sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime());
|
|
1572
1577
|
return {
|
|
1573
1578
|
messages: finalMessages,
|
|
1574
1579
|
total,
|
|
@@ -2159,8 +2164,17 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
|
|
|
2159
2164
|
}
|
|
2160
2165
|
// Helper function to parse score data (handle JSON fields)
|
|
2161
2166
|
parseScoreData(data) {
|
|
2167
|
+
const result = {};
|
|
2168
|
+
for (const key of Object.keys(storage.SCORERS_SCHEMA)) {
|
|
2169
|
+
if (["traceId", "resourceId", "threadId", "spanId"].includes(key)) {
|
|
2170
|
+
result[key] = data[key] === "" ? null : data[key];
|
|
2171
|
+
continue;
|
|
2172
|
+
}
|
|
2173
|
+
result[key] = data[key];
|
|
2174
|
+
}
|
|
2175
|
+
result.entity = data.entityData ? data.entityData : null;
|
|
2162
2176
|
return {
|
|
2163
|
-
...
|
|
2177
|
+
...result,
|
|
2164
2178
|
// Convert date strings back to Date objects for consistency
|
|
2165
2179
|
createdAt: data.createdAt ? new Date(data.createdAt) : /* @__PURE__ */ new Date(),
|
|
2166
2180
|
updatedAt: data.updatedAt ? new Date(data.updatedAt) : /* @__PURE__ */ new Date()
|