@mastra/clickhouse 0.15.8 → 1.0.0-beta.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 +221 -15
- package/README.md +47 -21
- package/dist/index.cjs +359 -906
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +359 -906
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +14 -39
- 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 +5 -5
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +3 -10
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +17 -70
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +8 -12
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -21
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -21
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
4
|
+
import type { StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput } from '@mastra/core/storage';
|
|
5
5
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
6
6
|
import type { StoreOperationsClickhouse } from '../operations/index.js';
|
|
7
7
|
export declare class MemoryStorageClickhouse extends MemoryStorage {
|
|
@@ -11,34 +11,20 @@ export declare class MemoryStorageClickhouse extends MemoryStorage {
|
|
|
11
11
|
client: ClickHouseClient;
|
|
12
12
|
operations: StoreOperationsClickhouse;
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
format?: 'v1';
|
|
16
|
-
}): Promise<MastraMessageV1[]>;
|
|
17
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
18
|
-
format: 'v2';
|
|
19
|
-
}): Promise<MastraMessageV2[]>;
|
|
20
|
-
getMessagesById({ messageIds, format, }: {
|
|
14
|
+
listMessagesById({ messageIds }: {
|
|
21
15
|
messageIds: string[];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
format?: 'v2';
|
|
27
|
-
}): Promise<MastraMessageV2[]>;
|
|
28
|
-
saveMessages(args: {
|
|
29
|
-
messages: MastraMessageV1[];
|
|
30
|
-
format?: undefined | 'v1';
|
|
31
|
-
}): Promise<MastraMessageV1[]>;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
messages: MastraDBMessage[];
|
|
18
|
+
}>;
|
|
19
|
+
listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
|
|
32
20
|
saveMessages(args: {
|
|
33
|
-
messages:
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
messages: MastraDBMessage[];
|
|
22
|
+
}): Promise<{
|
|
23
|
+
messages: MastraDBMessage[];
|
|
24
|
+
}>;
|
|
36
25
|
getThreadById({ threadId }: {
|
|
37
26
|
threadId: string;
|
|
38
27
|
}): Promise<StorageThreadType | null>;
|
|
39
|
-
getThreadsByResourceId({ resourceId }: {
|
|
40
|
-
resourceId: string;
|
|
41
|
-
}): Promise<StorageThreadType[]>;
|
|
42
28
|
saveThread({ thread }: {
|
|
43
29
|
thread: StorageThreadType;
|
|
44
30
|
}): Promise<StorageThreadType>;
|
|
@@ -50,20 +36,9 @@ export declare class MemoryStorageClickhouse extends MemoryStorage {
|
|
|
50
36
|
deleteThread({ threadId }: {
|
|
51
37
|
threadId: string;
|
|
52
38
|
}): Promise<void>;
|
|
53
|
-
|
|
54
|
-
resourceId: string;
|
|
55
|
-
page?: number;
|
|
56
|
-
perPage?: number;
|
|
57
|
-
}): Promise<PaginationInfo & {
|
|
58
|
-
threads: StorageThreadType[];
|
|
59
|
-
}>;
|
|
60
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
61
|
-
format?: 'v1' | 'v2';
|
|
62
|
-
}): Promise<PaginationInfo & {
|
|
63
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
64
|
-
}>;
|
|
39
|
+
listThreadsByResourceId(args: StorageListThreadsByResourceIdInput): Promise<StorageListThreadsByResourceIdOutput>;
|
|
65
40
|
updateMessages(args: {
|
|
66
|
-
messages: (Partial<Omit<
|
|
41
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
67
42
|
id: string;
|
|
68
43
|
threadId?: string;
|
|
69
44
|
content?: {
|
|
@@ -71,7 +46,7 @@ export declare class MemoryStorageClickhouse extends MemoryStorage {
|
|
|
71
46
|
content?: MastraMessageContentV2['content'];
|
|
72
47
|
};
|
|
73
48
|
})[];
|
|
74
|
-
}): Promise<
|
|
49
|
+
}): Promise<MastraDBMessage[]>;
|
|
75
50
|
getResourceById({ resourceId }: {
|
|
76
51
|
resourceId: string;
|
|
77
52
|
}): Promise<StorageResourceType | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oB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EjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/operations/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAA0C,MAAM,sBAAsB,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,qBAAa,yBAA0B,SAAQ,eAAe;IAC5D,SAAS,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACvC,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;gBACvB,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAC;QAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;KAAE;IAMjF,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAShE,SAAS,CAAC,UAAU,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM;IAgBnD,WAAW,CAAC,EAChB,SAAS,EACT,MAAM,GACP,EAAE;QACD,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;KACvC,GAAG,OAAO,CAAC,IAAI,CAAC;IA8DX,UAAU,CAAC,EACf,SAAS,EACT,MAAM,EACN,WAAW,GACZ,EAAE;QACD,SAAS,EAAE,WAAW,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QACtC,WAAW,EAAE,MAAM,EAAE,CAAC;KACvB,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CX,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBpE,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnE,MAAM,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCrG,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC9G,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CA6DhH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
|
-
import type { ScoreRowData, ScoringSource } from '@mastra/core/
|
|
2
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
3
3
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { PaginationInfo, StoragePagination } from '@mastra/core/storage';
|
|
5
5
|
import type { StoreOperationsClickhouse } from '../operations/index.js';
|
|
@@ -17,14 +17,14 @@ export declare class ScoresStorageClickhouse extends ScoresStorage {
|
|
|
17
17
|
saveScore(score: ScoreRowData): Promise<{
|
|
18
18
|
score: ScoreRowData;
|
|
19
19
|
}>;
|
|
20
|
-
|
|
20
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
21
21
|
runId: string;
|
|
22
22
|
pagination: StoragePagination;
|
|
23
23
|
}): Promise<{
|
|
24
24
|
pagination: PaginationInfo;
|
|
25
25
|
scores: ScoreRowData[];
|
|
26
26
|
}>;
|
|
27
|
-
|
|
27
|
+
listScoresByScorerId({ scorerId, entityId, entityType, source, pagination, }: {
|
|
28
28
|
scorerId: string;
|
|
29
29
|
pagination: StoragePagination;
|
|
30
30
|
entityId?: string;
|
|
@@ -34,7 +34,7 @@ export declare class ScoresStorageClickhouse extends ScoresStorage {
|
|
|
34
34
|
pagination: PaginationInfo;
|
|
35
35
|
scores: ScoreRowData[];
|
|
36
36
|
}>;
|
|
37
|
-
|
|
37
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
38
38
|
pagination: StoragePagination;
|
|
39
39
|
entityId: string;
|
|
40
40
|
entityType: string;
|
|
@@ -42,7 +42,7 @@ export declare class ScoresStorageClickhouse extends ScoresStorage {
|
|
|
42
42
|
pagination: PaginationInfo;
|
|
43
43
|
scores: ScoreRowData[];
|
|
44
44
|
}>;
|
|
45
|
-
|
|
45
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
46
46
|
traceId: string;
|
|
47
47
|
spanId: string;
|
|
48
48
|
pagination: StoragePagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAA6B,MAAM,
|
|
1
|
+
{"version":3,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CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IA6F7D,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IA2E7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;CA6EpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/storage/domains/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAYtF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CASrD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,CAS9D,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,YAAY,GACZ,aAAa,GACb,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;SACH,QAAQ,IAAI,WAAW,CAAC,CAAC,EAAE;YAC1B,GAAG,CAAC,EAAE;gBAAE,QAAQ,EAAE,MAAM,CAAC;gBAAC,IAAI,EAAE,YAAY,CAAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YAChE,OAAO,CAAC,EAAE,OAAO,CAAC;iBACf,SAAS,IAAI,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC,QAAQ,CAAC,GAAG;oBACrD,QAAQ,EAAE,MAAM,CAAC;oBACjB,IAAI,EAAE,YAAY,CAAC;oBACnB,MAAM,CAAC,EAAE,MAAM,CAAC;iBACjB;aACF,CAAC,CAAC;SACJ;KACF,CAAC;CACH,CAAC;AAEF,wBAAgB,YAAY,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAkB3C;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAEjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { WorkflowRun, WorkflowRuns } from '@mastra/core/storage';
|
|
3
|
+
import type { WorkflowRun, WorkflowRuns, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
4
4
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
5
5
|
import type { StoreOperationsClickhouse } from '../operations/index.js';
|
|
6
6
|
export declare class WorkflowsStorageClickhouse extends WorkflowsStorage {
|
|
@@ -15,7 +15,7 @@ export declare class WorkflowsStorageClickhouse extends WorkflowsStorage {
|
|
|
15
15
|
runId: string;
|
|
16
16
|
stepId: string;
|
|
17
17
|
result: StepResult<any, any, any, any>;
|
|
18
|
-
|
|
18
|
+
requestContext: Record<string, any>;
|
|
19
19
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
20
20
|
updateWorkflowState({}: {
|
|
21
21
|
workflowName: string;
|
|
@@ -39,14 +39,7 @@ export declare class WorkflowsStorageClickhouse extends WorkflowsStorage {
|
|
|
39
39
|
runId: string;
|
|
40
40
|
}): Promise<WorkflowRunState | null>;
|
|
41
41
|
private parseWorkflowRun;
|
|
42
|
-
|
|
43
|
-
workflowName?: string;
|
|
44
|
-
fromDate?: Date;
|
|
45
|
-
toDate?: Date;
|
|
46
|
-
limit?: number;
|
|
47
|
-
offset?: number;
|
|
48
|
-
resourceId?: string;
|
|
49
|
-
}): Promise<WorkflowRuns>;
|
|
42
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, page, perPage, resourceId, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
50
43
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
51
44
|
runId: string;
|
|
52
45
|
workflowName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAA6C,gBAAgB,EAAE,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MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;SACzC,CAAC;KACH,GACA,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAIlC,uBAAuB,CAAC,EAC5B,YAAY,EACZ,KAAK,EACL,UAAU,EACV,QAAQ,GACT,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,gBAAgB,CAAC;KAC5B,GAAG,OAAO,CAAC,IAAI,CAAC;IAgDX,oBAAoB,CAAC,EACzB,YAAY,EACZ,KAAK,GACN,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IA4BpC,OAAO,CAAC,gBAAgB;IAqBlB,gBAAgB,CAAC,EACrB,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,GACX,GAAE,4BAAiC,GAAG,OAAO,CAAC,YAAY,CAAC;IA0FtD,kBAAkB,CAAC,EACvB,KAAK,EACL,YAAY,GACb,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;CAoDhC"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { ScoreRowData, ScoringSource } from '@mastra/core/evals';
|
|
4
|
+
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
5
5
|
import { MastraStorage } from '@mastra/core/storage';
|
|
6
|
-
import type { TABLE_SCHEMAS,
|
|
7
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
6
|
+
import type { TABLE_SCHEMAS, PaginationInfo, StorageColumn, TABLE_NAMES, WorkflowRun, WorkflowRuns, StoragePagination, StorageDomains, StorageResourceType, StorageListWorkflowRunsInput } from '@mastra/core/storage';
|
|
8
7
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
9
8
|
type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
|
|
10
9
|
export type ClickhouseConfig = {
|
|
10
|
+
id: string;
|
|
11
11
|
url: string;
|
|
12
12
|
username: string;
|
|
13
13
|
password: string;
|
|
@@ -39,15 +39,8 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
39
39
|
hasColumn: boolean;
|
|
40
40
|
createTable: boolean;
|
|
41
41
|
deleteMessages: boolean;
|
|
42
|
-
|
|
42
|
+
listScoresBySpan: boolean;
|
|
43
43
|
};
|
|
44
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
45
|
-
getEvals(options: {
|
|
46
|
-
agentName?: string;
|
|
47
|
-
type?: 'test' | 'live';
|
|
48
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
49
|
-
evals: EvalRow[];
|
|
50
|
-
}>;
|
|
51
44
|
batchInsert({ tableName, records }: {
|
|
52
45
|
tableName: TABLE_NAMES;
|
|
53
46
|
records: Record<string, any>[];
|
|
@@ -81,12 +74,12 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
81
74
|
tableName: TABLE_NAMES;
|
|
82
75
|
keys: Record<string, string>;
|
|
83
76
|
}): Promise<R | null>;
|
|
84
|
-
updateWorkflowResults({ workflowName, runId, stepId, result,
|
|
77
|
+
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
85
78
|
workflowName: string;
|
|
86
79
|
runId: string;
|
|
87
80
|
stepId: string;
|
|
88
81
|
result: StepResult<any, any, any, any>;
|
|
89
|
-
|
|
82
|
+
requestContext: Record<string, any>;
|
|
90
83
|
}): Promise<Record<string, StepResult<any, any, any, any>>>;
|
|
91
84
|
updateWorkflowState({ workflowName, runId, opts, }: {
|
|
92
85
|
workflowName: string;
|
|
@@ -109,31 +102,14 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
109
102
|
workflowName: string;
|
|
110
103
|
runId: string;
|
|
111
104
|
}): Promise<WorkflowRunState | null>;
|
|
112
|
-
|
|
113
|
-
workflowName?: string;
|
|
114
|
-
fromDate?: Date;
|
|
115
|
-
toDate?: Date;
|
|
116
|
-
limit?: number;
|
|
117
|
-
offset?: number;
|
|
118
|
-
resourceId?: string;
|
|
119
|
-
}): Promise<WorkflowRuns>;
|
|
105
|
+
listWorkflowRuns({ workflowName, fromDate, toDate, perPage, page, resourceId, }?: StorageListWorkflowRunsInput): Promise<WorkflowRuns>;
|
|
120
106
|
getWorkflowRunById({ runId, workflowName, }: {
|
|
121
107
|
runId: string;
|
|
122
108
|
workflowName?: string;
|
|
123
109
|
}): Promise<WorkflowRun | null>;
|
|
124
|
-
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
125
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
126
|
-
traces: Trace[];
|
|
127
|
-
}>;
|
|
128
|
-
batchTraceInsert(args: {
|
|
129
|
-
records: Trace[];
|
|
130
|
-
}): Promise<void>;
|
|
131
110
|
getThreadById({ threadId }: {
|
|
132
111
|
threadId: string;
|
|
133
112
|
}): Promise<StorageThreadType | null>;
|
|
134
|
-
getThreadsByResourceId({ resourceId }: {
|
|
135
|
-
resourceId: string;
|
|
136
|
-
}): Promise<StorageThreadType[]>;
|
|
137
113
|
saveThread({ thread }: {
|
|
138
114
|
thread: StorageThreadType;
|
|
139
115
|
}): Promise<StorageThreadType>;
|
|
@@ -145,42 +121,13 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
145
121
|
deleteThread({ threadId }: {
|
|
146
122
|
threadId: string;
|
|
147
123
|
}): Promise<void>;
|
|
148
|
-
getThreadsByResourceIdPaginated(args: {
|
|
149
|
-
resourceId: string;
|
|
150
|
-
page: number;
|
|
151
|
-
perPage: number;
|
|
152
|
-
}): Promise<PaginationInfo & {
|
|
153
|
-
threads: StorageThreadType[];
|
|
154
|
-
}>;
|
|
155
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
156
|
-
format?: 'v1';
|
|
157
|
-
}): Promise<MastraMessageV1[]>;
|
|
158
|
-
getMessages(args: StorageGetMessagesArg & {
|
|
159
|
-
format: 'v2';
|
|
160
|
-
}): Promise<MastraMessageV2[]>;
|
|
161
|
-
getMessagesById({ messageIds, format }: {
|
|
162
|
-
messageIds: string[];
|
|
163
|
-
format: 'v1';
|
|
164
|
-
}): Promise<MastraMessageV1[]>;
|
|
165
|
-
getMessagesById({ messageIds, format }: {
|
|
166
|
-
messageIds: string[];
|
|
167
|
-
format?: 'v2';
|
|
168
|
-
}): Promise<MastraMessageV2[]>;
|
|
169
124
|
saveMessages(args: {
|
|
170
|
-
messages:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
saveMessages(args: {
|
|
174
|
-
messages: MastraMessageV2[];
|
|
175
|
-
format: 'v2';
|
|
176
|
-
}): Promise<MastraMessageV2[]>;
|
|
177
|
-
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
178
|
-
format?: 'v1' | 'v2';
|
|
179
|
-
}): Promise<PaginationInfo & {
|
|
180
|
-
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
125
|
+
messages: MastraDBMessage[];
|
|
126
|
+
}): Promise<{
|
|
127
|
+
messages: MastraDBMessage[];
|
|
181
128
|
}>;
|
|
182
129
|
updateMessages(args: {
|
|
183
|
-
messages: (Partial<Omit<
|
|
130
|
+
messages: (Partial<Omit<MastraDBMessage, 'createdAt'>> & {
|
|
184
131
|
id: string;
|
|
185
132
|
threadId?: string;
|
|
186
133
|
content?: {
|
|
@@ -188,7 +135,7 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
188
135
|
content?: MastraMessageContentV2['content'];
|
|
189
136
|
};
|
|
190
137
|
})[];
|
|
191
|
-
}): Promise<
|
|
138
|
+
}): Promise<MastraDBMessage[]>;
|
|
192
139
|
getResourceById({ resourceId }: {
|
|
193
140
|
resourceId: string;
|
|
194
141
|
}): Promise<StorageResourceType | null>;
|
|
@@ -206,14 +153,14 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
206
153
|
saveScore(_score: ScoreRowData): Promise<{
|
|
207
154
|
score: ScoreRowData;
|
|
208
155
|
}>;
|
|
209
|
-
|
|
156
|
+
listScoresByRunId({ runId, pagination, }: {
|
|
210
157
|
runId: string;
|
|
211
158
|
pagination: StoragePagination;
|
|
212
159
|
}): Promise<{
|
|
213
160
|
pagination: PaginationInfo;
|
|
214
161
|
scores: ScoreRowData[];
|
|
215
162
|
}>;
|
|
216
|
-
|
|
163
|
+
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
217
164
|
pagination: StoragePagination;
|
|
218
165
|
entityId: string;
|
|
219
166
|
entityType: string;
|
|
@@ -221,7 +168,7 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
221
168
|
pagination: PaginationInfo;
|
|
222
169
|
scores: ScoreRowData[];
|
|
223
170
|
}>;
|
|
224
|
-
|
|
171
|
+
listScoresByScorerId({ scorerId, pagination, entityId, entityType, source, }: {
|
|
225
172
|
scorerId: string;
|
|
226
173
|
pagination: StoragePagination;
|
|
227
174
|
entityId?: string;
|
|
@@ -231,7 +178,7 @@ export declare class ClickhouseStore extends MastraStorage {
|
|
|
231
178
|
pagination: PaginationInfo;
|
|
232
179
|
scores: ScoreRowData[];
|
|
233
180
|
}>;
|
|
234
|
-
|
|
181
|
+
listScoresBySpan({ traceId, spanId, pagination, }: {
|
|
235
182
|
traceId: string;
|
|
236
183
|
spanId: string;
|
|
237
184
|
pagination: StoragePagination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM3E,KAAK,YAAY,GACb,YAAY,GACZ,aAAa,GACb,aAAa,GACb,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,KAAK,GACL,MAAM,GACN,OAAO,GACP,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;SACH,QAAQ,IAAI,WAAW,CAAC,CAAC,EAAE;YAC1B,GAA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AY,EAAE,CAAA;KAAE,CAAC;IAI7D,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAI7D,gBAAgB,CAAC,EACrB,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAI7D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/clickhouse",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
4
|
"description": "Clickhouse provider for Mastra - includes db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"tsup": "^8.5.0",
|
|
30
30
|
"typescript": "^5.8.3",
|
|
31
31
|
"vitest": "^3.2.4",
|
|
32
|
-
"@internal/lint": "0.0.
|
|
33
|
-
"@internal/storage-test-utils": "0.0.
|
|
34
|
-
"@
|
|
35
|
-
"@
|
|
32
|
+
"@internal/lint": "0.0.53",
|
|
33
|
+
"@internal/storage-test-utils": "0.0.49",
|
|
34
|
+
"@mastra/core": "1.0.0-beta.0",
|
|
35
|
+
"@internal/types-builder": "0.0.28"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@mastra/core": ">=0.
|
|
38
|
+
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
@@ -50,12 +50,8 @@
|
|
|
50
50
|
"bugs": {
|
|
51
51
|
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"publish-branch": [
|
|
56
|
-
"main",
|
|
57
|
-
"0.x"
|
|
58
|
-
]
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.13.0"
|
|
59
55
|
},
|
|
60
56
|
"scripts": {
|
|
61
57
|
"build": "tsup --silent --config tsup.config.ts",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
|
-
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { EvalRow, PaginationArgs, PaginationInfo } from '@mastra/core/storage';
|
|
4
|
-
import type { StoreOperationsClickhouse } from '../operations/index.js';
|
|
5
|
-
export declare class LegacyEvalsStorageClickhouse extends LegacyEvalsStorage {
|
|
6
|
-
protected client: ClickHouseClient;
|
|
7
|
-
protected operations: StoreOperationsClickhouse;
|
|
8
|
-
constructor({ client, operations }: {
|
|
9
|
-
client: ClickHouseClient;
|
|
10
|
-
operations: StoreOperationsClickhouse;
|
|
11
|
-
});
|
|
12
|
-
private transformEvalRow;
|
|
13
|
-
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
14
|
-
getEvals(options?: {
|
|
15
|
-
agentName?: string;
|
|
16
|
-
type?: 'test' | 'live';
|
|
17
|
-
} & PaginationArgs): Promise<PaginationInfo & {
|
|
18
|
-
evals: EvalRow[];
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/legacy-evals/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,kBAAkB,EAAe,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAG/D,qBAAa,4BAA6B,SAAQ,kBAAkB;IAClE,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,UAAU,EAAE,yBAAyB,CAAC;gBACpC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAC;QAAC,UAAU,EAAE,yBAAyB,CAAA;KAAE;IAMvG,OAAO,CAAC,gBAAgB;IAmElB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA2ClF,QAAQ,CACZ,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,GAAG,cAAmB,GACtB,OAAO,CAAC,cAAc,GAAG;QAAE,KAAK,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CAiHlD"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
|
-
import { TracesStorage } from '@mastra/core/storage';
|
|
3
|
-
import type { PaginationInfo, StorageGetTracesPaginatedArg, StorageGetTracesArg } from '@mastra/core/storage';
|
|
4
|
-
import type { Trace } from '@mastra/core/telemetry';
|
|
5
|
-
import type { StoreOperationsClickhouse } from '../operations/index.js';
|
|
6
|
-
export declare class TracesStorageClickhouse extends TracesStorage {
|
|
7
|
-
protected client: ClickHouseClient;
|
|
8
|
-
protected operations: StoreOperationsClickhouse;
|
|
9
|
-
constructor({ client, operations }: {
|
|
10
|
-
client: ClickHouseClient;
|
|
11
|
-
operations: StoreOperationsClickhouse;
|
|
12
|
-
});
|
|
13
|
-
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
14
|
-
traces: Trace[];
|
|
15
|
-
}>;
|
|
16
|
-
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: StorageGetTracesArg): Promise<any[]>;
|
|
17
|
-
batchTraceInsert(args: {
|
|
18
|
-
records: Trace[];
|
|
19
|
-
}): Promise<void>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/traces/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAgD,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC9G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAE/D,qBAAa,uBAAwB,SAAQ,aAAa;IACxD,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;IACnC,SAAS,CAAC,UAAU,EAAE,yBAAyB,CAAC;gBAEpC,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;QAAE,MAAM,EAAE,gBAAgB,CAAC;QAAC,UAAU,EAAE,yBAAyB,CAAA;KAAE;IAMjG,kBAAkB,CAAC,IAAI,EAAE,4BAA4B,GAAG,OAAO,CAAC,cAAc,GAAG;QAAE,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,CAAC;IAgJrG,SAAS,CAAC,EACd,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,EACR,MAAM,GACP,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAqGjC,gBAAgB,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,KAAK,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGlE"}
|