@mastra/clickhouse 0.0.0-a2a-20250421213654

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 ADDED
@@ -0,0 +1,275 @@
1
+ # @mastra/clickhouse
2
+
3
+ ## 0.0.0-a2a-20250421213654
4
+
5
+ ### Minor Changes
6
+
7
+ - fe3ae4d: Remove \_\_ functions in storage and move to storage proxy to make sure init is called
8
+
9
+ ### Patch Changes
10
+
11
+ - dd8d0cb: make Clickhouse storage extendable
12
+ - Updated dependencies [08bb78e]
13
+ - Updated dependencies [ed2f549]
14
+ - Updated dependencies [7e92011]
15
+ - Updated dependencies [9ee4293]
16
+ - Updated dependencies [03f3cd0]
17
+ - Updated dependencies [c0f22b4]
18
+ - Updated dependencies [71d9444]
19
+ - Updated dependencies [157c741]
20
+ - Updated dependencies [8a8a73b]
21
+ - Updated dependencies [fe3ae4d]
22
+ - Updated dependencies [6f92295]
23
+ - @mastra/core@0.0.0-a2a-20250421213654
24
+
25
+ ## 0.3.0-alpha.7
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [71d9444]
30
+ - @mastra/core@0.9.0-alpha.7
31
+
32
+ ## 0.3.0-alpha.6
33
+
34
+ ### Patch Changes
35
+
36
+ - dd8d0cb: make Clickhouse storage extendable
37
+ - Updated dependencies [157c741]
38
+ - @mastra/core@0.9.0-alpha.6
39
+
40
+ ## 0.3.0-alpha.5
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [08bb78e]
45
+ - @mastra/core@0.9.0-alpha.5
46
+
47
+ ## 0.3.0-alpha.4
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [7e92011]
52
+ - @mastra/core@0.9.0-alpha.4
53
+
54
+ ## 0.3.0-alpha.3
55
+
56
+ ### Minor Changes
57
+
58
+ - fe3ae4d: Remove \_\_ functions in storage and move to storage proxy to make sure init is called
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [fe3ae4d]
63
+ - @mastra/core@0.9.0-alpha.3
64
+
65
+ ## 0.2.11-alpha.2
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [9ee4293]
70
+ - @mastra/core@0.8.4-alpha.2
71
+
72
+ ## 0.2.11-alpha.1
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [8a8a73b]
77
+ - Updated dependencies [6f92295]
78
+ - @mastra/core@0.8.4-alpha.1
79
+
80
+ ## 0.2.11-alpha.0
81
+
82
+ ### Patch Changes
83
+
84
+ - Updated dependencies [03f3cd0]
85
+ - @mastra/core@0.8.4-alpha.0
86
+
87
+ ## 0.2.10
88
+
89
+ ### Patch Changes
90
+
91
+ - ec3cbf9: add MIT license for stores/vector packages
92
+ - 37bb612: Add Elastic-2.0 licensing for packages
93
+ - Updated dependencies [d72318f]
94
+ - Updated dependencies [0bcc862]
95
+ - Updated dependencies [10a8caf]
96
+ - Updated dependencies [359b089]
97
+ - Updated dependencies [32e7b71]
98
+ - Updated dependencies [37bb612]
99
+ - Updated dependencies [7f1b291]
100
+ - @mastra/core@0.8.3
101
+
102
+ ## 0.2.10-alpha.5
103
+
104
+ ### Patch Changes
105
+
106
+ - ec3cbf9: add MIT license for stores/vector packages
107
+ - Updated dependencies [d72318f]
108
+ - @mastra/core@0.8.3-alpha.5
109
+
110
+ ## 0.2.10-alpha.4
111
+
112
+ ### Patch Changes
113
+
114
+ - Updated dependencies [7f1b291]
115
+ - @mastra/core@0.8.3-alpha.4
116
+
117
+ ## 0.2.10-alpha.3
118
+
119
+ ### Patch Changes
120
+
121
+ - Updated dependencies [10a8caf]
122
+ - @mastra/core@0.8.3-alpha.3
123
+
124
+ ## 0.2.10-alpha.2
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [0bcc862]
129
+ - @mastra/core@0.8.3-alpha.2
130
+
131
+ ## 0.2.10-alpha.1
132
+
133
+ ### Patch Changes
134
+
135
+ - 37bb612: Add Elastic-2.0 licensing for packages
136
+ - Updated dependencies [32e7b71]
137
+ - Updated dependencies [37bb612]
138
+ - @mastra/core@0.8.3-alpha.1
139
+
140
+ ## 0.2.10-alpha.0
141
+
142
+ ### Patch Changes
143
+
144
+ - Updated dependencies [359b089]
145
+ - @mastra/core@0.8.3-alpha.0
146
+
147
+ ## 0.2.9
148
+
149
+ ### Patch Changes
150
+
151
+ - Updated dependencies [a06aadc]
152
+ - @mastra/core@0.8.2
153
+
154
+ ## 0.2.9-alpha.0
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies [a06aadc]
159
+ - @mastra/core@0.8.2-alpha.0
160
+
161
+ ## 0.2.8
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [99e2998]
166
+ - Updated dependencies [8fdb414]
167
+ - @mastra/core@0.8.1
168
+
169
+ ## 0.2.8-alpha.0
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [99e2998]
174
+ - Updated dependencies [8fdb414]
175
+ - @mastra/core@0.8.1-alpha.0
176
+
177
+ ## 0.2.7
178
+
179
+ ### Patch Changes
180
+
181
+ - dbbbf80: Added clickhouse storage
182
+ - 88fa727: Added getWorkflowRuns for libsql, pg, clickhouse and upstash as well as added route getWorkflowRunsHandler
183
+ - 4d67826: Fix eval writes, remove id column
184
+ - Updated dependencies [56c31b7]
185
+ - Updated dependencies [619c39d]
186
+ - Updated dependencies [5ae0180]
187
+ - Updated dependencies [fe56be0]
188
+ - Updated dependencies [93875ed]
189
+ - Updated dependencies [107bcfe]
190
+ - Updated dependencies [9bfa12b]
191
+ - Updated dependencies [515ebfb]
192
+ - Updated dependencies [5b4e19f]
193
+ - Updated dependencies [dbbbf80]
194
+ - Updated dependencies [a0967a0]
195
+ - Updated dependencies [fca3b21]
196
+ - Updated dependencies [88fa727]
197
+ - Updated dependencies [f37f535]
198
+ - Updated dependencies [a3f0e90]
199
+ - Updated dependencies [4d67826]
200
+ - Updated dependencies [6330967]
201
+ - Updated dependencies [8393832]
202
+ - Updated dependencies [6330967]
203
+ - Updated dependencies [99d43b9]
204
+ - Updated dependencies [d7e08e8]
205
+ - Updated dependencies [febc8a6]
206
+ - Updated dependencies [7599d77]
207
+ - Updated dependencies [0118361]
208
+ - Updated dependencies [619c39d]
209
+ - Updated dependencies [cafae83]
210
+ - Updated dependencies [8076ecf]
211
+ - Updated dependencies [8df4a77]
212
+ - Updated dependencies [304397c]
213
+ - @mastra/core@0.8.0
214
+
215
+ ## 0.2.7-alpha.7
216
+
217
+ ### Patch Changes
218
+
219
+ - Updated dependencies [8df4a77]
220
+ - @mastra/core@0.8.0-alpha.8
221
+
222
+ ## 0.2.7-alpha.6
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [febc8a6]
227
+ - @mastra/core@0.8.0-alpha.7
228
+
229
+ ## 0.2.7-alpha.5
230
+
231
+ ### Patch Changes
232
+
233
+ - Updated dependencies [a3f0e90]
234
+ - @mastra/core@0.8.0-alpha.6
235
+
236
+ ## 0.2.7-alpha.4
237
+
238
+ ### Patch Changes
239
+
240
+ - Updated dependencies [93875ed]
241
+ - @mastra/core@0.8.0-alpha.5
242
+
243
+ ## 0.2.7-alpha.3
244
+
245
+ ### Patch Changes
246
+
247
+ - Updated dependencies [d7e08e8]
248
+ - @mastra/core@0.8.0-alpha.4
249
+
250
+ ## 0.2.7-alpha.2
251
+
252
+ ### Patch Changes
253
+
254
+ - 88fa727: Added getWorkflowRuns for libsql, pg, clickhouse and upstash as well as added route getWorkflowRunsHandler
255
+ - 4d67826: Fix eval writes, remove id column
256
+ - Updated dependencies [5ae0180]
257
+ - Updated dependencies [9bfa12b]
258
+ - Updated dependencies [515ebfb]
259
+ - Updated dependencies [88fa727]
260
+ - Updated dependencies [f37f535]
261
+ - Updated dependencies [4d67826]
262
+ - Updated dependencies [6330967]
263
+ - Updated dependencies [8393832]
264
+ - Updated dependencies [6330967]
265
+ - @mastra/core@0.8.0-alpha.3
266
+
267
+ ## 0.2.7-alpha.1
268
+
269
+ ### Patch Changes
270
+
271
+ - dbbbf80: Added clickhouse storage
272
+ - Updated dependencies [56c31b7]
273
+ - Updated dependencies [dbbbf80]
274
+ - Updated dependencies [99d43b9]
275
+ - @mastra/core@0.8.0-alpha.2
package/LICENSE.md ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2025 Mastra AI, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,122 @@
1
+ # @mastra/clickhouse
2
+
3
+ Clickhouse implementation for Mastra, providing efficient storage capabilities with support for threads, messages, and workflow snapshots.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/clickhouse
9
+ ```
10
+
11
+ ## Prerequisites
12
+
13
+ - Clickhouse server (version 21.8 or higher recommended)
14
+ - Node.js 16 or higher
15
+
16
+ ## Usage
17
+
18
+ ```typescript
19
+ import { ClickhouseStore } from '@mastra/clickhouse';
20
+
21
+ const store = new ClickhouseStore({
22
+ url: 'http://localhost:8123',
23
+ username: 'default',
24
+ password: 'password',
25
+ });
26
+
27
+ // Create a thread
28
+ await store.saveThread({
29
+ id: 'thread-123',
30
+ resourceId: 'resource-456',
31
+ title: 'My Thread',
32
+ metadata: { key: 'value' },
33
+ createdAt: new Date(),
34
+ updatedAt: new Date(),
35
+ });
36
+
37
+ // Add messages to thread
38
+ await store.saveMessages([
39
+ {
40
+ id: 'msg-789',
41
+ threadId: 'thread-123',
42
+ role: 'user',
43
+ type: 'text',
44
+ content: [{ type: 'text', text: 'Hello' }],
45
+ createdAt: new Date(),
46
+ },
47
+ ]);
48
+
49
+ // Query threads and messages
50
+ const savedThread = await store.getThreadById({ threadId: 'thread-123' });
51
+ const messages = await store.getMessages({ threadId: 'thread-123' });
52
+
53
+ // Clean up
54
+ await store.close();
55
+ ```
56
+
57
+ ## Configuration
58
+
59
+ The Clickhouse store can be initialized with the following configuration:
60
+
61
+ ```typescript
62
+ type ClickhouseConfig = {
63
+ url: string; // Clickhouse HTTP interface URL
64
+ username: string; // Database username
65
+ password: string; // Database password
66
+ };
67
+ ```
68
+
69
+ ## Features
70
+
71
+ ### Storage Features
72
+
73
+ - Thread and message storage with JSON support
74
+ - Efficient batch operations
75
+ - Rich metadata support
76
+ - Timestamp tracking
77
+ - Workflow snapshot persistence
78
+ - Optimized for high-volume data ingestion
79
+ - Uses Clickhouse's MergeTree and ReplacingMergeTree engines for optimal performance
80
+
81
+ ### Table Engines
82
+
83
+ The store uses different table engines for different types of data:
84
+
85
+ - `MergeTree()`: Used for messages, traces, and evals
86
+ - `ReplacingMergeTree()`: Used for threads and workflow snapshots
87
+
88
+ ## Storage Methods
89
+
90
+ ### Thread Operations
91
+
92
+ - `saveThread(thread)`: Create or update a thread
93
+ - `getThreadById({ threadId })`: Get a thread by ID
94
+ - `updateThread({ id, title, metadata })`: Update thread title and metadata
95
+ - `deleteThread({ threadId })`: Delete a thread and its messages
96
+
97
+ ### Message Operations
98
+
99
+ - `saveMessages(messages)`: Save multiple messages
100
+ - `getMessages({ threadId, selectBy? })`: Get messages for a thread with optional filtering
101
+ - `deleteMessages(messageIds)`: Delete specific messages
102
+
103
+ ### Workflow Operations
104
+
105
+ - `persistWorkflowSnapshot({ workflowName, runId, snapshot })`: Save workflow state
106
+ - `loadWorkflowSnapshot({ workflowName, runId })`: Load workflow state
107
+
108
+ ## Data Types
109
+
110
+ The store supports the following data types:
111
+
112
+ - `text`: String
113
+ - `timestamp`: DateTime64(3)
114
+ - `uuid`: String
115
+ - `jsonb`: String (JSON serialized)
116
+ - `integer`: Int64
117
+ - `bigint`: Int64
118
+
119
+ ## Related Links
120
+
121
+ - [Clickhouse Documentation](https://clickhouse.com/docs)
122
+ - [Clickhouse Node.js Client](https://github.com/clickhouse/clickhouse-js)
@@ -0,0 +1,136 @@
1
+ import type { ClickHouseClient } from '@clickhouse/client';
2
+ import type { EvalRow } from '@mastra/core/storage';
3
+ import { MastraStorage } from '@mastra/core/storage';
4
+ import type { MessageType } from '@mastra/core/memory';
5
+ import type { StorageColumn } from '@mastra/core/storage';
6
+ import type { StorageGetMessagesArg } from '@mastra/core/storage';
7
+ import type { StorageThreadType } from '@mastra/core/memory';
8
+ import type { TABLE_NAMES } from '@mastra/core/storage';
9
+ import { TABLE_SCHEMAS } from '@mastra/core/storage';
10
+ import type { WorkflowRunState } from '@mastra/core/workflows';
11
+
12
+ declare type ClickhouseConfig = {
13
+ url: string;
14
+ username: string;
15
+ password: string;
16
+ ttl?: {
17
+ [TableKey in TABLE_NAMES]?: {
18
+ row?: {
19
+ interval: number;
20
+ unit: IntervalUnit;
21
+ ttlKey?: string;
22
+ };
23
+ columns?: Partial<{
24
+ [ColumnKey in keyof (typeof TABLE_SCHEMAS)[TableKey]]: {
25
+ interval: number;
26
+ unit: IntervalUnit;
27
+ ttlKey?: string;
28
+ };
29
+ }>;
30
+ };
31
+ };
32
+ };
33
+ export { ClickhouseConfig }
34
+ export { ClickhouseConfig as ClickhouseConfig_alias_1 }
35
+
36
+ declare class ClickhouseStore extends MastraStorage {
37
+ protected db: ClickHouseClient;
38
+ protected ttl: ClickhouseConfig['ttl'];
39
+ constructor(config: ClickhouseConfig);
40
+ private transformEvalRow;
41
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
42
+ batchInsert({ tableName, records }: {
43
+ tableName: TABLE_NAMES;
44
+ records: Record<string, any>[];
45
+ }): Promise<void>;
46
+ getTraces({ name, scope, page, perPage, attributes, filters, }: {
47
+ name?: string;
48
+ scope?: string;
49
+ page: number;
50
+ perPage: number;
51
+ attributes?: Record<string, string>;
52
+ filters?: Record<string, any>;
53
+ }): Promise<any[]>;
54
+ optimizeTable({ tableName }: {
55
+ tableName: TABLE_NAMES;
56
+ }): Promise<void>;
57
+ materializeTtl({ tableName }: {
58
+ tableName: TABLE_NAMES;
59
+ }): Promise<void>;
60
+ createTable({ tableName, schema, }: {
61
+ tableName: TABLE_NAMES;
62
+ schema: Record<string, StorageColumn>;
63
+ }): Promise<void>;
64
+ clearTable({ tableName }: {
65
+ tableName: TABLE_NAMES;
66
+ }): Promise<void>;
67
+ insert({ tableName, record }: {
68
+ tableName: TABLE_NAMES;
69
+ record: Record<string, any>;
70
+ }): Promise<void>;
71
+ load<R>({ tableName, keys }: {
72
+ tableName: TABLE_NAMES;
73
+ keys: Record<string, string>;
74
+ }): Promise<R | null>;
75
+ getThreadById({ threadId }: {
76
+ threadId: string;
77
+ }): Promise<StorageThreadType | null>;
78
+ getThreadsByResourceId({ resourceId }: {
79
+ resourceId: string;
80
+ }): Promise<StorageThreadType[]>;
81
+ saveThread({ thread }: {
82
+ thread: StorageThreadType;
83
+ }): Promise<StorageThreadType>;
84
+ updateThread({ id, title, metadata, }: {
85
+ id: string;
86
+ title: string;
87
+ metadata: Record<string, unknown>;
88
+ }): Promise<StorageThreadType>;
89
+ deleteThread({ threadId }: {
90
+ threadId: string;
91
+ }): Promise<void>;
92
+ getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
93
+ saveMessages({ messages }: {
94
+ messages: MessageType[];
95
+ }): Promise<MessageType[]>;
96
+ persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
97
+ workflowName: string;
98
+ runId: string;
99
+ snapshot: WorkflowRunState;
100
+ }): Promise<void>;
101
+ loadWorkflowSnapshot({ workflowName, runId, }: {
102
+ workflowName: string;
103
+ runId: string;
104
+ }): Promise<WorkflowRunState | null>;
105
+ getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, }?: {
106
+ workflowName?: string;
107
+ fromDate?: Date;
108
+ toDate?: Date;
109
+ limit?: number;
110
+ offset?: number;
111
+ }): Promise<{
112
+ runs: Array<{
113
+ workflowName: string;
114
+ runId: string;
115
+ snapshot: WorkflowRunState | string;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ }>;
119
+ total: number;
120
+ }>;
121
+ close(): Promise<void>;
122
+ }
123
+ export { ClickhouseStore }
124
+ export { ClickhouseStore as ClickhouseStore_alias_1 }
125
+
126
+ declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
127
+ export { COLUMN_TYPES }
128
+ export { COLUMN_TYPES as COLUMN_TYPES_alias_1 }
129
+
130
+ declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
131
+
132
+ declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
133
+ export { TABLE_ENGINES }
134
+ export { TABLE_ENGINES as TABLE_ENGINES_alias_1 }
135
+
136
+ export { }
@@ -0,0 +1,136 @@
1
+ import type { ClickHouseClient } from '@clickhouse/client';
2
+ import type { EvalRow } from '@mastra/core/storage';
3
+ import { MastraStorage } from '@mastra/core/storage';
4
+ import type { MessageType } from '@mastra/core/memory';
5
+ import type { StorageColumn } from '@mastra/core/storage';
6
+ import type { StorageGetMessagesArg } from '@mastra/core/storage';
7
+ import type { StorageThreadType } from '@mastra/core/memory';
8
+ import type { TABLE_NAMES } from '@mastra/core/storage';
9
+ import { TABLE_SCHEMAS } from '@mastra/core/storage';
10
+ import type { WorkflowRunState } from '@mastra/core/workflows';
11
+
12
+ declare type ClickhouseConfig = {
13
+ url: string;
14
+ username: string;
15
+ password: string;
16
+ ttl?: {
17
+ [TableKey in TABLE_NAMES]?: {
18
+ row?: {
19
+ interval: number;
20
+ unit: IntervalUnit;
21
+ ttlKey?: string;
22
+ };
23
+ columns?: Partial<{
24
+ [ColumnKey in keyof (typeof TABLE_SCHEMAS)[TableKey]]: {
25
+ interval: number;
26
+ unit: IntervalUnit;
27
+ ttlKey?: string;
28
+ };
29
+ }>;
30
+ };
31
+ };
32
+ };
33
+ export { ClickhouseConfig }
34
+ export { ClickhouseConfig as ClickhouseConfig_alias_1 }
35
+
36
+ declare class ClickhouseStore extends MastraStorage {
37
+ protected db: ClickHouseClient;
38
+ protected ttl: ClickhouseConfig['ttl'];
39
+ constructor(config: ClickhouseConfig);
40
+ private transformEvalRow;
41
+ getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
42
+ batchInsert({ tableName, records }: {
43
+ tableName: TABLE_NAMES;
44
+ records: Record<string, any>[];
45
+ }): Promise<void>;
46
+ getTraces({ name, scope, page, perPage, attributes, filters, }: {
47
+ name?: string;
48
+ scope?: string;
49
+ page: number;
50
+ perPage: number;
51
+ attributes?: Record<string, string>;
52
+ filters?: Record<string, any>;
53
+ }): Promise<any[]>;
54
+ optimizeTable({ tableName }: {
55
+ tableName: TABLE_NAMES;
56
+ }): Promise<void>;
57
+ materializeTtl({ tableName }: {
58
+ tableName: TABLE_NAMES;
59
+ }): Promise<void>;
60
+ createTable({ tableName, schema, }: {
61
+ tableName: TABLE_NAMES;
62
+ schema: Record<string, StorageColumn>;
63
+ }): Promise<void>;
64
+ clearTable({ tableName }: {
65
+ tableName: TABLE_NAMES;
66
+ }): Promise<void>;
67
+ insert({ tableName, record }: {
68
+ tableName: TABLE_NAMES;
69
+ record: Record<string, any>;
70
+ }): Promise<void>;
71
+ load<R>({ tableName, keys }: {
72
+ tableName: TABLE_NAMES;
73
+ keys: Record<string, string>;
74
+ }): Promise<R | null>;
75
+ getThreadById({ threadId }: {
76
+ threadId: string;
77
+ }): Promise<StorageThreadType | null>;
78
+ getThreadsByResourceId({ resourceId }: {
79
+ resourceId: string;
80
+ }): Promise<StorageThreadType[]>;
81
+ saveThread({ thread }: {
82
+ thread: StorageThreadType;
83
+ }): Promise<StorageThreadType>;
84
+ updateThread({ id, title, metadata, }: {
85
+ id: string;
86
+ title: string;
87
+ metadata: Record<string, unknown>;
88
+ }): Promise<StorageThreadType>;
89
+ deleteThread({ threadId }: {
90
+ threadId: string;
91
+ }): Promise<void>;
92
+ getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T>;
93
+ saveMessages({ messages }: {
94
+ messages: MessageType[];
95
+ }): Promise<MessageType[]>;
96
+ persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
97
+ workflowName: string;
98
+ runId: string;
99
+ snapshot: WorkflowRunState;
100
+ }): Promise<void>;
101
+ loadWorkflowSnapshot({ workflowName, runId, }: {
102
+ workflowName: string;
103
+ runId: string;
104
+ }): Promise<WorkflowRunState | null>;
105
+ getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, }?: {
106
+ workflowName?: string;
107
+ fromDate?: Date;
108
+ toDate?: Date;
109
+ limit?: number;
110
+ offset?: number;
111
+ }): Promise<{
112
+ runs: Array<{
113
+ workflowName: string;
114
+ runId: string;
115
+ snapshot: WorkflowRunState | string;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ }>;
119
+ total: number;
120
+ }>;
121
+ close(): Promise<void>;
122
+ }
123
+ export { ClickhouseStore }
124
+ export { ClickhouseStore as ClickhouseStore_alias_1 }
125
+
126
+ declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
127
+ export { COLUMN_TYPES }
128
+ export { COLUMN_TYPES as COLUMN_TYPES_alias_1 }
129
+
130
+ declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
131
+
132
+ declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
133
+ export { TABLE_ENGINES }
134
+ export { TABLE_ENGINES as TABLE_ENGINES_alias_1 }
135
+
136
+ export { }