@mastra/clickhouse 0.13.2 → 0.13.3-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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/index.cjs +37 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +19 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +19 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/storage/domains/utils.ts +4 -0
- package/src/storage/domains/workflows/index.ts +38 -1
- package/src/storage/index.ts +35 -1
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_RESOURCES, TABLE_SCORERS, TABLE_EVALS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, StoreOperations, TABLE_SCHEMAS, WorkflowsStorage, ScoresStorage, safelyParseJSON, LegacyEvalsStorage, TracesStorage, MemoryStorage, resolveMessageLimit } from '@mastra/core/storage';
|
|
3
|
+
import { TABLE_AI_SPANS, TABLE_RESOURCES, TABLE_SCORERS, TABLE_EVALS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, StoreOperations, TABLE_SCHEMAS, WorkflowsStorage, ScoresStorage, safelyParseJSON, LegacyEvalsStorage, TracesStorage, MemoryStorage, resolveMessageLimit } from '@mastra/core/storage';
|
|
4
4
|
import { MessageList } from '@mastra/core/agent';
|
|
5
5
|
|
|
6
6
|
// src/storage/index.ts
|
|
@@ -11,7 +11,9 @@ var TABLE_ENGINES = {
|
|
|
11
11
|
[TABLE_THREADS]: `ReplacingMergeTree()`,
|
|
12
12
|
[TABLE_EVALS]: `MergeTree()`,
|
|
13
13
|
[TABLE_SCORERS]: `MergeTree()`,
|
|
14
|
-
[TABLE_RESOURCES]: `ReplacingMergeTree()
|
|
14
|
+
[TABLE_RESOURCES]: `ReplacingMergeTree()`,
|
|
15
|
+
// TODO: verify this is the correct engine for ai spans when implementing clickhouse storage
|
|
16
|
+
[TABLE_AI_SPANS]: `ReplacingMergeTree()`
|
|
15
17
|
};
|
|
16
18
|
var COLUMN_TYPES = {
|
|
17
19
|
text: "String",
|
|
@@ -20,7 +22,8 @@ var COLUMN_TYPES = {
|
|
|
20
22
|
jsonb: "String",
|
|
21
23
|
integer: "Int64",
|
|
22
24
|
float: "Float64",
|
|
23
|
-
bigint: "Int64"
|
|
25
|
+
bigint: "Int64",
|
|
26
|
+
boolean: "Bool"
|
|
24
27
|
};
|
|
25
28
|
function transformRow(row) {
|
|
26
29
|
if (!row) {
|
|
@@ -2271,6 +2274,22 @@ var WorkflowsStorageClickhouse = class extends WorkflowsStorage {
|
|
|
2271
2274
|
this.operations = operations;
|
|
2272
2275
|
this.client = client;
|
|
2273
2276
|
}
|
|
2277
|
+
updateWorkflowResults({
|
|
2278
|
+
// workflowName,
|
|
2279
|
+
// runId,
|
|
2280
|
+
// stepId,
|
|
2281
|
+
// result,
|
|
2282
|
+
// runtimeContext,
|
|
2283
|
+
}) {
|
|
2284
|
+
throw new Error("Method not implemented.");
|
|
2285
|
+
}
|
|
2286
|
+
updateWorkflowState({
|
|
2287
|
+
// workflowName,
|
|
2288
|
+
// runId,
|
|
2289
|
+
// opts,
|
|
2290
|
+
}) {
|
|
2291
|
+
throw new Error("Method not implemented.");
|
|
2292
|
+
}
|
|
2274
2293
|
async persistWorkflowSnapshot({
|
|
2275
2294
|
workflowName,
|
|
2276
2295
|
runId,
|
|
@@ -2606,6 +2625,22 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
2606
2625
|
async load({ tableName, keys }) {
|
|
2607
2626
|
return this.stores.operations.load({ tableName, keys });
|
|
2608
2627
|
}
|
|
2628
|
+
async updateWorkflowResults({
|
|
2629
|
+
workflowName,
|
|
2630
|
+
runId,
|
|
2631
|
+
stepId,
|
|
2632
|
+
result,
|
|
2633
|
+
runtimeContext
|
|
2634
|
+
}) {
|
|
2635
|
+
return this.stores.workflows.updateWorkflowResults({ workflowName, runId, stepId, result, runtimeContext });
|
|
2636
|
+
}
|
|
2637
|
+
async updateWorkflowState({
|
|
2638
|
+
workflowName,
|
|
2639
|
+
runId,
|
|
2640
|
+
opts
|
|
2641
|
+
}) {
|
|
2642
|
+
return this.stores.workflows.updateWorkflowState({ workflowName, runId, opts });
|
|
2643
|
+
}
|
|
2609
2644
|
async persistWorkflowSnapshot({
|
|
2610
2645
|
workflowName,
|
|
2611
2646
|
runId,
|