@mastra/cloudflare-d1 0.0.0-stream-vnext-usage-20250908171242 → 0.0.0-suspendRuntimeContextTypeFix-20250930142630
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 +65 -3
- package/dist/index.cjs +78 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +78 -6
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +8 -0
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +2 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +11 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,73 @@
|
|
|
1
1
|
# @mastra/cloudflare-d1
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-suspendRuntimeContextTypeFix-20250930142630
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
7
|
+
- Update peer deps ([#8154](https://github.com/mastra-ai/mastra/pull/8154))
|
|
8
|
+
|
|
9
|
+
- Cloudflare D1 support fetch scores by trace and span id ([#8154](https://github.com/mastra-ai/mastra/pull/8154))
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`dc099b4`](https://github.com/mastra-ai/mastra/commit/dc099b40fb31147ba3f362f98d991892033c4c67), [`504438b`](https://github.com/mastra-ai/mastra/commit/504438b961bde211071186bba63a842c4e3db879), [`b342a68`](https://github.com/mastra-ai/mastra/commit/b342a68e1399cf1ece9ba11bda112db89d21118c), [`7fceb0a`](https://github.com/mastra-ai/mastra/commit/7fceb0a327d678e812f90f5387c5bc4f38bd039e), [`303a9c0`](https://github.com/mastra-ai/mastra/commit/303a9c0d7dd58795915979f06a0512359e4532fb), [`c7db3e0`](https://github.com/mastra-ai/mastra/commit/c7db3e057c4b2858a630a7c3f3d3aae571e3e5b7), [`370f8a6`](https://github.com/mastra-ai/mastra/commit/370f8a6480faec70fef18d72e5f7538f27004301), [`809eea0`](https://github.com/mastra-ai/mastra/commit/809eea092fa80c3f69b9eaf078d843b57fd2a88e), [`623ffaf`](https://github.com/mastra-ai/mastra/commit/623ffaf2d969e11e99a0224633cf7b5a0815c857), [`9fc1613`](https://github.com/mastra-ai/mastra/commit/9fc16136400186648880fd990119ac15f7c02ee4), [`61f62aa`](https://github.com/mastra-ai/mastra/commit/61f62aa31bc88fe4ddf8da6240dbcfbeb07358bd), [`db1891a`](https://github.com/mastra-ai/mastra/commit/db1891a4707443720b7cd8a260dc7e1d49b3609c), [`e8f379d`](https://github.com/mastra-ai/mastra/commit/e8f379d390efa264c4e0874f9ac0cf8839b07777), [`3e292ba`](https://github.com/mastra-ai/mastra/commit/3e292ba00837886d5d68a34cbc0d9b703c991883), [`418c136`](https://github.com/mastra-ai/mastra/commit/418c1366843d88e491bca3f87763899ce855ca29), [`c2a4919`](https://github.com/mastra-ai/mastra/commit/c2a4919ba6797d8bdb1509e02287496eef69303e), [`c84b7d0`](https://github.com/mastra-ai/mastra/commit/c84b7d093c4657772140cbfd2b15ef72f3315ed5)]:
|
|
12
|
+
- @mastra/core@0.0.0-suspendRuntimeContextTypeFix-20250930142630
|
|
13
|
+
|
|
14
|
+
## 0.13.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`a61f23f`](https://github.com/mastra-ai/mastra/commit/a61f23fbbca4b88b763d94f1d784c47895ed72d7), [`4b339b8`](https://github.com/mastra-ai/mastra/commit/4b339b8141c20d6a6d80583c7e8c5c05d8c19492), [`d1dc606`](https://github.com/mastra-ai/mastra/commit/d1dc6067b0557a71190b68d56ee15b48c26d2411), [`c45298a`](https://github.com/mastra-ai/mastra/commit/c45298a0a0791db35cf79f1199d77004da0704cb), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55), [`d3bd4d4`](https://github.com/mastra-ai/mastra/commit/d3bd4d482a685bbb67bfa89be91c90dca3fa71ad), [`c591dfc`](https://github.com/mastra-ai/mastra/commit/c591dfc1e600fae1dedffe239357d250e146378f), [`1920c5c`](https://github.com/mastra-ai/mastra/commit/1920c5c6d666f687785c73021196aa551e579e0d), [`b6a3b65`](https://github.com/mastra-ai/mastra/commit/b6a3b65d830fa0ca7754ad6481661d1f2c878f21), [`af3abb6`](https://github.com/mastra-ai/mastra/commit/af3abb6f7c7585d856e22d27f4e7d2ece2186b9a)]:
|
|
21
|
+
- @mastra/core@0.18.0
|
|
22
|
+
|
|
23
|
+
## 0.13.2-alpha.0
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- Update Peerdeps for packages based on core minor bump ([#8025](https://github.com/mastra-ai/mastra/pull/8025))
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`cf34503`](https://github.com/mastra-ai/mastra/commit/cf345031de4e157f29087946449e60b965e9c8a9), [`6b4b1e4`](https://github.com/mastra-ai/mastra/commit/6b4b1e4235428d39e51cbda9832704c0ba70ab32), [`3469fca`](https://github.com/mastra-ai/mastra/commit/3469fca7bb7e5e19369ff9f7044716a5e4b02585), [`c4a8204`](https://github.com/mastra-ai/mastra/commit/c4a82046bfd241d6044e234bc5917d5a01fe6b55)]:
|
|
30
|
+
- @mastra/core@0.18.0-alpha.2
|
|
31
|
+
|
|
32
|
+
## 0.13.1
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
37
|
+
|
|
38
|
+
- Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
39
|
+
|
|
40
|
+
- Add resource id to workflow run snapshots ([#7740](https://github.com/mastra-ai/mastra/pull/7740))
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`fb84c21`](https://github.com/mastra-ai/mastra/commit/fb84c21859d09bdc8f158bd5412bdc4b5835a61c), [`5802bf5`](https://github.com/mastra-ai/mastra/commit/5802bf57f6182e4b67c28d7d91abed349a8d14f3), [`5bda53a`](https://github.com/mastra-ai/mastra/commit/5bda53a9747bfa7d876d754fc92c83a06e503f62), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`f26a8fd`](https://github.com/mastra-ai/mastra/commit/f26a8fd99fcb0497a5d86c28324430d7f6a5fb83), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`6047778`](https://github.com/mastra-ai/mastra/commit/6047778e501df460648f31decddf8e443f36e373), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`9d4fc09`](https://github.com/mastra-ai/mastra/commit/9d4fc09b2ad55caa7738c7ceb3a905e454f74cdd), [`05c7abf`](https://github.com/mastra-ai/mastra/commit/05c7abfe105a015b7760c9bf33ff4419727502a0), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`d75ccf0`](https://github.com/mastra-ai/mastra/commit/d75ccf06dfd2582b916aa12624e3cd61b279edf1), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`60c9cec`](https://github.com/mastra-ai/mastra/commit/60c9cec7048a79a87440f7840c383875bd710d93), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`aee4f00`](https://github.com/mastra-ai/mastra/commit/aee4f00e61e1a42e81a6d74ff149dbe69e32695a), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4), [`897995e`](https://github.com/mastra-ai/mastra/commit/897995e630d572fe2891e7ede817938cabb43251), [`0fed8f2`](https://github.com/mastra-ai/mastra/commit/0fed8f2aa84b167b3415ea6f8f70755775132c8d), [`4f9ea8c`](https://github.com/mastra-ai/mastra/commit/4f9ea8c95ea74ba9abbf3b2ab6106c7d7bc45689), [`1a1fbe6`](https://github.com/mastra-ai/mastra/commit/1a1fbe66efb7d94abc373ed0dd9676adb8122454), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`87fd07f`](https://github.com/mastra-ai/mastra/commit/87fd07ff35387a38728967163460231b5d33ae3b), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`36f39c0`](https://github.com/mastra-ai/mastra/commit/36f39c00dc794952dc3c11aab91c2fa8bca74b11), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
|
|
43
|
+
- @mastra/core@0.17.0
|
|
44
|
+
|
|
45
|
+
## 0.13.1-alpha.2
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- clean up console logs in monorepo ([#7926](https://github.com/mastra-ai/mastra/pull/7926))
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`197cbb2`](https://github.com/mastra-ai/mastra/commit/197cbb248fc8cb4bbf61bf70b770f1388b445df2), [`6590763`](https://github.com/mastra-ai/mastra/commit/65907630ef4bf4127067cecd1cb21b56f55d5f1b), [`c2eade3`](https://github.com/mastra-ai/mastra/commit/c2eade3508ef309662f065e5f340d7840295dd53), [`222965a`](https://github.com/mastra-ai/mastra/commit/222965a98ce8197b86673ec594244650b5960257), [`0324ceb`](https://github.com/mastra-ai/mastra/commit/0324ceb8af9d16c12a531f90e575f6aab797ac81), [`0f9d227`](https://github.com/mastra-ai/mastra/commit/0f9d227890a98db33865abbea39daf407cd55ef7), [`de056a0`](https://github.com/mastra-ai/mastra/commit/de056a02cbb43f6aa0380ab2150ea404af9ec0dd), [`c93532a`](https://github.com/mastra-ai/mastra/commit/c93532a340b80e4dd946d4c138d9381de5f70399), [`6cb1fcb`](https://github.com/mastra-ai/mastra/commit/6cb1fcbc8d0378ffed0d17784c96e68f30cb0272), [`2685a78`](https://github.com/mastra-ai/mastra/commit/2685a78f224b8b04e20d4fab5ac1adb638190071), [`239b5a4`](https://github.com/mastra-ai/mastra/commit/239b5a497aeae2e8b4d764f46217cfff2284788e)]:
|
|
52
|
+
- @mastra/core@0.17.0-alpha.6
|
|
53
|
+
|
|
54
|
+
## 0.13.1-alpha.1
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Update peerdep of @mastra/core ([#7619](https://github.com/mastra-ai/mastra/pull/7619))
|
|
59
|
+
|
|
60
|
+
- Updated dependencies [[`a1bb887`](https://github.com/mastra-ai/mastra/commit/a1bb887e8bfae44230f487648da72e96ef824561), [`a0f5f1c`](https://github.com/mastra-ai/mastra/commit/a0f5f1ca39c3c5c6d26202e9fcab986b4fe14568), [`b356f5f`](https://github.com/mastra-ai/mastra/commit/b356f5f7566cb3edb755d91f00b72fc1420b2a37), [`f5ce05f`](https://github.com/mastra-ai/mastra/commit/f5ce05f831d42c69559bf4c0fdb46ccb920fc3a3), [`9f6f30f`](https://github.com/mastra-ai/mastra/commit/9f6f30f04ec6648bbca798ea8aad59317c40d8db), [`d706fad`](https://github.com/mastra-ai/mastra/commit/d706fad6e6e4b72357b18d229ba38e6c913c0e70), [`5c3768f`](https://github.com/mastra-ai/mastra/commit/5c3768fa959454232ad76715c381f4aac00c6881), [`8a3f5e4`](https://github.com/mastra-ai/mastra/commit/8a3f5e4212ec36b302957deb4bd47005ab598382)]:
|
|
61
|
+
- @mastra/core@0.17.0-alpha.3
|
|
62
|
+
|
|
63
|
+
## 0.13.1-alpha.0
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Add resource id to workflow run snapshots ([#7740](https://github.com/mastra-ai/mastra/pull/7740))
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [[`547c621`](https://github.com/mastra-ai/mastra/commit/547c62104af3f7a551b3754e9cbdf0a3fbba15e4)]:
|
|
70
|
+
- @mastra/core@0.16.4-alpha.1
|
|
9
71
|
|
|
10
72
|
## 0.13.0
|
|
11
73
|
|
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,7 @@ var storage = require('@mastra/core/storage');
|
|
|
5
5
|
var Cloudflare = require('cloudflare');
|
|
6
6
|
var utils = require('@mastra/core/utils');
|
|
7
7
|
var agent = require('@mastra/core/agent');
|
|
8
|
+
var scores = require('@mastra/core/scores');
|
|
8
9
|
|
|
9
10
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
|
|
@@ -1615,12 +1616,25 @@ var ScoresStorageD1 = class extends storage.ScoresStorage {
|
|
|
1615
1616
|
}
|
|
1616
1617
|
}
|
|
1617
1618
|
async saveScore(score) {
|
|
1619
|
+
let parsedScore;
|
|
1620
|
+
try {
|
|
1621
|
+
parsedScore = scores.saveScorePayloadSchema.parse(score);
|
|
1622
|
+
} catch (error$1) {
|
|
1623
|
+
throw new error.MastraError(
|
|
1624
|
+
{
|
|
1625
|
+
id: "CLOUDFLARE_D1_STORE_SCORES_SAVE_SCORE_FAILED_INVALID_SCORE_PAYLOAD",
|
|
1626
|
+
domain: error.ErrorDomain.STORAGE,
|
|
1627
|
+
category: error.ErrorCategory.USER,
|
|
1628
|
+
details: { scoreId: score.id }
|
|
1629
|
+
},
|
|
1630
|
+
error$1
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1618
1633
|
try {
|
|
1619
1634
|
const id = crypto.randomUUID();
|
|
1620
1635
|
const fullTableName = this.operations.getTableName(storage.TABLE_SCORERS);
|
|
1621
|
-
const { input, ...rest } = score;
|
|
1622
1636
|
const serializedRecord = {};
|
|
1623
|
-
for (const [key, value] of Object.entries(
|
|
1637
|
+
for (const [key, value] of Object.entries(parsedScore)) {
|
|
1624
1638
|
if (value !== null && value !== void 0) {
|
|
1625
1639
|
if (typeof value === "object") {
|
|
1626
1640
|
serializedRecord[key] = JSON.stringify(value);
|
|
@@ -1632,7 +1646,6 @@ var ScoresStorageD1 = class extends storage.ScoresStorage {
|
|
|
1632
1646
|
}
|
|
1633
1647
|
}
|
|
1634
1648
|
serializedRecord.id = id;
|
|
1635
|
-
serializedRecord.input = JSON.stringify(input);
|
|
1636
1649
|
serializedRecord.createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1637
1650
|
serializedRecord.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1638
1651
|
const columns = Object.keys(serializedRecord);
|
|
@@ -1808,6 +1821,53 @@ var ScoresStorageD1 = class extends storage.ScoresStorage {
|
|
|
1808
1821
|
);
|
|
1809
1822
|
}
|
|
1810
1823
|
}
|
|
1824
|
+
async getScoresBySpan({
|
|
1825
|
+
traceId,
|
|
1826
|
+
spanId,
|
|
1827
|
+
pagination
|
|
1828
|
+
}) {
|
|
1829
|
+
try {
|
|
1830
|
+
const fullTableName = this.operations.getTableName(storage.TABLE_SCORERS);
|
|
1831
|
+
const countQuery = createSqlBuilder().count().from(fullTableName).where("traceId = ?", traceId).andWhere("spanId = ?", spanId);
|
|
1832
|
+
const countResult = await this.operations.executeQuery(countQuery.build());
|
|
1833
|
+
const total = Array.isArray(countResult) ? Number(countResult?.[0]?.count ?? 0) : Number(countResult?.count ?? 0);
|
|
1834
|
+
if (total === 0) {
|
|
1835
|
+
return {
|
|
1836
|
+
pagination: {
|
|
1837
|
+
total: 0,
|
|
1838
|
+
page: pagination.page,
|
|
1839
|
+
perPage: pagination.perPage,
|
|
1840
|
+
hasMore: false
|
|
1841
|
+
},
|
|
1842
|
+
scores: []
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
const limit = pagination.perPage + 1;
|
|
1846
|
+
const selectQuery = createSqlBuilder().select("*").from(fullTableName).where("traceId = ?", traceId).andWhere("spanId = ?", spanId).orderBy("createdAt", "DESC").limit(limit).offset(pagination.page * pagination.perPage);
|
|
1847
|
+
const { sql, params } = selectQuery.build();
|
|
1848
|
+
const results = await this.operations.executeQuery({ sql, params });
|
|
1849
|
+
const rows = Array.isArray(results) ? results : [];
|
|
1850
|
+
const scores = rows.slice(0, pagination.perPage).map(transformScoreRow);
|
|
1851
|
+
return {
|
|
1852
|
+
pagination: {
|
|
1853
|
+
total,
|
|
1854
|
+
page: pagination.page,
|
|
1855
|
+
perPage: pagination.perPage,
|
|
1856
|
+
hasMore: rows.length > pagination.perPage
|
|
1857
|
+
},
|
|
1858
|
+
scores
|
|
1859
|
+
};
|
|
1860
|
+
} catch (error$1) {
|
|
1861
|
+
throw new error.MastraError(
|
|
1862
|
+
{
|
|
1863
|
+
id: "CLOUDFLARE_D1_STORE_SCORES_GET_SCORES_BY_SPAN_FAILED",
|
|
1864
|
+
domain: error.ErrorDomain.STORAGE,
|
|
1865
|
+
category: error.ErrorCategory.THIRD_PARTY
|
|
1866
|
+
},
|
|
1867
|
+
error$1
|
|
1868
|
+
);
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1811
1871
|
};
|
|
1812
1872
|
function isArrayOfRecords2(value) {
|
|
1813
1873
|
return value && Array.isArray(value) && value.length > 0;
|
|
@@ -1885,7 +1945,7 @@ var TracesStorageD1 = class extends storage.TracesStorage {
|
|
|
1885
1945
|
const allDataResult = await this.operations.executeQuery(
|
|
1886
1946
|
createSqlBuilder().select("*").from(fullTableName).where("1=1").build()
|
|
1887
1947
|
);
|
|
1888
|
-
console.
|
|
1948
|
+
console.info("allDataResult", allDataResult);
|
|
1889
1949
|
const countResult = await this.operations.executeQuery(countQuery.build());
|
|
1890
1950
|
const total = Number(countResult?.[0]?.count ?? 0);
|
|
1891
1951
|
dataQuery.orderBy("startTime", "DESC").limit(perPage).offset(page * perPage);
|
|
@@ -1956,6 +2016,7 @@ var WorkflowsStorageD1 = class extends storage.WorkflowsStorage {
|
|
|
1956
2016
|
async persistWorkflowSnapshot({
|
|
1957
2017
|
workflowName,
|
|
1958
2018
|
runId,
|
|
2019
|
+
resourceId,
|
|
1959
2020
|
snapshot
|
|
1960
2021
|
}) {
|
|
1961
2022
|
const fullTableName = this.operations.getTableName(storage.TABLE_WORKFLOW_SNAPSHOT);
|
|
@@ -1966,11 +2027,13 @@ var WorkflowsStorageD1 = class extends storage.WorkflowsStorage {
|
|
|
1966
2027
|
});
|
|
1967
2028
|
const persisting = currentSnapshot ? {
|
|
1968
2029
|
...currentSnapshot,
|
|
2030
|
+
resourceId,
|
|
1969
2031
|
snapshot: JSON.stringify(snapshot),
|
|
1970
2032
|
updatedAt: now
|
|
1971
2033
|
} : {
|
|
1972
2034
|
workflow_name: workflowName,
|
|
1973
2035
|
run_id: runId,
|
|
2036
|
+
resourceId,
|
|
1974
2037
|
snapshot,
|
|
1975
2038
|
createdAt: now,
|
|
1976
2039
|
updatedAt: now
|
|
@@ -2236,7 +2299,8 @@ var D1Store = class extends storage.MastraStorage {
|
|
|
2236
2299
|
resourceWorkingMemory: true,
|
|
2237
2300
|
hasColumn: true,
|
|
2238
2301
|
createTable: true,
|
|
2239
|
-
deleteMessages: false
|
|
2302
|
+
deleteMessages: false,
|
|
2303
|
+
getScoresBySpan: true
|
|
2240
2304
|
};
|
|
2241
2305
|
}
|
|
2242
2306
|
async createTable({
|
|
@@ -2340,9 +2404,10 @@ var D1Store = class extends storage.MastraStorage {
|
|
|
2340
2404
|
async persistWorkflowSnapshot({
|
|
2341
2405
|
workflowName,
|
|
2342
2406
|
runId,
|
|
2407
|
+
resourceId,
|
|
2343
2408
|
snapshot
|
|
2344
2409
|
}) {
|
|
2345
|
-
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, snapshot });
|
|
2410
|
+
return this.stores.workflows.persistWorkflowSnapshot({ workflowName, runId, resourceId, snapshot });
|
|
2346
2411
|
}
|
|
2347
2412
|
async loadWorkflowSnapshot(params) {
|
|
2348
2413
|
return this.stores.workflows.loadWorkflowSnapshot(params);
|
|
@@ -2437,6 +2502,13 @@ var D1Store = class extends storage.MastraStorage {
|
|
|
2437
2502
|
}) {
|
|
2438
2503
|
return this.stores.scores.getScoresByScorerId({ scorerId, pagination, entityId, entityType, source });
|
|
2439
2504
|
}
|
|
2505
|
+
async getScoresBySpan({
|
|
2506
|
+
traceId,
|
|
2507
|
+
spanId,
|
|
2508
|
+
pagination
|
|
2509
|
+
}) {
|
|
2510
|
+
return this.stores.scores.getScoresBySpan({ traceId, spanId, pagination });
|
|
2511
|
+
}
|
|
2440
2512
|
/**
|
|
2441
2513
|
* Close the database connection
|
|
2442
2514
|
* No explicit cleanup needed for D1 in either REST or Workers Binding mode
|