@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/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createClient } from '@clickhouse/client';
|
|
2
2
|
import { MastraError, ErrorCategory, ErrorDomain } from '@mastra/core/error';
|
|
3
|
-
import { TABLE_SPANS, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, StoreOperations, TABLE_SCHEMAS, WorkflowsStorage, normalizePerPage, ScoresStorage, transformScoreRow, SCORERS_SCHEMA, calculatePagination, MemoryStorage, safelyParseJSON } from '@mastra/core/storage';
|
|
3
|
+
import { TABLE_SPANS, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, createStorageErrorId, StoreOperations, TABLE_SCHEMAS, WorkflowsStorage, normalizePerPage, ScoresStorage, transformScoreRow, SCORERS_SCHEMA, calculatePagination, MemoryStorage, safelyParseJSON } from '@mastra/core/storage';
|
|
4
4
|
import { MessageList } from '@mastra/core/agent';
|
|
5
5
|
import { saveScorePayloadSchema } from '@mastra/core/evals';
|
|
6
6
|
|
|
@@ -114,7 +114,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
114
114
|
} catch (error) {
|
|
115
115
|
throw new MastraError(
|
|
116
116
|
{
|
|
117
|
-
id: "
|
|
117
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES_BY_ID", "FAILED"),
|
|
118
118
|
domain: ErrorDomain.STORAGE,
|
|
119
119
|
category: ErrorCategory.THIRD_PARTY,
|
|
120
120
|
details: { messageIds: JSON.stringify(messageIds) }
|
|
@@ -130,7 +130,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
130
130
|
if (page < 0) {
|
|
131
131
|
throw new MastraError(
|
|
132
132
|
{
|
|
133
|
-
id: "
|
|
133
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "INVALID_PAGE"),
|
|
134
134
|
domain: ErrorDomain.STORAGE,
|
|
135
135
|
category: ErrorCategory.USER,
|
|
136
136
|
details: { page }
|
|
@@ -141,7 +141,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
141
141
|
if (threadIds.length === 0) {
|
|
142
142
|
throw new MastraError(
|
|
143
143
|
{
|
|
144
|
-
id: "
|
|
144
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "INVALID_THREAD_ID"),
|
|
145
145
|
domain: ErrorDomain.STORAGE,
|
|
146
146
|
category: ErrorCategory.THIRD_PARTY,
|
|
147
147
|
details: { threadId: Array.isArray(threadId) ? JSON.stringify(threadId) : String(threadId) }
|
|
@@ -346,7 +346,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
346
346
|
} catch (error) {
|
|
347
347
|
const mastraError = new MastraError(
|
|
348
348
|
{
|
|
349
|
-
id: "
|
|
349
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_MESSAGES", "FAILED"),
|
|
350
350
|
domain: ErrorDomain.STORAGE,
|
|
351
351
|
category: ErrorCategory.THIRD_PARTY,
|
|
352
352
|
details: {
|
|
@@ -509,7 +509,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
509
509
|
} catch (error) {
|
|
510
510
|
throw new MastraError(
|
|
511
511
|
{
|
|
512
|
-
id: "
|
|
512
|
+
id: createStorageErrorId("CLICKHOUSE", "SAVE_MESSAGES", "FAILED"),
|
|
513
513
|
domain: ErrorDomain.STORAGE,
|
|
514
514
|
category: ErrorCategory.THIRD_PARTY
|
|
515
515
|
},
|
|
@@ -554,7 +554,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
554
554
|
} catch (error) {
|
|
555
555
|
throw new MastraError(
|
|
556
556
|
{
|
|
557
|
-
id: "
|
|
557
|
+
id: createStorageErrorId("CLICKHOUSE", "GET_THREAD_BY_ID", "FAILED"),
|
|
558
558
|
domain: ErrorDomain.STORAGE,
|
|
559
559
|
category: ErrorCategory.THIRD_PARTY,
|
|
560
560
|
details: { threadId }
|
|
@@ -587,7 +587,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
587
587
|
} catch (error) {
|
|
588
588
|
throw new MastraError(
|
|
589
589
|
{
|
|
590
|
-
id: "
|
|
590
|
+
id: createStorageErrorId("CLICKHOUSE", "SAVE_THREAD", "FAILED"),
|
|
591
591
|
domain: ErrorDomain.STORAGE,
|
|
592
592
|
category: ErrorCategory.THIRD_PARTY,
|
|
593
593
|
details: { threadId: thread.id }
|
|
@@ -639,7 +639,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
639
639
|
} catch (error) {
|
|
640
640
|
throw new MastraError(
|
|
641
641
|
{
|
|
642
|
-
id: "
|
|
642
|
+
id: createStorageErrorId("CLICKHOUSE", "UPDATE_THREAD", "FAILED"),
|
|
643
643
|
domain: ErrorDomain.STORAGE,
|
|
644
644
|
category: ErrorCategory.THIRD_PARTY,
|
|
645
645
|
details: { threadId: id, title }
|
|
@@ -667,7 +667,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
667
667
|
} catch (error) {
|
|
668
668
|
throw new MastraError(
|
|
669
669
|
{
|
|
670
|
-
id: "
|
|
670
|
+
id: createStorageErrorId("CLICKHOUSE", "DELETE_THREAD", "FAILED"),
|
|
671
671
|
domain: ErrorDomain.STORAGE,
|
|
672
672
|
category: ErrorCategory.THIRD_PARTY,
|
|
673
673
|
details: { threadId }
|
|
@@ -682,7 +682,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
682
682
|
if (page < 0) {
|
|
683
683
|
throw new MastraError(
|
|
684
684
|
{
|
|
685
|
-
id: "
|
|
685
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_THREADS_BY_RESOURCE_ID", "INVALID_PAGE"),
|
|
686
686
|
domain: ErrorDomain.STORAGE,
|
|
687
687
|
category: ErrorCategory.USER,
|
|
688
688
|
details: { page }
|
|
@@ -767,7 +767,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
767
767
|
} catch (error) {
|
|
768
768
|
throw new MastraError(
|
|
769
769
|
{
|
|
770
|
-
id: "
|
|
770
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_THREADS_BY_RESOURCE_ID", "FAILED"),
|
|
771
771
|
domain: ErrorDomain.STORAGE,
|
|
772
772
|
category: ErrorCategory.THIRD_PARTY,
|
|
773
773
|
details: { resourceId, page }
|
|
@@ -1049,7 +1049,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
1049
1049
|
} catch (error) {
|
|
1050
1050
|
throw new MastraError(
|
|
1051
1051
|
{
|
|
1052
|
-
id: "
|
|
1052
|
+
id: createStorageErrorId("CLICKHOUSE", "UPDATE_MESSAGES", "FAILED"),
|
|
1053
1053
|
domain: ErrorDomain.STORAGE,
|
|
1054
1054
|
category: ErrorCategory.THIRD_PARTY,
|
|
1055
1055
|
details: { messageIds: messages.map((m) => m.id).join(",") }
|
|
@@ -1085,7 +1085,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
1085
1085
|
} catch (error) {
|
|
1086
1086
|
throw new MastraError(
|
|
1087
1087
|
{
|
|
1088
|
-
id: "
|
|
1088
|
+
id: createStorageErrorId("CLICKHOUSE", "GET_RESOURCE_BY_ID", "FAILED"),
|
|
1089
1089
|
domain: ErrorDomain.STORAGE,
|
|
1090
1090
|
category: ErrorCategory.THIRD_PARTY,
|
|
1091
1091
|
details: { resourceId }
|
|
@@ -1118,7 +1118,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
1118
1118
|
} catch (error) {
|
|
1119
1119
|
throw new MastraError(
|
|
1120
1120
|
{
|
|
1121
|
-
id: "
|
|
1121
|
+
id: createStorageErrorId("CLICKHOUSE", "SAVE_RESOURCE", "FAILED"),
|
|
1122
1122
|
domain: ErrorDomain.STORAGE,
|
|
1123
1123
|
category: ErrorCategory.THIRD_PARTY,
|
|
1124
1124
|
details: { resourceId: resource.id }
|
|
@@ -1184,7 +1184,7 @@ var MemoryStorageClickhouse = class extends MemoryStorage {
|
|
|
1184
1184
|
} catch (error) {
|
|
1185
1185
|
throw new MastraError(
|
|
1186
1186
|
{
|
|
1187
|
-
id: "
|
|
1187
|
+
id: createStorageErrorId("CLICKHOUSE", "UPDATE_RESOURCE", "FAILED"),
|
|
1188
1188
|
domain: ErrorDomain.STORAGE,
|
|
1189
1189
|
category: ErrorCategory.THIRD_PARTY,
|
|
1190
1190
|
details: { resourceId }
|
|
@@ -1272,7 +1272,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1272
1272
|
} catch (error) {
|
|
1273
1273
|
throw new MastraError(
|
|
1274
1274
|
{
|
|
1275
|
-
id: "
|
|
1275
|
+
id: createStorageErrorId("CLICKHOUSE", "CREATE_TABLE", "FAILED"),
|
|
1276
1276
|
domain: ErrorDomain.STORAGE,
|
|
1277
1277
|
category: ErrorCategory.THIRD_PARTY,
|
|
1278
1278
|
details: { tableName }
|
|
@@ -1311,7 +1311,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1311
1311
|
} catch (error) {
|
|
1312
1312
|
throw new MastraError(
|
|
1313
1313
|
{
|
|
1314
|
-
id: "
|
|
1314
|
+
id: createStorageErrorId("CLICKHOUSE", "ALTER_TABLE", "FAILED"),
|
|
1315
1315
|
domain: ErrorDomain.STORAGE,
|
|
1316
1316
|
category: ErrorCategory.THIRD_PARTY,
|
|
1317
1317
|
details: { tableName }
|
|
@@ -1335,7 +1335,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1335
1335
|
} catch (error) {
|
|
1336
1336
|
throw new MastraError(
|
|
1337
1337
|
{
|
|
1338
|
-
id: "
|
|
1338
|
+
id: createStorageErrorId("CLICKHOUSE", "CLEAR_TABLE", "FAILED"),
|
|
1339
1339
|
domain: ErrorDomain.STORAGE,
|
|
1340
1340
|
category: ErrorCategory.THIRD_PARTY,
|
|
1341
1341
|
details: { tableName }
|
|
@@ -1374,7 +1374,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1374
1374
|
} catch (error) {
|
|
1375
1375
|
throw new MastraError(
|
|
1376
1376
|
{
|
|
1377
|
-
id: "
|
|
1377
|
+
id: createStorageErrorId("CLICKHOUSE", "INSERT", "FAILED"),
|
|
1378
1378
|
domain: ErrorDomain.STORAGE,
|
|
1379
1379
|
category: ErrorCategory.THIRD_PARTY,
|
|
1380
1380
|
details: { tableName }
|
|
@@ -1407,7 +1407,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1407
1407
|
} catch (error) {
|
|
1408
1408
|
throw new MastraError(
|
|
1409
1409
|
{
|
|
1410
|
-
id: "
|
|
1410
|
+
id: createStorageErrorId("CLICKHOUSE", "BATCH_INSERT", "FAILED"),
|
|
1411
1411
|
domain: ErrorDomain.STORAGE,
|
|
1412
1412
|
category: ErrorCategory.THIRD_PARTY,
|
|
1413
1413
|
details: { tableName }
|
|
@@ -1458,7 +1458,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
|
|
|
1458
1458
|
} catch (error) {
|
|
1459
1459
|
throw new MastraError(
|
|
1460
1460
|
{
|
|
1461
|
-
id: "
|
|
1461
|
+
id: createStorageErrorId("CLICKHOUSE", "LOAD", "FAILED"),
|
|
1462
1462
|
domain: ErrorDomain.STORAGE,
|
|
1463
1463
|
category: ErrorCategory.THIRD_PARTY,
|
|
1464
1464
|
details: { tableName }
|
|
@@ -1508,7 +1508,7 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1508
1508
|
} catch (error) {
|
|
1509
1509
|
throw new MastraError(
|
|
1510
1510
|
{
|
|
1511
|
-
id: "
|
|
1511
|
+
id: createStorageErrorId("CLICKHOUSE", "GET_SCORE_BY_ID", "FAILED"),
|
|
1512
1512
|
domain: ErrorDomain.STORAGE,
|
|
1513
1513
|
category: ErrorCategory.THIRD_PARTY,
|
|
1514
1514
|
details: { scoreId: id }
|
|
@@ -1524,22 +1524,36 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1524
1524
|
} catch (error) {
|
|
1525
1525
|
throw new MastraError(
|
|
1526
1526
|
{
|
|
1527
|
-
id: "
|
|
1527
|
+
id: createStorageErrorId("CLICKHOUSE", "SAVE_SCORE", "VALIDATION_FAILED"),
|
|
1528
1528
|
domain: ErrorDomain.STORAGE,
|
|
1529
1529
|
category: ErrorCategory.USER,
|
|
1530
|
-
details: {
|
|
1530
|
+
details: {
|
|
1531
|
+
scorer: score.scorer?.id ?? "unknown",
|
|
1532
|
+
entityId: score.entityId ?? "unknown",
|
|
1533
|
+
entityType: score.entityType ?? "unknown",
|
|
1534
|
+
traceId: score.traceId ?? "",
|
|
1535
|
+
spanId: score.spanId ?? ""
|
|
1536
|
+
}
|
|
1531
1537
|
},
|
|
1532
1538
|
error
|
|
1533
1539
|
);
|
|
1534
1540
|
}
|
|
1541
|
+
const now = /* @__PURE__ */ new Date();
|
|
1542
|
+
const id = crypto.randomUUID();
|
|
1543
|
+
const createdAt = now;
|
|
1544
|
+
const updatedAt = now;
|
|
1535
1545
|
try {
|
|
1536
1546
|
const record = {};
|
|
1537
1547
|
for (const key of Object.keys(SCORERS_SCHEMA)) {
|
|
1538
|
-
|
|
1548
|
+
if (key === "id") {
|
|
1549
|
+
record[key] = id;
|
|
1550
|
+
continue;
|
|
1551
|
+
}
|
|
1539
1552
|
if (key === "createdAt" || key === "updatedAt") {
|
|
1540
|
-
record[key] =
|
|
1553
|
+
record[key] = now.toISOString();
|
|
1541
1554
|
continue;
|
|
1542
1555
|
}
|
|
1556
|
+
const value = parsedScore[key];
|
|
1543
1557
|
record[key] = value === void 0 || value === null ? "_null_" : value;
|
|
1544
1558
|
}
|
|
1545
1559
|
await this.client.insert({
|
|
@@ -1552,14 +1566,14 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1552
1566
|
output_format_json_quote_64bit_integers: 0
|
|
1553
1567
|
}
|
|
1554
1568
|
});
|
|
1555
|
-
return { score };
|
|
1569
|
+
return { score: { ...parsedScore, id, createdAt, updatedAt } };
|
|
1556
1570
|
} catch (error) {
|
|
1557
1571
|
throw new MastraError(
|
|
1558
1572
|
{
|
|
1559
|
-
id: "
|
|
1573
|
+
id: createStorageErrorId("CLICKHOUSE", "SAVE_SCORE", "FAILED"),
|
|
1560
1574
|
domain: ErrorDomain.STORAGE,
|
|
1561
1575
|
category: ErrorCategory.THIRD_PARTY,
|
|
1562
|
-
details: { scoreId:
|
|
1576
|
+
details: { scoreId: id }
|
|
1563
1577
|
},
|
|
1564
1578
|
error
|
|
1565
1579
|
);
|
|
@@ -1626,7 +1640,7 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1626
1640
|
} catch (error) {
|
|
1627
1641
|
throw new MastraError(
|
|
1628
1642
|
{
|
|
1629
|
-
id: "
|
|
1643
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_RUN_ID", "FAILED"),
|
|
1630
1644
|
domain: ErrorDomain.STORAGE,
|
|
1631
1645
|
category: ErrorCategory.THIRD_PARTY,
|
|
1632
1646
|
details: { runId }
|
|
@@ -1717,7 +1731,7 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1717
1731
|
} catch (error) {
|
|
1718
1732
|
throw new MastraError(
|
|
1719
1733
|
{
|
|
1720
|
-
id: "
|
|
1734
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_SCORER_ID", "FAILED"),
|
|
1721
1735
|
domain: ErrorDomain.STORAGE,
|
|
1722
1736
|
category: ErrorCategory.THIRD_PARTY,
|
|
1723
1737
|
details: { scorerId }
|
|
@@ -1789,7 +1803,7 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1789
1803
|
} catch (error) {
|
|
1790
1804
|
throw new MastraError(
|
|
1791
1805
|
{
|
|
1792
|
-
id: "
|
|
1806
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_ENTITY_ID", "FAILED"),
|
|
1793
1807
|
domain: ErrorDomain.STORAGE,
|
|
1794
1808
|
category: ErrorCategory.THIRD_PARTY,
|
|
1795
1809
|
details: { entityId, entityType }
|
|
@@ -1864,7 +1878,7 @@ var ScoresStorageClickhouse = class extends ScoresStorage {
|
|
|
1864
1878
|
} catch (error) {
|
|
1865
1879
|
throw new MastraError(
|
|
1866
1880
|
{
|
|
1867
|
-
id: "
|
|
1881
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_SCORES_BY_SPAN", "FAILED"),
|
|
1868
1882
|
domain: ErrorDomain.STORAGE,
|
|
1869
1883
|
category: ErrorCategory.THIRD_PARTY,
|
|
1870
1884
|
details: { traceId, spanId }
|
|
@@ -1889,14 +1903,24 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
1889
1903
|
// result,
|
|
1890
1904
|
// requestContext,
|
|
1891
1905
|
}) {
|
|
1892
|
-
throw new
|
|
1906
|
+
throw new MastraError({
|
|
1907
|
+
id: createStorageErrorId("CLICKHOUSE", "UPDATE_WORKFLOW_RESULTS", "NOT_IMPLEMENTED"),
|
|
1908
|
+
domain: ErrorDomain.STORAGE,
|
|
1909
|
+
category: ErrorCategory.SYSTEM,
|
|
1910
|
+
text: "Method not implemented."
|
|
1911
|
+
});
|
|
1893
1912
|
}
|
|
1894
1913
|
updateWorkflowState({
|
|
1895
1914
|
// workflowName,
|
|
1896
1915
|
// runId,
|
|
1897
1916
|
// opts,
|
|
1898
1917
|
}) {
|
|
1899
|
-
throw new
|
|
1918
|
+
throw new MastraError({
|
|
1919
|
+
id: createStorageErrorId("CLICKHOUSE", "UPDATE_WORKFLOW_STATE", "NOT_IMPLEMENTED"),
|
|
1920
|
+
domain: ErrorDomain.STORAGE,
|
|
1921
|
+
category: ErrorCategory.SYSTEM,
|
|
1922
|
+
text: "Method not implemented."
|
|
1923
|
+
});
|
|
1900
1924
|
}
|
|
1901
1925
|
async persistWorkflowSnapshot({
|
|
1902
1926
|
workflowName,
|
|
@@ -1937,7 +1961,7 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
1937
1961
|
} catch (error) {
|
|
1938
1962
|
throw new MastraError(
|
|
1939
1963
|
{
|
|
1940
|
-
id: "
|
|
1964
|
+
id: createStorageErrorId("CLICKHOUSE", "PERSIST_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1941
1965
|
domain: ErrorDomain.STORAGE,
|
|
1942
1966
|
category: ErrorCategory.THIRD_PARTY,
|
|
1943
1967
|
details: { workflowName, runId }
|
|
@@ -1965,7 +1989,7 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
1965
1989
|
} catch (error) {
|
|
1966
1990
|
throw new MastraError(
|
|
1967
1991
|
{
|
|
1968
|
-
id: "
|
|
1992
|
+
id: createStorageErrorId("CLICKHOUSE", "LOAD_WORKFLOW_SNAPSHOT", "FAILED"),
|
|
1969
1993
|
domain: ErrorDomain.STORAGE,
|
|
1970
1994
|
category: ErrorCategory.THIRD_PARTY,
|
|
1971
1995
|
details: { workflowName, runId }
|
|
@@ -2072,7 +2096,7 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
2072
2096
|
} catch (error) {
|
|
2073
2097
|
throw new MastraError(
|
|
2074
2098
|
{
|
|
2075
|
-
id: "
|
|
2099
|
+
id: createStorageErrorId("CLICKHOUSE", "LIST_WORKFLOW_RUNS", "FAILED"),
|
|
2076
2100
|
domain: ErrorDomain.STORAGE,
|
|
2077
2101
|
category: ErrorCategory.THIRD_PARTY,
|
|
2078
2102
|
details: { workflowName: workflowName ?? "", resourceId: resourceId ?? "" }
|
|
@@ -2121,7 +2145,7 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
2121
2145
|
} catch (error) {
|
|
2122
2146
|
throw new MastraError(
|
|
2123
2147
|
{
|
|
2124
|
-
id: "
|
|
2148
|
+
id: createStorageErrorId("CLICKHOUSE", "GET_WORKFLOW_RUN_BY_ID", "FAILED"),
|
|
2125
2149
|
domain: ErrorDomain.STORAGE,
|
|
2126
2150
|
category: ErrorCategory.THIRD_PARTY,
|
|
2127
2151
|
details: { runId: runId ?? "", workflowName: workflowName ?? "" }
|
|
@@ -2138,7 +2162,7 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
2138
2162
|
ttl = {};
|
|
2139
2163
|
stores;
|
|
2140
2164
|
constructor(config) {
|
|
2141
|
-
super({ id: config.id, name: "ClickhouseStore" });
|
|
2165
|
+
super({ id: config.id, name: "ClickhouseStore", disableInit: config.disableInit });
|
|
2142
2166
|
this.db = createClient({
|
|
2143
2167
|
url: config.url,
|
|
2144
2168
|
username: config.username,
|
|
@@ -2184,7 +2208,7 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
2184
2208
|
} catch (error) {
|
|
2185
2209
|
throw new MastraError(
|
|
2186
2210
|
{
|
|
2187
|
-
id: "
|
|
2211
|
+
id: createStorageErrorId("CLICKHOUSE", "OPTIMIZE_TABLE", "FAILED"),
|
|
2188
2212
|
domain: ErrorDomain.STORAGE,
|
|
2189
2213
|
category: ErrorCategory.THIRD_PARTY,
|
|
2190
2214
|
details: { tableName }
|
|
@@ -2201,7 +2225,7 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
2201
2225
|
} catch (error) {
|
|
2202
2226
|
throw new MastraError(
|
|
2203
2227
|
{
|
|
2204
|
-
id: "
|
|
2228
|
+
id: createStorageErrorId("CLICKHOUSE", "MATERIALIZE_TTL", "FAILED"),
|
|
2205
2229
|
domain: ErrorDomain.STORAGE,
|
|
2206
2230
|
category: ErrorCategory.THIRD_PARTY,
|
|
2207
2231
|
details: { tableName }
|
|
@@ -2312,8 +2336,8 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
2312
2336
|
async getScoreById({ id }) {
|
|
2313
2337
|
return this.stores.scores.getScoreById({ id });
|
|
2314
2338
|
}
|
|
2315
|
-
async saveScore(
|
|
2316
|
-
return this.stores.scores.saveScore(
|
|
2339
|
+
async saveScore(score) {
|
|
2340
|
+
return this.stores.scores.saveScore(score);
|
|
2317
2341
|
}
|
|
2318
2342
|
async listScoresByRunId({
|
|
2319
2343
|
runId,
|