@mastra/convex 1.3.0 → 1.3.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/CHANGELOG.md +20 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-storage-convex.md +2 -0
- package/dist/docs/references/reference-vectors-convex.md +2 -0
- package/dist/index.cjs +10 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +7 -4
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @mastra/convex
|
|
2
2
|
|
|
3
|
+
## 1.3.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 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))
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
await storage.saveScore({ ...score, organizationId: 'org-a', projectId: 'proj-1' });
|
|
11
|
+
|
|
12
|
+
const result = await storage.listScoresByScorerId({
|
|
13
|
+
scorerId,
|
|
14
|
+
filters: { organizationId: 'org-a', projectId: 'proj-1' },
|
|
15
|
+
});
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`projectId` identifies the project scope, separate from `resourceId` which continues to mean the agent memory resource.
|
|
19
|
+
|
|
20
|
+
- 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)]:
|
|
21
|
+
- @mastra/core@1.49.0-alpha.5
|
|
22
|
+
|
|
3
23
|
## 1.3.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
1
3
|
# Convex storage
|
|
2
4
|
|
|
3
5
|
The Convex storage implementation provides a serverless storage solution using [Convex](https://convex.dev), a full-stack TypeScript development platform with real-time sync and automatic caching.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
1
3
|
# Convex vector store
|
|
2
4
|
|
|
3
5
|
The `ConvexVector` class provides vector storage and similarity search using [Convex](https://convex.dev). It stores embeddings inside Convex and performs cosine similarity search in the Mastra adapter.
|
package/dist/index.cjs
CHANGED
|
@@ -1638,29 +1638,32 @@ var ScoresConvex = class extends storage.ScoresStorage {
|
|
|
1638
1638
|
pagination,
|
|
1639
1639
|
entityId,
|
|
1640
1640
|
entityType,
|
|
1641
|
-
source
|
|
1641
|
+
source,
|
|
1642
|
+
filters
|
|
1642
1643
|
}) {
|
|
1643
1644
|
return this.listScores({
|
|
1644
|
-
filters: { scorerId, entityId, entityType, source },
|
|
1645
|
+
filters: { scorerId, entityId, entityType, source, ...filters },
|
|
1645
1646
|
pagination
|
|
1646
1647
|
});
|
|
1647
1648
|
}
|
|
1648
1649
|
async listScoresByRunId({
|
|
1649
1650
|
runId,
|
|
1650
|
-
pagination
|
|
1651
|
+
pagination,
|
|
1652
|
+
filters
|
|
1651
1653
|
}) {
|
|
1652
1654
|
return this.listScores({
|
|
1653
|
-
filters: { runId },
|
|
1655
|
+
filters: { runId, ...filters },
|
|
1654
1656
|
pagination
|
|
1655
1657
|
});
|
|
1656
1658
|
}
|
|
1657
1659
|
async listScoresByEntityId({
|
|
1658
1660
|
entityId,
|
|
1659
1661
|
entityType,
|
|
1660
|
-
pagination
|
|
1662
|
+
pagination,
|
|
1663
|
+
filters
|
|
1661
1664
|
}) {
|
|
1662
1665
|
return this.listScores({
|
|
1663
|
-
filters: { entityId, entityType },
|
|
1666
|
+
filters: { entityId, entityType, ...filters },
|
|
1664
1667
|
pagination
|
|
1665
1668
|
});
|
|
1666
1669
|
}
|
|
@@ -1679,7 +1682,7 @@ var ScoresConvex = class extends storage.ScoresStorage {
|
|
|
1679
1682
|
);
|
|
1680
1683
|
}
|
|
1681
1684
|
const rows = await this.#db.queryTable(storage.TABLE_SCORERS, void 0);
|
|
1682
|
-
const filtered = rows.filter((row) => filters.scorerId ? row.scorerId === filters.scorerId : true).filter((row) => filters.entityId ? row.entityId === filters.entityId : true).filter((row) => filters.entityType ? row.entityType === filters.entityType : true).filter((row) => filters.runId ? row.runId === filters.runId : true).filter((row) => filters.source ? row.source === filters.source : true).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
1685
|
+
const filtered = rows.filter((row) => filters.scorerId ? row.scorerId === filters.scorerId : true).filter((row) => filters.entityId ? row.entityId === filters.entityId : true).filter((row) => filters.entityType ? row.entityType === filters.entityType : true).filter((row) => filters.runId ? row.runId === filters.runId : true).filter((row) => filters.source ? row.source === filters.source : true).filter((row) => filters.organizationId !== void 0 ? row.organizationId === filters.organizationId : true).filter((row) => filters.projectId !== void 0 ? row.projectId === filters.projectId : true).sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
1683
1686
|
const { perPage, page } = pagination;
|
|
1684
1687
|
const perPageValue = perPage === false ? filtered.length : perPage;
|
|
1685
1688
|
const start = perPage === false ? 0 : page * perPageValue;
|