@mastra/dynamodb 1.1.1-alpha.0 → 1.1.2-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 CHANGED
@@ -1,5 +1,51 @@
1
1
  # @mastra/dynamodb
2
2
 
3
+ ## 1.1.2-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Add optional `batchId`, `datasetId`, and `datasetItemId` fields to persisted scores so saved baseline scores can be grouped as one scoring pass and joined back to the dataset items they came from. ([#18331](https://github.com/mastra-ai/mastra/pull/18331))
8
+ - `scoreTrace()` accepts top-level `batchId`, `datasetId`, and `datasetItemId` when persisting a score for a stored trace.
9
+ - `ScoreRowData` and score save payloads now include nullable `batchId`, `datasetId`, and `datasetItemId`.
10
+ - Built-in stores with explicit score schema or attribute mappings now persist these provenance fields on saved scores.
11
+ - D1, DSQL, MSSQL, and Upstash score stores now apply additive provenance migrations or deterministic score ordering for persisted score reads.
12
+
13
+ ```ts
14
+ await scoreTrace({
15
+ storage,
16
+ scorer,
17
+ target: { traceId },
18
+ batchId: 'baseline-batch-1',
19
+ datasetId,
20
+ datasetItemId,
21
+ });
22
+ ```
23
+
24
+ - Added optional `organizationId` and `projectId` fields to scores for multi-tenant isolation. Scores can now be saved with tenancy metadata and the `listScoresBy*` methods accept a `filters` option to scope results by organization and project. ([#18331](https://github.com/mastra-ai/mastra/pull/18331))
25
+
26
+ ```ts
27
+ await storage.saveScore({ ...score, organizationId: 'org-a', projectId: 'proj-1' });
28
+
29
+ const result = await storage.listScoresByScorerId({
30
+ scorerId,
31
+ filters: { organizationId: 'org-a', projectId: 'proj-1' },
32
+ });
33
+ ```
34
+
35
+ `projectId` identifies the project scope, separate from `resourceId` which continues to mean the agent memory resource.
36
+
37
+ - Updated dependencies [[`9250acd`](https://github.com/mastra-ai/mastra/commit/9250acd1357f0f1f33d0dcca16f9655084c58eca), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`c64c2a8`](https://github.com/mastra-ai/mastra/commit/c64c2a8503a50252f9ca6b8e8c54cadee31b92a2), [`06e2680`](https://github.com/mastra-ai/mastra/commit/06e26806b51d2cbd858afdc66daa2b86ff3ba64a), [`1240f05`](https://github.com/mastra-ai/mastra/commit/1240f051c8e5371f1c014448bf37b1a1b9a05e47), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`24c10d3`](https://github.com/mastra-ai/mastra/commit/24c10d333e6649ac06075903aeeee13a933db3b3), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748), [`215f9b0`](https://github.com/mastra-ai/mastra/commit/215f9b0f3f3f6fc165edad360582dd4d3d7ea748)]:
38
+ - @mastra/core@1.49.0-alpha.5
39
+
40
+ ## 1.1.1
41
+
42
+ ### Patch Changes
43
+
44
+ - Fixed workflow runs preserving their original creation time when re-persisted in DynamoDB storage, including concurrent saves. ([#18004](https://github.com/mastra-ai/mastra/pull/18004))
45
+
46
+ - Updated dependencies [[`86623c1`](https://github.com/mastra-ai/mastra/commit/86623c1adf7d22de32cc916dda17f4155184db36), [`023766f`](https://github.com/mastra-ai/mastra/commit/023766f44d59b30a50f3a381e33eddde8ab56c00), [`0200e75`](https://github.com/mastra-ai/mastra/commit/0200e7552d02d4221cd6040bf4eddf189a97a156), [`7c9dd77`](https://github.com/mastra-ai/mastra/commit/7c9dd77bd18cb8dc72797e25f1a0fbdc71a11347), [`7f9ae70`](https://github.com/mastra-ai/mastra/commit/7f9ae70826b047e5a66218f9e92f20e54a2d791f), [`a0509c7`](https://github.com/mastra-ai/mastra/commit/a0509c731a08aa3ed626557c5338126362856f57), [`06e0d63`](https://github.com/mastra-ai/mastra/commit/06e0d63d42bc2a202e18bc091f3781f409f5e6fb), [`bf3fe49`](https://github.com/mastra-ai/mastra/commit/bf3fe49f9467dbbdb8f9eaf74e0f7971ffb19559), [`01caf93`](https://github.com/mastra-ai/mastra/commit/01caf93d71ae2c1e65f49735cafb531975187426), [`438a971`](https://github.com/mastra-ai/mastra/commit/438a9715c8b4398e5eaf8914a1f19dc8a85dc1de), [`9990965`](https://github.com/mastra-ai/mastra/commit/999096571635a83b42ef40841fd7028cfa630779), [`77518cc`](https://github.com/mastra-ai/mastra/commit/77518ccb5bb8cc684875081e64213dc85cffdbee), [`fbeda0c`](https://github.com/mastra-ai/mastra/commit/fbeda0c0f35def07e6837936dd3a003b2b7c5172), [`8a68844`](https://github.com/mastra-ai/mastra/commit/8a688443013816105a09f89c6afa34b5ff13e26d), [`bb2a13b`](https://github.com/mastra-ai/mastra/commit/bb2a13bb4b32e6bb807200fe7b18ae8fa4322118), [`24ceaea`](https://github.com/mastra-ai/mastra/commit/24ceaea0bdd8609cabbab764380608ca6621a194), [`a73cd1a`](https://github.com/mastra-ai/mastra/commit/a73cd1a62a5e4ca023dcc39ba150029f4f1f74c1), [`c0ffa3c`](https://github.com/mastra-ai/mastra/commit/c0ffa3c897ccd326de880df734740a7f0681a18f), [`462a769`](https://github.com/mastra-ai/mastra/commit/462a769da61850862ca1be3d74134d33078ee6a7), [`0504bf5`](https://github.com/mastra-ai/mastra/commit/0504bf5e8cffc571a4b343326178de371e6f859b), [`0b5cc47`](https://github.com/mastra-ai/mastra/commit/0b5cc4726dc18d9a685a27520db39ff1b36bb89a), [`87f38a3`](https://github.com/mastra-ai/mastra/commit/87f38a3de03e24731f2dd6f8ed6a60b6722b85a1), [`d5fa3cd`](https://github.com/mastra-ai/mastra/commit/d5fa3cda1788c3cb93a361a3c6ec47de6ba21e98), [`fe98ef2`](https://github.com/mastra-ai/mastra/commit/fe98ef2e66dbfcbd7d645c88c9ee1e67b458a136), [`6ccf67b`](https://github.com/mastra-ai/mastra/commit/6ccf67bf075753754927a57bc2e1734ba2c820c5), [`793ea0f`](https://github.com/mastra-ai/mastra/commit/793ea0f52f831178837f21c83af6af93bf4ce638), [`825d8de`](https://github.com/mastra-ai/mastra/commit/825d8def9fa64c2bcc3d8dd6b49e09342c3ac5c7), [`507a5c4`](https://github.com/mastra-ai/mastra/commit/507a5c461bdc3136ad80744c0efbb55ce1f18f97), [`5afe423`](https://github.com/mastra-ai/mastra/commit/5afe423e4badf040f1b0d4525183a856fcb8146e), [`307573b`](https://github.com/mastra-ai/mastra/commit/307573b9ff3149b70c79540dbc86f1319b180f29), [`79b3626`](https://github.com/mastra-ai/mastra/commit/79b3626f8d647307eb07c8da14c9073c2699719d), [`c2c1d7b`](https://github.com/mastra-ai/mastra/commit/c2c1d7bb61d2602955f14ed3952f807c2d6eb576), [`86623c1`](https://github.com/mastra-ai/mastra/commit/86623c1adf7d22de32cc916dda17f4155184db36), [`1505c07`](https://github.com/mastra-ai/mastra/commit/1505c07603f6346bae12aa82f140e8b88ffea9ab), [`f328049`](https://github.com/mastra-ai/mastra/commit/f3280498c324afd2a8d36cd828f5b9f94a2dddc1), [`e545228`](https://github.com/mastra-ai/mastra/commit/e54522856934a5dc030b7b6385771e3548020d59), [`3eb852e`](https://github.com/mastra-ai/mastra/commit/3eb852e5435bc908b800193498103dc724f455b0), [`ffa09e7`](https://github.com/mastra-ai/mastra/commit/ffa09e772a5c92270eabe2090fc42d45bd8ec4b7), [`8c9f1c0`](https://github.com/mastra-ai/mastra/commit/8c9f1c0361d89066f9bcd14a2f69e761b01766c8), [`461a7c5`](https://github.com/mastra-ai/mastra/commit/461a7c501449295287f4f0ee4b0b42344f39fcf8), [`4211472`](https://github.com/mastra-ai/mastra/commit/4211472a5a2bd319c60cd2e42d9109c3eef7ac1c), [`9e45902`](https://github.com/mastra-ai/mastra/commit/9e4590208e745055cecca202e2db0e5c65e17d3c), [`5c0df77`](https://github.com/mastra-ai/mastra/commit/5c0df776c40efa420f8c07a2f3ee66010296618e), [`e940f09`](https://github.com/mastra-ai/mastra/commit/e940f099ef5d18b403e6f2b4937e086a4da857b1)]:
47
+ - @mastra/core@1.47.0
48
+
3
49
  ## 1.1.1-alpha.0
4
50
 
5
51
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-dynamodb
3
3
  description: Documentation for @mastra/dynamodb. Use when working with @mastra/dynamodb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/dynamodb"
6
- version: "1.1.1-alpha.0"
6
+ version: "1.1.2-alpha.0"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.1-alpha.0",
2
+ "version": "1.1.2-alpha.0",
3
3
  "package": "@mastra/dynamodb",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -1,3 +1,5 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
1
3
  # DynamoDB storage
2
4
 
3
5
  The DynamoDB storage implementation provides a scalable and performant NoSQL database solution for Mastra, leveraging a single-table design pattern with [ElectroDB](https://electrodb.dev/).
@@ -698,6 +698,26 @@ export declare function getElectroDbService(client: DynamoDBDocumentClient, tabl
698
698
  type: "string";
699
699
  required: false;
700
700
  };
701
+ organizationId: {
702
+ type: "string";
703
+ required: false;
704
+ };
705
+ projectId: {
706
+ type: "string";
707
+ required: false;
708
+ };
709
+ batchId: {
710
+ type: "string";
711
+ required: false;
712
+ };
713
+ datasetId: {
714
+ type: "string";
715
+ required: false;
716
+ };
717
+ datasetItemId: {
718
+ type: "string";
719
+ required: false;
720
+ };
701
721
  threadId: {
702
722
  type: "string";
703
723
  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,uBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBpF"}
@@ -134,6 +134,26 @@ export declare const scoreEntity: Entity<string, string, string, {
134
134
  type: "string";
135
135
  required: false;
136
136
  };
137
+ organizationId: {
138
+ type: "string";
139
+ required: false;
140
+ };
141
+ projectId: {
142
+ type: "string";
143
+ required: false;
144
+ };
145
+ batchId: {
146
+ type: "string";
147
+ required: false;
148
+ };
149
+ datasetId: {
150
+ type: "string";
151
+ required: false;
152
+ };
153
+ datasetItemId: {
154
+ type: "string";
155
+ required: false;
156
+ };
137
157
  threadId: {
138
158
  type: "string";
139
159
  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;;;;;;;;;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,OAA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C,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2FxB,CAAC"}
package/dist/index.cjs CHANGED
@@ -799,6 +799,26 @@ var scoreEntity = new electrodb.Entity({
799
799
  type: "string",
800
800
  required: false
801
801
  },
802
+ organizationId: {
803
+ type: "string",
804
+ required: false
805
+ },
806
+ projectId: {
807
+ type: "string",
808
+ required: false
809
+ },
810
+ batchId: {
811
+ type: "string",
812
+ required: false
813
+ },
814
+ datasetId: {
815
+ type: "string",
816
+ required: false
817
+ },
818
+ datasetItemId: {
819
+ type: "string",
820
+ required: false
821
+ },
802
822
  threadId: {
803
823
  type: "string",
804
824
  required: false
@@ -2262,6 +2282,11 @@ var MemoryStorageDynamoDB = class extends storage.MemoryStorage {
2262
2282
  }
2263
2283
  }
2264
2284
  };
2285
+ function matchesTenancy(score, filters) {
2286
+ if (filters?.organizationId !== void 0 && score.organizationId !== filters.organizationId) return false;
2287
+ if (filters?.projectId !== void 0 && score.projectId !== filters.projectId) return false;
2288
+ return true;
2289
+ }
2265
2290
  var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2266
2291
  service;
2267
2292
  ttlConfig;
@@ -2400,7 +2425,8 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2400
2425
  pagination,
2401
2426
  entityId,
2402
2427
  entityType,
2403
- source
2428
+ source,
2429
+ filters
2404
2430
  }) {
2405
2431
  try {
2406
2432
  const query = this.service.entities.score.query.byScorer({ entity: "score", scorerId });
@@ -2415,6 +2441,7 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2415
2441
  if (source) {
2416
2442
  allScores = allScores.filter((score) => score.source === source);
2417
2443
  }
2444
+ allScores = allScores.filter((score) => matchesTenancy(score, filters));
2418
2445
  allScores.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
2419
2446
  const { page, perPage: perPageInput } = pagination;
2420
2447
  const perPage = storage.normalizePerPage(perPageInput, Number.MAX_SAFE_INTEGER);
@@ -2452,13 +2479,14 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2452
2479
  }
2453
2480
  async listScoresByRunId({
2454
2481
  runId,
2455
- pagination
2482
+ pagination,
2483
+ filters
2456
2484
  }) {
2457
2485
  this.logger.debug("Getting scores by run ID", { runId, pagination });
2458
2486
  try {
2459
2487
  const query = this.service.entities.score.query.byRun({ entity: "score", runId });
2460
2488
  const results = await query.go();
2461
- const allScores = results.data.map((data) => this.parseScoreData(data));
2489
+ const allScores = results.data.map((data) => this.parseScoreData(data)).filter((score) => matchesTenancy(score, filters));
2462
2490
  allScores.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
2463
2491
  const { page, perPage: perPageInput } = pagination;
2464
2492
  const perPage = storage.normalizePerPage(perPageInput, Number.MAX_SAFE_INTEGER);
@@ -2490,7 +2518,8 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2490
2518
  async listScoresByEntityId({
2491
2519
  entityId,
2492
2520
  entityType,
2493
- pagination
2521
+ pagination,
2522
+ filters
2494
2523
  }) {
2495
2524
  this.logger.debug("Getting scores by entity ID", { entityId, entityType, pagination });
2496
2525
  try {
@@ -2498,6 +2527,7 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2498
2527
  const results = await query.go();
2499
2528
  let allScores = results.data.map((data) => this.parseScoreData(data));
2500
2529
  allScores = allScores.filter((score) => score.entityType === entityType);
2530
+ allScores = allScores.filter((score) => matchesTenancy(score, filters));
2501
2531
  allScores.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
2502
2532
  const { page, perPage: perPageInput } = pagination;
2503
2533
  const perPage = storage.normalizePerPage(perPageInput, Number.MAX_SAFE_INTEGER);
@@ -2529,13 +2559,14 @@ var ScoresStorageDynamoDB = class extends storage.ScoresStorage {
2529
2559
  async listScoresBySpan({
2530
2560
  traceId,
2531
2561
  spanId,
2532
- pagination
2562
+ pagination,
2563
+ filters
2533
2564
  }) {
2534
2565
  this.logger.debug("Getting scores by span", { traceId, spanId, pagination });
2535
2566
  try {
2536
2567
  const query = this.service.entities.score.query.bySpan({ entity: "score", traceId, spanId });
2537
2568
  const results = await query.go();
2538
- const allScores = results.data.map((data) => this.parseScoreData(data));
2569
+ const allScores = results.data.map((data) => this.parseScoreData(data)).filter((score) => matchesTenancy(score, filters));
2539
2570
  allScores.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
2540
2571
  const { page, perPage: perPageInput } = pagination;
2541
2572
  const perPage = storage.normalizePerPage(perPageInput, Number.MAX_SAFE_INTEGER);