@mastra/clickhouse 0.0.0-trigger-playground-ui-package-20250506151043 → 0.0.0-update-stores-peerDeps-20250723031338
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 +477 -2
- package/LICENSE.md +12 -4
- package/dist/_tsup-dts-rollup.d.cts +373 -33
- package/dist/_tsup-dts-rollup.d.ts +373 -33
- package/dist/index.cjs +2235 -440
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +2223 -426
- package/package.json +14 -10
- package/src/storage/domains/legacy-evals/index.ts +246 -0
- package/src/storage/domains/memory/index.ts +1393 -0
- package/src/storage/domains/operations/index.ts +319 -0
- package/src/storage/domains/scores/index.ts +326 -0
- package/src/storage/domains/traces/index.ts +275 -0
- package/src/storage/domains/utils.ts +86 -0
- package/src/storage/domains/workflows/index.ts +285 -0
- package/src/storage/index.test.ts +14 -844
- package/src/storage/index.ts +241 -897
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import type { EvalRow } from '@mastra/core/storage';
|
|
3
|
+
import { LegacyEvalsStorage } from '@mastra/core/storage';
|
|
4
|
+
import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
5
|
+
import type { MastraMessageV1 } from '@mastra/core/memory';
|
|
6
|
+
import type { MastraMessageV2 } from '@mastra/core/memory';
|
|
3
7
|
import { MastraStorage } from '@mastra/core/storage';
|
|
4
|
-
import
|
|
8
|
+
import { MemoryStorage } from '@mastra/core/storage';
|
|
9
|
+
import type { PaginationArgs } from '@mastra/core/storage';
|
|
10
|
+
import type { PaginationInfo } from '@mastra/core/storage';
|
|
11
|
+
import type { ScoreRowData } from '@mastra/core/scores';
|
|
12
|
+
import { ScoresStorage } from '@mastra/core/storage';
|
|
5
13
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
14
|
+
import type { StorageDomains } from '@mastra/core/storage';
|
|
6
15
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
16
|
+
import type { StorageGetTracesArg } from '@mastra/core/storage';
|
|
17
|
+
import type { StorageGetTracesPaginatedArg } from '@mastra/core/storage';
|
|
18
|
+
import type { StoragePagination } from '@mastra/core/storage';
|
|
19
|
+
import type { StorageResourceType } from '@mastra/core/storage';
|
|
7
20
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
21
|
+
import { StoreOperations } from '@mastra/core/storage';
|
|
8
22
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
9
|
-
import { TABLE_SCHEMAS } from '@mastra/core/storage';
|
|
23
|
+
import type { TABLE_SCHEMAS } from '@mastra/core/storage';
|
|
24
|
+
import type { Trace } from '@mastra/core/telemetry';
|
|
25
|
+
import { TracesStorage } from '@mastra/core/storage';
|
|
10
26
|
import type { WorkflowRun } from '@mastra/core/storage';
|
|
11
27
|
import type { WorkflowRuns } from '@mastra/core/storage';
|
|
12
28
|
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
29
|
+
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
13
30
|
|
|
14
31
|
declare type ClickhouseConfig = {
|
|
15
32
|
url: string;
|
|
@@ -19,13 +36,13 @@ declare type ClickhouseConfig = {
|
|
|
19
36
|
[TableKey in TABLE_NAMES]?: {
|
|
20
37
|
row?: {
|
|
21
38
|
interval: number;
|
|
22
|
-
unit:
|
|
39
|
+
unit: IntervalUnit_2;
|
|
23
40
|
ttlKey?: string;
|
|
24
41
|
};
|
|
25
42
|
columns?: Partial<{
|
|
26
43
|
[ColumnKey in keyof (typeof TABLE_SCHEMAS)[TableKey]]: {
|
|
27
44
|
interval: number;
|
|
28
|
-
unit:
|
|
45
|
+
unit: IntervalUnit_2;
|
|
29
46
|
ttlKey?: string;
|
|
30
47
|
};
|
|
31
48
|
}>;
|
|
@@ -35,26 +52,50 @@ declare type ClickhouseConfig = {
|
|
|
35
52
|
export { ClickhouseConfig }
|
|
36
53
|
export { ClickhouseConfig as ClickhouseConfig_alias_1 }
|
|
37
54
|
|
|
55
|
+
export declare type ClickhouseConfig_alias_2 = {
|
|
56
|
+
url: string;
|
|
57
|
+
username: string;
|
|
58
|
+
password: string;
|
|
59
|
+
ttl?: {
|
|
60
|
+
[TableKey in TABLE_NAMES]?: {
|
|
61
|
+
row?: {
|
|
62
|
+
interval: number;
|
|
63
|
+
unit: IntervalUnit;
|
|
64
|
+
ttlKey?: string;
|
|
65
|
+
};
|
|
66
|
+
columns?: Partial<{
|
|
67
|
+
[ColumnKey in keyof (typeof TABLE_SCHEMAS)[TableKey]]: {
|
|
68
|
+
interval: number;
|
|
69
|
+
unit: IntervalUnit;
|
|
70
|
+
ttlKey?: string;
|
|
71
|
+
};
|
|
72
|
+
}>;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
38
77
|
declare class ClickhouseStore extends MastraStorage {
|
|
39
78
|
protected db: ClickHouseClient;
|
|
40
79
|
protected ttl: ClickhouseConfig['ttl'];
|
|
80
|
+
stores: StorageDomains;
|
|
41
81
|
constructor(config: ClickhouseConfig);
|
|
42
|
-
|
|
82
|
+
get supports(): {
|
|
83
|
+
selectByIncludeResourceScope: boolean;
|
|
84
|
+
resourceWorkingMemory: boolean;
|
|
85
|
+
hasColumn: boolean;
|
|
86
|
+
createTable: boolean;
|
|
87
|
+
};
|
|
43
88
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
89
|
+
getEvals(options: {
|
|
90
|
+
agentName?: string;
|
|
91
|
+
type?: 'test' | 'live';
|
|
92
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
93
|
+
evals: EvalRow[];
|
|
94
|
+
}>;
|
|
44
95
|
batchInsert({ tableName, records }: {
|
|
45
96
|
tableName: TABLE_NAMES;
|
|
46
97
|
records: Record<string, any>[];
|
|
47
98
|
}): Promise<void>;
|
|
48
|
-
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: {
|
|
49
|
-
name?: string;
|
|
50
|
-
scope?: string;
|
|
51
|
-
page: number;
|
|
52
|
-
perPage: number;
|
|
53
|
-
attributes?: Record<string, string>;
|
|
54
|
-
filters?: Record<string, any>;
|
|
55
|
-
fromDate?: Date;
|
|
56
|
-
toDate?: Date;
|
|
57
|
-
}): Promise<any[]>;
|
|
58
99
|
optimizeTable({ tableName }: {
|
|
59
100
|
tableName: TABLE_NAMES;
|
|
60
101
|
}): Promise<void>;
|
|
@@ -65,6 +106,14 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
65
106
|
tableName: TABLE_NAMES;
|
|
66
107
|
schema: Record<string, StorageColumn>;
|
|
67
108
|
}): Promise<void>;
|
|
109
|
+
dropTable({ tableName }: {
|
|
110
|
+
tableName: TABLE_NAMES;
|
|
111
|
+
}): Promise<void>;
|
|
112
|
+
alterTable({ tableName, schema, ifNotExists, }: {
|
|
113
|
+
tableName: TABLE_NAMES;
|
|
114
|
+
schema: Record<string, StorageColumn>;
|
|
115
|
+
ifNotExists: string[];
|
|
116
|
+
}): Promise<void>;
|
|
68
117
|
clearTable({ tableName }: {
|
|
69
118
|
tableName: TABLE_NAMES;
|
|
70
119
|
}): Promise<void>;
|
|
@@ -76,6 +125,34 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
76
125
|
tableName: TABLE_NAMES;
|
|
77
126
|
keys: Record<string, string>;
|
|
78
127
|
}): Promise<R | null>;
|
|
128
|
+
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
129
|
+
workflowName: string;
|
|
130
|
+
runId: string;
|
|
131
|
+
snapshot: WorkflowRunState;
|
|
132
|
+
}): Promise<void>;
|
|
133
|
+
loadWorkflowSnapshot({ workflowName, runId, }: {
|
|
134
|
+
workflowName: string;
|
|
135
|
+
runId: string;
|
|
136
|
+
}): Promise<WorkflowRunState | null>;
|
|
137
|
+
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
138
|
+
workflowName?: string;
|
|
139
|
+
fromDate?: Date;
|
|
140
|
+
toDate?: Date;
|
|
141
|
+
limit?: number;
|
|
142
|
+
offset?: number;
|
|
143
|
+
resourceId?: string;
|
|
144
|
+
}): Promise<WorkflowRuns>;
|
|
145
|
+
getWorkflowRunById({ runId, workflowName, }: {
|
|
146
|
+
runId: string;
|
|
147
|
+
workflowName?: string;
|
|
148
|
+
}): Promise<WorkflowRun | null>;
|
|
149
|
+
getTraces(args: StorageGetTracesArg): Promise<any[]>;
|
|
150
|
+
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
151
|
+
traces: Trace[];
|
|
152
|
+
}>;
|
|
153
|
+
batchTraceInsert(args: {
|
|
154
|
+
records: Trace[];
|
|
155
|
+
}): Promise<void>;
|
|
79
156
|
getThreadById({ threadId }: {
|
|
80
157
|
threadId: string;
|
|
81
158
|
}): Promise<StorageThreadType | null>;
|
|
@@ -93,10 +170,287 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
93
170
|
deleteThread({ threadId }: {
|
|
94
171
|
threadId: string;
|
|
95
172
|
}): Promise<void>;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
173
|
+
getThreadsByResourceIdPaginated(args: {
|
|
174
|
+
resourceId: string;
|
|
175
|
+
page: number;
|
|
176
|
+
perPage: number;
|
|
177
|
+
}): Promise<PaginationInfo & {
|
|
178
|
+
threads: StorageThreadType[];
|
|
179
|
+
}>;
|
|
180
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
181
|
+
format?: 'v1';
|
|
182
|
+
}): Promise<MastraMessageV1[]>;
|
|
183
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
184
|
+
format: 'v2';
|
|
185
|
+
}): Promise<MastraMessageV2[]>;
|
|
186
|
+
saveMessages(args: {
|
|
187
|
+
messages: MastraMessageV1[];
|
|
188
|
+
format?: undefined | 'v1';
|
|
189
|
+
}): Promise<MastraMessageV1[]>;
|
|
190
|
+
saveMessages(args: {
|
|
191
|
+
messages: MastraMessageV2[];
|
|
192
|
+
format: 'v2';
|
|
193
|
+
}): Promise<MastraMessageV2[]>;
|
|
194
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
195
|
+
format?: 'v1' | 'v2';
|
|
196
|
+
}): Promise<PaginationInfo & {
|
|
197
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
198
|
+
}>;
|
|
199
|
+
updateMessages(args: {
|
|
200
|
+
messages: (Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
201
|
+
id: string;
|
|
202
|
+
threadId?: string;
|
|
203
|
+
content?: {
|
|
204
|
+
metadata?: MastraMessageContentV2['metadata'];
|
|
205
|
+
content?: MastraMessageContentV2['content'];
|
|
206
|
+
};
|
|
207
|
+
})[];
|
|
208
|
+
}): Promise<MastraMessageV2[]>;
|
|
209
|
+
getResourceById({ resourceId }: {
|
|
210
|
+
resourceId: string;
|
|
211
|
+
}): Promise<StorageResourceType | null>;
|
|
212
|
+
saveResource({ resource }: {
|
|
213
|
+
resource: StorageResourceType;
|
|
214
|
+
}): Promise<StorageResourceType>;
|
|
215
|
+
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
216
|
+
resourceId: string;
|
|
217
|
+
workingMemory?: string;
|
|
218
|
+
metadata?: Record<string, unknown>;
|
|
219
|
+
}): Promise<StorageResourceType>;
|
|
220
|
+
getScoreById({ id }: {
|
|
221
|
+
id: string;
|
|
222
|
+
}): Promise<ScoreRowData | null>;
|
|
223
|
+
saveScore(_score: ScoreRowData): Promise<{
|
|
224
|
+
score: ScoreRowData;
|
|
225
|
+
}>;
|
|
226
|
+
getScoresByRunId({ runId, pagination, }: {
|
|
227
|
+
runId: string;
|
|
228
|
+
pagination: StoragePagination;
|
|
229
|
+
}): Promise<{
|
|
230
|
+
pagination: PaginationInfo;
|
|
231
|
+
scores: ScoreRowData[];
|
|
232
|
+
}>;
|
|
233
|
+
getScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
234
|
+
pagination: StoragePagination;
|
|
235
|
+
entityId: string;
|
|
236
|
+
entityType: string;
|
|
237
|
+
}): Promise<{
|
|
238
|
+
pagination: PaginationInfo;
|
|
239
|
+
scores: ScoreRowData[];
|
|
240
|
+
}>;
|
|
241
|
+
getScoresByScorerId({ scorerId, pagination, }: {
|
|
242
|
+
scorerId: string;
|
|
243
|
+
pagination: StoragePagination;
|
|
244
|
+
}): Promise<{
|
|
245
|
+
pagination: PaginationInfo;
|
|
246
|
+
scores: ScoreRowData[];
|
|
247
|
+
}>;
|
|
248
|
+
close(): Promise<void>;
|
|
249
|
+
}
|
|
250
|
+
export { ClickhouseStore }
|
|
251
|
+
export { ClickhouseStore as ClickhouseStore_alias_1 }
|
|
252
|
+
|
|
253
|
+
export declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
|
|
254
|
+
|
|
255
|
+
export declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
|
|
256
|
+
|
|
257
|
+
declare type IntervalUnit_2 = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
|
|
258
|
+
|
|
259
|
+
export declare class LegacyEvalsStorageClickhouse extends LegacyEvalsStorage {
|
|
260
|
+
protected client: ClickHouseClient;
|
|
261
|
+
protected operations: StoreOperationsClickhouse;
|
|
262
|
+
constructor({ client, operations }: {
|
|
263
|
+
client: ClickHouseClient;
|
|
264
|
+
operations: StoreOperationsClickhouse;
|
|
265
|
+
});
|
|
266
|
+
private transformEvalRow;
|
|
267
|
+
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
268
|
+
getEvals(options?: {
|
|
269
|
+
agentName?: string;
|
|
270
|
+
type?: 'test' | 'live';
|
|
271
|
+
} & PaginationArgs): Promise<PaginationInfo & {
|
|
272
|
+
evals: EvalRow[];
|
|
273
|
+
}>;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export declare class MemoryStorageClickhouse extends MemoryStorage {
|
|
277
|
+
protected client: ClickHouseClient;
|
|
278
|
+
protected operations: StoreOperationsClickhouse;
|
|
279
|
+
constructor({ client, operations }: {
|
|
280
|
+
client: ClickHouseClient;
|
|
281
|
+
operations: StoreOperationsClickhouse;
|
|
282
|
+
});
|
|
283
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
284
|
+
format?: 'v1';
|
|
285
|
+
}): Promise<MastraMessageV1[]>;
|
|
286
|
+
getMessages(args: StorageGetMessagesArg & {
|
|
287
|
+
format: 'v2';
|
|
288
|
+
}): Promise<MastraMessageV2[]>;
|
|
289
|
+
saveMessages(args: {
|
|
290
|
+
messages: MastraMessageV1[];
|
|
291
|
+
format?: undefined | 'v1';
|
|
292
|
+
}): Promise<MastraMessageV1[]>;
|
|
293
|
+
saveMessages(args: {
|
|
294
|
+
messages: MastraMessageV2[];
|
|
295
|
+
format: 'v2';
|
|
296
|
+
}): Promise<MastraMessageV2[]>;
|
|
297
|
+
getThreadById({ threadId }: {
|
|
298
|
+
threadId: string;
|
|
299
|
+
}): Promise<StorageThreadType | null>;
|
|
300
|
+
getThreadsByResourceId({ resourceId }: {
|
|
301
|
+
resourceId: string;
|
|
302
|
+
}): Promise<StorageThreadType[]>;
|
|
303
|
+
saveThread({ thread }: {
|
|
304
|
+
thread: StorageThreadType;
|
|
305
|
+
}): Promise<StorageThreadType>;
|
|
306
|
+
updateThread({ id, title, metadata, }: {
|
|
307
|
+
id: string;
|
|
308
|
+
title: string;
|
|
309
|
+
metadata: Record<string, unknown>;
|
|
310
|
+
}): Promise<StorageThreadType>;
|
|
311
|
+
deleteThread({ threadId }: {
|
|
312
|
+
threadId: string;
|
|
313
|
+
}): Promise<void>;
|
|
314
|
+
getThreadsByResourceIdPaginated(args: {
|
|
315
|
+
resourceId: string;
|
|
316
|
+
page?: number;
|
|
317
|
+
perPage?: number;
|
|
318
|
+
}): Promise<PaginationInfo & {
|
|
319
|
+
threads: StorageThreadType[];
|
|
320
|
+
}>;
|
|
321
|
+
getMessagesPaginated(args: StorageGetMessagesArg & {
|
|
322
|
+
format?: 'v1' | 'v2';
|
|
323
|
+
}): Promise<PaginationInfo & {
|
|
324
|
+
messages: MastraMessageV1[] | MastraMessageV2[];
|
|
325
|
+
}>;
|
|
326
|
+
updateMessages(args: {
|
|
327
|
+
messages: (Partial<Omit<MastraMessageV2, 'createdAt'>> & {
|
|
328
|
+
id: string;
|
|
329
|
+
threadId?: string;
|
|
330
|
+
content?: {
|
|
331
|
+
metadata?: MastraMessageContentV2['metadata'];
|
|
332
|
+
content?: MastraMessageContentV2['content'];
|
|
333
|
+
};
|
|
334
|
+
})[];
|
|
335
|
+
}): Promise<MastraMessageV2[]>;
|
|
336
|
+
getResourceById({ resourceId }: {
|
|
337
|
+
resourceId: string;
|
|
338
|
+
}): Promise<StorageResourceType | null>;
|
|
339
|
+
saveResource({ resource }: {
|
|
340
|
+
resource: StorageResourceType;
|
|
341
|
+
}): Promise<StorageResourceType>;
|
|
342
|
+
updateResource({ resourceId, workingMemory, metadata, }: {
|
|
343
|
+
resourceId: string;
|
|
344
|
+
workingMemory?: string;
|
|
345
|
+
metadata?: Record<string, unknown>;
|
|
346
|
+
}): Promise<StorageResourceType>;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
export declare class ScoresStorageClickhouse extends ScoresStorage {
|
|
350
|
+
protected client: ClickHouseClient;
|
|
351
|
+
protected operations: StoreOperationsClickhouse;
|
|
352
|
+
constructor({ client, operations }: {
|
|
353
|
+
client: ClickHouseClient;
|
|
354
|
+
operations: StoreOperationsClickhouse;
|
|
355
|
+
});
|
|
356
|
+
private transformScoreRow;
|
|
357
|
+
getScoreById({ id }: {
|
|
358
|
+
id: string;
|
|
359
|
+
}): Promise<ScoreRowData | null>;
|
|
360
|
+
saveScore(score: ScoreRowData): Promise<{
|
|
361
|
+
score: ScoreRowData;
|
|
362
|
+
}>;
|
|
363
|
+
getScoresByRunId({ runId, pagination, }: {
|
|
364
|
+
runId: string;
|
|
365
|
+
pagination: StoragePagination;
|
|
366
|
+
}): Promise<{
|
|
367
|
+
pagination: PaginationInfo;
|
|
368
|
+
scores: ScoreRowData[];
|
|
369
|
+
}>;
|
|
370
|
+
getScoresByScorerId({ scorerId, pagination, }: {
|
|
371
|
+
scorerId: string;
|
|
372
|
+
pagination: StoragePagination;
|
|
373
|
+
}): Promise<{
|
|
374
|
+
pagination: PaginationInfo;
|
|
375
|
+
scores: ScoreRowData[];
|
|
376
|
+
}>;
|
|
377
|
+
getScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
378
|
+
pagination: StoragePagination;
|
|
379
|
+
entityId: string;
|
|
380
|
+
entityType: string;
|
|
381
|
+
}): Promise<{
|
|
382
|
+
pagination: PaginationInfo;
|
|
383
|
+
scores: ScoreRowData[];
|
|
384
|
+
}>;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export declare class StoreOperationsClickhouse extends StoreOperations {
|
|
388
|
+
protected ttl: ClickhouseConfig_alias_2['ttl'];
|
|
389
|
+
protected client: ClickHouseClient;
|
|
390
|
+
constructor({ client, ttl }: {
|
|
391
|
+
client: ClickHouseClient;
|
|
392
|
+
ttl: ClickhouseConfig_alias_2['ttl'];
|
|
393
|
+
});
|
|
394
|
+
hasColumn(table: string, column: string): Promise<boolean>;
|
|
395
|
+
protected getSqlType(type: StorageColumn['type']): string;
|
|
396
|
+
createTable({ tableName, schema, }: {
|
|
397
|
+
tableName: TABLE_NAMES;
|
|
398
|
+
schema: Record<string, StorageColumn>;
|
|
399
|
+
}): Promise<void>;
|
|
400
|
+
alterTable({ tableName, schema, ifNotExists, }: {
|
|
401
|
+
tableName: TABLE_NAMES;
|
|
402
|
+
schema: Record<string, StorageColumn>;
|
|
403
|
+
ifNotExists: string[];
|
|
404
|
+
}): Promise<void>;
|
|
405
|
+
clearTable({ tableName }: {
|
|
406
|
+
tableName: TABLE_NAMES;
|
|
407
|
+
}): Promise<void>;
|
|
408
|
+
dropTable({ tableName }: {
|
|
409
|
+
tableName: TABLE_NAMES;
|
|
410
|
+
}): Promise<void>;
|
|
411
|
+
insert({ tableName, record }: {
|
|
412
|
+
tableName: TABLE_NAMES;
|
|
413
|
+
record: Record<string, any>;
|
|
414
|
+
}): Promise<void>;
|
|
415
|
+
batchInsert({ tableName, records }: {
|
|
416
|
+
tableName: TABLE_NAMES;
|
|
417
|
+
records: Record<string, any>[];
|
|
418
|
+
}): Promise<void>;
|
|
419
|
+
load<R>({ tableName, keys }: {
|
|
420
|
+
tableName: TABLE_NAMES;
|
|
421
|
+
keys: Record<string, string>;
|
|
422
|
+
}): Promise<R | null>;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
|
|
426
|
+
|
|
427
|
+
export declare class TracesStorageClickhouse extends TracesStorage {
|
|
428
|
+
protected client: ClickHouseClient;
|
|
429
|
+
protected operations: StoreOperationsClickhouse;
|
|
430
|
+
constructor({ client, operations }: {
|
|
431
|
+
client: ClickHouseClient;
|
|
432
|
+
operations: StoreOperationsClickhouse;
|
|
433
|
+
});
|
|
434
|
+
getTracesPaginated(args: StorageGetTracesPaginatedArg): Promise<PaginationInfo & {
|
|
435
|
+
traces: Trace[];
|
|
436
|
+
}>;
|
|
437
|
+
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: StorageGetTracesArg): Promise<any[]>;
|
|
438
|
+
batchTraceInsert(args: {
|
|
439
|
+
records: Trace[];
|
|
440
|
+
}): Promise<void>;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export declare function transformRow<R>(row: any): R;
|
|
444
|
+
|
|
445
|
+
export declare function transformRows<R>(rows: any[]): R[];
|
|
446
|
+
|
|
447
|
+
export declare class WorkflowsStorageClickhouse extends WorkflowsStorage {
|
|
448
|
+
protected client: ClickHouseClient;
|
|
449
|
+
protected operations: StoreOperationsClickhouse;
|
|
450
|
+
constructor({ client, operations }: {
|
|
451
|
+
client: ClickHouseClient;
|
|
452
|
+
operations: StoreOperationsClickhouse;
|
|
453
|
+
});
|
|
100
454
|
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
101
455
|
workflowName: string;
|
|
102
456
|
runId: string;
|
|
@@ -119,20 +473,6 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
119
473
|
runId: string;
|
|
120
474
|
workflowName?: string;
|
|
121
475
|
}): Promise<WorkflowRun | null>;
|
|
122
|
-
private hasColumn;
|
|
123
|
-
close(): Promise<void>;
|
|
124
476
|
}
|
|
125
|
-
export { ClickhouseStore }
|
|
126
|
-
export { ClickhouseStore as ClickhouseStore_alias_1 }
|
|
127
|
-
|
|
128
|
-
declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
|
|
129
|
-
export { COLUMN_TYPES }
|
|
130
|
-
export { COLUMN_TYPES as COLUMN_TYPES_alias_1 }
|
|
131
|
-
|
|
132
|
-
declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
|
|
133
|
-
|
|
134
|
-
declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
|
|
135
|
-
export { TABLE_ENGINES }
|
|
136
|
-
export { TABLE_ENGINES as TABLE_ENGINES_alias_1 }
|
|
137
477
|
|
|
138
478
|
export { }
|