@mastra/clickhouse 1.0.0-beta.2 → 1.0.0-beta.4
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 +47 -0
- package/dist/index.cjs +68 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +69 -45
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +2 -2
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +22 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @mastra/clickhouse
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
|
|
8
|
+
|
|
9
|
+
**What Changed**
|
|
10
|
+
- saveScore now correctly returns scores that can be retrieved with getScoreById
|
|
11
|
+
- Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
|
|
12
|
+
|
|
13
|
+
**Impact**
|
|
14
|
+
Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b)]:
|
|
17
|
+
- @mastra/core@1.0.0-beta.8
|
|
18
|
+
|
|
19
|
+
## 1.0.0-beta.3
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- Add `disableInit` option to all storage adapters ([#10851](https://github.com/mastra-ai/mastra/pull/10851))
|
|
24
|
+
|
|
25
|
+
Adds a new `disableInit` config option to all storage providers that allows users to disable automatic table creation/migrations at runtime. This is useful for CI/CD pipelines where you want to run migrations during deployment with elevated credentials, then run the application with `disableInit: true` so it doesn't attempt schema changes at runtime.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// CI/CD script - run migrations
|
|
29
|
+
const storage = new PostgresStore({
|
|
30
|
+
connectionString: DATABASE_URL,
|
|
31
|
+
id: 'pg-storage',
|
|
32
|
+
});
|
|
33
|
+
await storage.init();
|
|
34
|
+
|
|
35
|
+
// Runtime - skip auto-init
|
|
36
|
+
const storage = new PostgresStore({
|
|
37
|
+
connectionString: DATABASE_URL,
|
|
38
|
+
id: 'pg-storage',
|
|
39
|
+
disableInit: true,
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Standardize error IDs across all storage and vector stores using centralized helper functions (`createStorageErrorId` and `createVectorErrorId`). This ensures consistent error ID patterns (`MASTRA_STORAGE_{STORE}_{OPERATION}_{STATUS}` and `MASTRA_VECTOR_{STORE}_{OPERATION}_{STATUS}`) across the codebase for better error tracking and debugging. ([#10913](https://github.com/mastra-ai/mastra/pull/10913))
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [[`3076c67`](https://github.com/mastra-ai/mastra/commit/3076c6778b18988ae7d5c4c5c466366974b2d63f), [`85d7ee1`](https://github.com/mastra-ai/mastra/commit/85d7ee18ff4e14d625a8a30ec6656bb49804989b), [`c6c1092`](https://github.com/mastra-ai/mastra/commit/c6c1092f8fbf76109303f69e000e96fd1960c4ce), [`81dc110`](https://github.com/mastra-ai/mastra/commit/81dc11008d147cf5bdc8996ead1aa61dbdebb6fc), [`7aedb74`](https://github.com/mastra-ai/mastra/commit/7aedb74883adf66af38e270e4068fd42e7a37036), [`8f02d80`](https://github.com/mastra-ai/mastra/commit/8f02d800777397e4b45d7f1ad041988a8b0c6630), [`d7aad50`](https://github.com/mastra-ai/mastra/commit/d7aad501ce61646b76b4b511e558ac4eea9884d0), [`ce0a73a`](https://github.com/mastra-ai/mastra/commit/ce0a73abeaa75b10ca38f9e40a255a645d50ebfb), [`a02e542`](https://github.com/mastra-ai/mastra/commit/a02e542d23179bad250b044b17ff023caa61739f), [`a372c64`](https://github.com/mastra-ai/mastra/commit/a372c640ad1fd12e8f0613cebdc682fc156b4d95), [`8846867`](https://github.com/mastra-ai/mastra/commit/8846867ffa9a3746767618e314bebac08eb77d87), [`42a42cf`](https://github.com/mastra-ai/mastra/commit/42a42cf3132b9786feecbb8c13c583dce5b0e198), [`ae08bf0`](https://github.com/mastra-ai/mastra/commit/ae08bf0ebc6a4e4da992b711c4a389c32ba84cf4), [`21735a7`](https://github.com/mastra-ai/mastra/commit/21735a7ef306963554a69a89b44f06c3bcd85141), [`1d877b8`](https://github.com/mastra-ai/mastra/commit/1d877b8d7b536a251c1a7a18db7ddcf4f68d6f8b)]:
|
|
48
|
+
- @mastra/core@1.0.0-beta.7
|
|
49
|
+
|
|
3
50
|
## 1.0.0-beta.2
|
|
4
51
|
|
|
5
52
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -116,7 +116,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
116
116
|
} catch (error$1) {
|
|
117
117
|
throw new error.MastraError(
|
|
118
118
|
{
|
|
119
|
-
id: "
|
|
119
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
120
120
|
domain: error.ErrorDomain.STORAGE,
|
|
121
121
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
122
122
|
details: { messageIds: JSON.stringify(messageIds) }
|
|
@@ -132,7 +132,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
132
132
|
if (page < 0) {
|
|
133
133
|
throw new error.MastraError(
|
|
134
134
|
{
|
|
135
|
-
id: "
|
|
135
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
136
136
|
domain: error.ErrorDomain.STORAGE,
|
|
137
137
|
category: error.ErrorCategory.USER,
|
|
138
138
|
details: { page }
|
|
@@ -143,7 +143,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
143
143
|
if (threadIds.length === 0) {
|
|
144
144
|
throw new error.MastraError(
|
|
145
145
|
{
|
|
146
|
-
id: "
|
|
146
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
147
147
|
domain: error.ErrorDomain.STORAGE,
|
|
148
148
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
149
149
|
details: { threadId: Array.isArray(threadId) ? JSON.stringify(threadId) : String(threadId) }
|
|
@@ -348,7 +348,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
348
348
|
} catch (error$1) {
|
|
349
349
|
const mastraError = new error.MastraError(
|
|
350
350
|
{
|
|
351
|
-
id: "
|
|
351
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "FAILED"),
|
|
352
352
|
domain: error.ErrorDomain.STORAGE,
|
|
353
353
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
354
354
|
details: {
|
|
@@ -511,7 +511,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
511
511
|
} catch (error$1) {
|
|
512
512
|
throw new error.MastraError(
|
|
513
513
|
{
|
|
514
|
-
id: "
|
|
514
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "SAVE_MESSAGES", "FAILED"),
|
|
515
515
|
domain: error.ErrorDomain.STORAGE,
|
|
516
516
|
category: error.ErrorCategory.THIRD_PARTY
|
|
517
517
|
},
|
|
@@ -556,7 +556,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
556
556
|
} catch (error$1) {
|
|
557
557
|
throw new error.MastraError(
|
|
558
558
|
{
|
|
559
|
-
id: "
|
|
559
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "GET_THREAD_BY_ID", "FAILED"),
|
|
560
560
|
domain: error.ErrorDomain.STORAGE,
|
|
561
561
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
562
562
|
details: { threadId }
|
|
@@ -589,7 +589,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
589
589
|
} catch (error$1) {
|
|
590
590
|
throw new error.MastraError(
|
|
591
591
|
{
|
|
592
|
-
id: "
|
|
592
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "SAVE_THREAD", "FAILED"),
|
|
593
593
|
domain: error.ErrorDomain.STORAGE,
|
|
594
594
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
595
595
|
details: { threadId: thread.id }
|
|
@@ -641,7 +641,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
641
641
|
} catch (error$1) {
|
|
642
642
|
throw new error.MastraError(
|
|
643
643
|
{
|
|
644
|
-
id: "
|
|
644
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "UPDATE_THREAD", "FAILED"),
|
|
645
645
|
domain: error.ErrorDomain.STORAGE,
|
|
646
646
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
647
647
|
details: { threadId: id, title }
|
|
@@ -669,7 +669,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
669
669
|
} catch (error$1) {
|
|
670
670
|
throw new error.MastraError(
|
|
671
671
|
{
|
|
672
|
-
id: "
|
|
672
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "DELETE_THREAD", "FAILED"),
|
|
673
673
|
domain: error.ErrorDomain.STORAGE,
|
|
674
674
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
675
675
|
details: { threadId }
|
|
@@ -684,7 +684,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
684
684
|
if (page < 0) {
|
|
685
685
|
throw new error.MastraError(
|
|
686
686
|
{
|
|
687
|
-
id: "
|
|
687
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
688
688
|
domain: error.ErrorDomain.STORAGE,
|
|
689
689
|
category: error.ErrorCategory.USER,
|
|
690
690
|
details: { page }
|
|
@@ -769,7 +769,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
769
769
|
} catch (error$1) {
|
|
770
770
|
throw new error.MastraError(
|
|
771
771
|
{
|
|
772
|
-
id: "
|
|
772
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
773
773
|
domain: error.ErrorDomain.STORAGE,
|
|
774
774
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
775
775
|
details: { resourceId, page }
|
|
@@ -1051,7 +1051,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
1051
1051
|
} catch (error$1) {
|
|
1052
1052
|
throw new error.MastraError(
|
|
1053
1053
|
{
|
|
1054
|
-
id: "
|
|
1054
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "UPDATE_MESSAGES", "FAILED"),
|
|
1055
1055
|
domain: error.ErrorDomain.STORAGE,
|
|
1056
1056
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1057
1057
|
details: { messageIds: messages.map((m) => m.id).join(",") }
|
|
@@ -1087,7 +1087,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
1087
1087
|
} catch (error$1) {
|
|
1088
1088
|
throw new error.MastraError(
|
|
1089
1089
|
{
|
|
1090
|
-
id: "
|
|
1090
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
1091
1091
|
domain: error.ErrorDomain.STORAGE,
|
|
1092
1092
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1093
1093
|
details: { resourceId }
|
|
@@ -1120,7 +1120,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
1120
1120
|
} catch (error$1) {
|
|
1121
1121
|
throw new error.MastraError(
|
|
1122
1122
|
{
|
|
1123
|
-
id: "
|
|
1123
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "SAVE_RESOURCE", "FAILED"),
|
|
1124
1124
|
domain: error.ErrorDomain.STORAGE,
|
|
1125
1125
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1126
1126
|
details: { resourceId: resource.id }
|
|
@@ -1186,7 +1186,7 @@ var MemoryStorageClickhouse = class extends storage.MemoryStorage {
|
|
|
1186
1186
|
} catch (error$1) {
|
|
1187
1187
|
throw new error.MastraError(
|
|
1188
1188
|
{
|
|
1189
|
-
id: "
|
|
1189
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "UPDATE_RESOURCE", "FAILED"),
|
|
1190
1190
|
domain: error.ErrorDomain.STORAGE,
|
|
1191
1191
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1192
1192
|
details: { resourceId }
|
|
@@ -1274,7 +1274,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1274
1274
|
} catch (error$1) {
|
|
1275
1275
|
throw new error.MastraError(
|
|
1276
1276
|
{
|
|
1277
|
-
id: "
|
|
1277
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "CREATE_TABLE", "FAILED"),
|
|
1278
1278
|
domain: error.ErrorDomain.STORAGE,
|
|
1279
1279
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1280
1280
|
details: { tableName }
|
|
@@ -1313,7 +1313,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1313
1313
|
} catch (error$1) {
|
|
1314
1314
|
throw new error.MastraError(
|
|
1315
1315
|
{
|
|
1316
|
-
id: "
|
|
1316
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "ALTER_TABLE", "FAILED"),
|
|
1317
1317
|
domain: error.ErrorDomain.STORAGE,
|
|
1318
1318
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1319
1319
|
details: { tableName }
|
|
@@ -1337,7 +1337,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1337
1337
|
} catch (error$1) {
|
|
1338
1338
|
throw new error.MastraError(
|
|
1339
1339
|
{
|
|
1340
|
-
id: "
|
|
1340
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "CLEAR_TABLE", "FAILED"),
|
|
1341
1341
|
domain: error.ErrorDomain.STORAGE,
|
|
1342
1342
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1343
1343
|
details: { tableName }
|
|
@@ -1376,7 +1376,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1376
1376
|
} catch (error$1) {
|
|
1377
1377
|
throw new error.MastraError(
|
|
1378
1378
|
{
|
|
1379
|
-
id: "
|
|
1379
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "INSERT", "FAILED"),
|
|
1380
1380
|
domain: error.ErrorDomain.STORAGE,
|
|
1381
1381
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1382
1382
|
details: { tableName }
|
|
@@ -1409,7 +1409,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1409
1409
|
} catch (error$1) {
|
|
1410
1410
|
throw new error.MastraError(
|
|
1411
1411
|
{
|
|
1412
|
-
id: "
|
|
1412
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "BATCH_INSERT", "FAILED"),
|
|
1413
1413
|
domain: error.ErrorDomain.STORAGE,
|
|
1414
1414
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1415
1415
|
details: { tableName }
|
|
@@ -1460,7 +1460,7 @@ var StoreOperationsClickhouse = class extends storage.StoreOperations {
|
|
|
1460
1460
|
} catch (error$1) {
|
|
1461
1461
|
throw new error.MastraError(
|
|
1462
1462
|
{
|
|
1463
|
-
id: "
|
|
1463
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LOAD", "FAILED"),
|
|
1464
1464
|
domain: error.ErrorDomain.STORAGE,
|
|
1465
1465
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1466
1466
|
details: { tableName }
|
|
@@ -1510,7 +1510,7 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1510
1510
|
} catch (error$1) {
|
|
1511
1511
|
throw new error.MastraError(
|
|
1512
1512
|
{
|
|
1513
|
-
id: "
|
|
1513
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "GET_SCORE_BY_ID", "FAILED"),
|
|
1514
1514
|
domain: error.ErrorDomain.STORAGE,
|
|
1515
1515
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1516
1516
|
details: { scoreId: id }
|
|
@@ -1526,22 +1526,36 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1526
1526
|
} catch (error$1) {
|
|
1527
1527
|
throw new error.MastraError(
|
|
1528
1528
|
{
|
|
1529
|
-
id: "
|
|
1529
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
1530
1530
|
domain: error.ErrorDomain.STORAGE,
|
|
1531
1531
|
category: error.ErrorCategory.USER,
|
|
1532
|
-
details: {
|
|
1532
|
+
details: {
|
|
1533
|
+
scorer: score.scorer?.id ?? "unknown",
|
|
1534
|
+
entityId: score.entityId ?? "unknown",
|
|
1535
|
+
entityType: score.entityType ?? "unknown",
|
|
1536
|
+
traceId: score.traceId ?? "",
|
|
1537
|
+
spanId: score.spanId ?? ""
|
|
1538
|
+
}
|
|
1533
1539
|
},
|
|
1534
1540
|
error$1
|
|
1535
1541
|
);
|
|
1536
1542
|
}
|
|
1543
|
+
const now = /* @__PURE__ */ new Date();
|
|
1544
|
+
const id = crypto.randomUUID();
|
|
1545
|
+
const createdAt = now;
|
|
1546
|
+
const updatedAt = now;
|
|
1537
1547
|
try {
|
|
1538
1548
|
const record = {};
|
|
1539
1549
|
for (const key of Object.keys(storage.SCORERS_SCHEMA)) {
|
|
1540
|
-
|
|
1550
|
+
if (key === "id") {
|
|
1551
|
+
record[key] = id;
|
|
1552
|
+
continue;
|
|
1553
|
+
}
|
|
1541
1554
|
if (key === "createdAt" || key === "updatedAt") {
|
|
1542
|
-
record[key] =
|
|
1555
|
+
record[key] = now.toISOString();
|
|
1543
1556
|
continue;
|
|
1544
1557
|
}
|
|
1558
|
+
const value = parsedScore[key];
|
|
1545
1559
|
record[key] = value === void 0 || value === null ? "_null_" : value;
|
|
1546
1560
|
}
|
|
1547
1561
|
await this.client.insert({
|
|
@@ -1554,14 +1568,14 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1554
1568
|
output_format_json_quote_64bit_integers: 0
|
|
1555
1569
|
}
|
|
1556
1570
|
});
|
|
1557
|
-
return { score };
|
|
1571
|
+
return { score: { ...parsedScore, id, createdAt, updatedAt } };
|
|
1558
1572
|
} catch (error$1) {
|
|
1559
1573
|
throw new error.MastraError(
|
|
1560
1574
|
{
|
|
1561
|
-
id: "
|
|
1575
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "SAVE_SCORE", "FAILED"),
|
|
1562
1576
|
domain: error.ErrorDomain.STORAGE,
|
|
1563
1577
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1564
|
-
details: { scoreId:
|
|
1578
|
+
details: { scoreId: id }
|
|
1565
1579
|
},
|
|
1566
1580
|
error$1
|
|
1567
1581
|
);
|
|
@@ -1628,7 +1642,7 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1628
1642
|
} catch (error$1) {
|
|
1629
1643
|
throw new error.MastraError(
|
|
1630
1644
|
{
|
|
1631
|
-
id: "
|
|
1645
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
1632
1646
|
domain: error.ErrorDomain.STORAGE,
|
|
1633
1647
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1634
1648
|
details: { runId }
|
|
@@ -1719,7 +1733,7 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1719
1733
|
} catch (error$1) {
|
|
1720
1734
|
throw new error.MastraError(
|
|
1721
1735
|
{
|
|
1722
|
-
id: "
|
|
1736
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1723
1737
|
domain: error.ErrorDomain.STORAGE,
|
|
1724
1738
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1725
1739
|
details: { scorerId }
|
|
@@ -1791,7 +1805,7 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1791
1805
|
} catch (error$1) {
|
|
1792
1806
|
throw new error.MastraError(
|
|
1793
1807
|
{
|
|
1794
|
-
id: "
|
|
1808
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1795
1809
|
domain: error.ErrorDomain.STORAGE,
|
|
1796
1810
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1797
1811
|
details: { entityId, entityType }
|
|
@@ -1866,7 +1880,7 @@ var ScoresStorageClickhouse = class extends storage.ScoresStorage {
|
|
|
1866
1880
|
} catch (error$1) {
|
|
1867
1881
|
throw new error.MastraError(
|
|
1868
1882
|
{
|
|
1869
|
-
id: "
|
|
1883
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
1870
1884
|
domain: error.ErrorDomain.STORAGE,
|
|
1871
1885
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1872
1886
|
details: { traceId, spanId }
|
|
@@ -1891,14 +1905,24 @@ var WorkflowsStorageClickhouse = class extends storage.WorkflowsStorage {
|
|
|
1891
1905
|
// result,
|
|
1892
1906
|
// requestContext,
|
|
1893
1907
|
}) {
|
|
1894
|
-
throw new
|
|
1908
|
+
throw new error.MastraError({
|
|
1909
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "UPDATE_WORKFLOW_RESULTS", "NOT_IMPLEMENTED"),
|
|
1910
|
+
domain: error.ErrorDomain.STORAGE,
|
|
1911
|
+
category: error.ErrorCategory.SYSTEM,
|
|
1912
|
+
text: "Method not implemented."
|
|
1913
|
+
});
|
|
1895
1914
|
}
|
|
1896
1915
|
updateWorkflowState({
|
|
1897
1916
|
// workflowName,
|
|
1898
1917
|
// runId,
|
|
1899
1918
|
// opts,
|
|
1900
1919
|
}) {
|
|
1901
|
-
throw new
|
|
1920
|
+
throw new error.MastraError({
|
|
1921
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "UPDATE_WORKFLOW_STATE", "NOT_IMPLEMENTED"),
|
|
1922
|
+
domain: error.ErrorDomain.STORAGE,
|
|
1923
|
+
category: error.ErrorCategory.SYSTEM,
|
|
1924
|
+
text: "Method not implemented."
|
|
1925
|
+
});
|
|
1902
1926
|
}
|
|
1903
1927
|
async persistWorkflowSnapshot({
|
|
1904
1928
|
workflowName,
|
|
@@ -1939,7 +1963,7 @@ var WorkflowsStorageClickhouse = class extends storage.WorkflowsStorage {
|
|
|
1939
1963
|
} catch (error$1) {
|
|
1940
1964
|
throw new error.MastraError(
|
|
1941
1965
|
{
|
|
1942
|
-
id: "
|
|
1966
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1943
1967
|
domain: error.ErrorDomain.STORAGE,
|
|
1944
1968
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1945
1969
|
details: { workflowName, runId }
|
|
@@ -1967,7 +1991,7 @@ var WorkflowsStorageClickhouse = class extends storage.WorkflowsStorage {
|
|
|
1967
1991
|
} catch (error$1) {
|
|
1968
1992
|
throw new error.MastraError(
|
|
1969
1993
|
{
|
|
1970
|
-
id: "
|
|
1994
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1971
1995
|
domain: error.ErrorDomain.STORAGE,
|
|
1972
1996
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
1973
1997
|
details: { workflowName, runId }
|
|
@@ -2074,7 +2098,7 @@ var WorkflowsStorageClickhouse = class extends storage.WorkflowsStorage {
|
|
|
2074
2098
|
} catch (error$1) {
|
|
2075
2099
|
throw new error.MastraError(
|
|
2076
2100
|
{
|
|
2077
|
-
id: "
|
|
2101
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
2078
2102
|
domain: error.ErrorDomain.STORAGE,
|
|
2079
2103
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2080
2104
|
details: { workflowName: workflowName ?? "", resourceId: resourceId ?? "" }
|
|
@@ -2123,7 +2147,7 @@ var WorkflowsStorageClickhouse = class extends storage.WorkflowsStorage {
|
|
|
2123
2147
|
} catch (error$1) {
|
|
2124
2148
|
throw new error.MastraError(
|
|
2125
2149
|
{
|
|
2126
|
-
id: "
|
|
2150
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
2127
2151
|
domain: error.ErrorDomain.STORAGE,
|
|
2128
2152
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2129
2153
|
details: { runId: runId ?? "", workflowName: workflowName ?? "" }
|
|
@@ -2140,7 +2164,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
2140
2164
|
ttl = {};
|
|
2141
2165
|
stores;
|
|
2142
2166
|
constructor(config) {
|
|
2143
|
-
super({ id: config.id, name: "ClickhouseStore" });
|
|
2167
|
+
super({ id: config.id, name: "ClickhouseStore", disableInit: config.disableInit });
|
|
2144
2168
|
this.db = client.createClient({
|
|
2145
2169
|
url: config.url,
|
|
2146
2170
|
username: config.username,
|
|
@@ -2186,7 +2210,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
2186
2210
|
} catch (error$1) {
|
|
2187
2211
|
throw new error.MastraError(
|
|
2188
2212
|
{
|
|
2189
|
-
id: "
|
|
2213
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "OPTIMIZE_TABLE", "FAILED"),
|
|
2190
2214
|
domain: error.ErrorDomain.STORAGE,
|
|
2191
2215
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2192
2216
|
details: { tableName }
|
|
@@ -2203,7 +2227,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
2203
2227
|
} catch (error$1) {
|
|
2204
2228
|
throw new error.MastraError(
|
|
2205
2229
|
{
|
|
2206
|
-
id: "
|
|
2230
|
+
id: storage.createStorageErrorId("CLICKHOUSE", "MATERIALIZE_TTL", "FAILED"),
|
|
2207
2231
|
domain: error.ErrorDomain.STORAGE,
|
|
2208
2232
|
category: error.ErrorCategory.THIRD_PARTY,
|
|
2209
2233
|
details: { tableName }
|
|
@@ -2314,8 +2338,8 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
2314
2338
|
async getScoreById({ id }) {
|
|
2315
2339
|
return this.stores.scores.getScoreById({ id });
|
|
2316
2340
|
}
|
|
2317
|
-
async saveScore(
|
|
2318
|
-
return this.stores.scores.saveScore(
|
|
2341
|
+
async saveScore(score) {
|
|
2342
|
+
return this.stores.scores.saveScore(score);
|
|
2319
2343
|
}
|
|
2320
2344
|
async listScoresByRunId({
|
|
2321
2345
|
runId,
|