@mastra/clickhouse 0.10.0 → 0.10.1-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 +7 -7
- package/CHANGELOG.md +9 -0
- package/dist/_tsup-dts-rollup.d.cts +3 -3
- package/dist/_tsup-dts-rollup.d.ts +3 -3
- package/dist/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +3 -3
- package/src/storage/index.test.ts +2 -0
- package/src/storage/index.ts +5 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/clickhouse@0.10.
|
|
2
|
+
> @mastra/clickhouse@0.10.1-alpha.0 build /home/runner/work/mastra/mastra/stores/clickhouse
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 8497ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 11334ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mESM[39m [1mdist/index.js [22m[32m27.
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
22
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m28.
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m27.83 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 1072ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m28.07 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 1072ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/clickhouse
|
|
2
2
|
|
|
3
|
+
## 0.10.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e5dc18d: Added a backwards compatible layer to begin storing/retrieving UIMessages in storage instead of CoreMessages
|
|
8
|
+
- Updated dependencies [592a2db]
|
|
9
|
+
- Updated dependencies [e5dc18d]
|
|
10
|
+
- @mastra/core@0.10.2-alpha.0
|
|
11
|
+
|
|
3
12
|
## 0.10.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import type { EvalRow } from '@mastra/core/storage';
|
|
3
|
+
import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
3
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
4
|
-
import type { MessageType } from '@mastra/core/memory';
|
|
5
5
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
6
6
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
7
7
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
@@ -95,8 +95,8 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
95
95
|
}): Promise<void>;
|
|
96
96
|
getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T[]>;
|
|
97
97
|
saveMessages({ messages }: {
|
|
98
|
-
messages:
|
|
99
|
-
}): Promise<
|
|
98
|
+
messages: MastraMessageV2[];
|
|
99
|
+
}): Promise<MastraMessageV2[]>;
|
|
100
100
|
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
101
101
|
workflowName: string;
|
|
102
102
|
runId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import type { EvalRow } from '@mastra/core/storage';
|
|
3
|
+
import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
3
4
|
import { MastraStorage } from '@mastra/core/storage';
|
|
4
|
-
import type { MessageType } from '@mastra/core/memory';
|
|
5
5
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
6
6
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
7
7
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
@@ -95,8 +95,8 @@ declare class ClickhouseStore extends MastraStorage {
|
|
|
95
95
|
}): Promise<void>;
|
|
96
96
|
getMessages<T = unknown>({ threadId, selectBy }: StorageGetMessagesArg): Promise<T[]>;
|
|
97
97
|
saveMessages({ messages }: {
|
|
98
|
-
messages:
|
|
99
|
-
}): Promise<
|
|
98
|
+
messages: MastraMessageV2[];
|
|
99
|
+
}): Promise<MastraMessageV2[]>;
|
|
100
100
|
persistWorkflowSnapshot({ workflowName, runId, snapshot, }: {
|
|
101
101
|
workflowName: string;
|
|
102
102
|
runId: string;
|
package/dist/index.cjs
CHANGED
|
@@ -603,6 +603,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
603
603
|
} catch {
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
+
if (message.type === `v2`) delete message.type;
|
|
606
607
|
});
|
|
607
608
|
return messages;
|
|
608
609
|
} catch (error) {
|
|
@@ -630,7 +631,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
|
|
|
630
631
|
content: typeof message.content === "string" ? message.content : JSON.stringify(message.content),
|
|
631
632
|
createdAt: message.createdAt.toISOString(),
|
|
632
633
|
role: message.role,
|
|
633
|
-
type: message.type
|
|
634
|
+
type: message.type || "v2"
|
|
634
635
|
})),
|
|
635
636
|
clickhouse_settings: {
|
|
636
637
|
// Allows to insert serialized JS Dates (such as '2023-12-06T10:54:48.000Z')
|
package/dist/index.js
CHANGED
|
@@ -601,6 +601,7 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
601
601
|
} catch {
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
+
if (message.type === `v2`) delete message.type;
|
|
604
605
|
});
|
|
605
606
|
return messages;
|
|
606
607
|
} catch (error) {
|
|
@@ -628,7 +629,7 @@ var ClickhouseStore = class extends MastraStorage {
|
|
|
628
629
|
content: typeof message.content === "string" ? message.content : JSON.stringify(message.content),
|
|
629
630
|
createdAt: message.createdAt.toISOString(),
|
|
630
631
|
role: message.role,
|
|
631
|
-
type: message.type
|
|
632
|
+
type: message.type || "v2"
|
|
632
633
|
})),
|
|
633
634
|
clickhouse_settings: {
|
|
634
635
|
// Allows to insert serialized JS Dates (such as '2023-12-06T10:54:48.000Z')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/clickhouse",
|
|
3
|
-
"version": "0.10.0",
|
|
3
|
+
"version": "0.10.1-alpha.0",
|
|
4
4
|
"description": "Clickhouse provider for Mastra - includes db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"tsup": "^8.4.0",
|
|
30
30
|
"typescript": "^5.8.2",
|
|
31
31
|
"vitest": "^3.1.2",
|
|
32
|
-
"@internal/lint": "0.0.
|
|
33
|
-
"@mastra/core": "0.10.0"
|
|
32
|
+
"@internal/lint": "0.0.7",
|
|
33
|
+
"@mastra/core": "0.10.2-alpha.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@mastra/core": "^0.10.0"
|
package/src/storage/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ClickHouseClient } from '@clickhouse/client';
|
|
2
2
|
import { createClient } from '@clickhouse/client';
|
|
3
|
+
import type { MastraMessageV2 } from '@mastra/core/agent';
|
|
3
4
|
import type { MetricResult, TestInfo } from '@mastra/core/eval';
|
|
4
|
-
import type {
|
|
5
|
+
import type { StorageThreadType } from '@mastra/core/memory';
|
|
5
6
|
import {
|
|
6
7
|
MastraStorage,
|
|
7
8
|
TABLE_EVALS,
|
|
@@ -751,6 +752,7 @@ export class ClickhouseStore extends MastraStorage {
|
|
|
751
752
|
// If parsing fails, leave as string
|
|
752
753
|
}
|
|
753
754
|
}
|
|
755
|
+
if (message.type === `v2`) delete message.type;
|
|
754
756
|
});
|
|
755
757
|
|
|
756
758
|
return messages as T[];
|
|
@@ -760,7 +762,7 @@ export class ClickhouseStore extends MastraStorage {
|
|
|
760
762
|
}
|
|
761
763
|
}
|
|
762
764
|
|
|
763
|
-
async saveMessages({ messages }: { messages:
|
|
765
|
+
async saveMessages({ messages }: { messages: MastraMessageV2[] }): Promise<MastraMessageV2[]> {
|
|
764
766
|
if (messages.length === 0) return messages;
|
|
765
767
|
|
|
766
768
|
try {
|
|
@@ -784,7 +786,7 @@ export class ClickhouseStore extends MastraStorage {
|
|
|
784
786
|
content: typeof message.content === 'string' ? message.content : JSON.stringify(message.content),
|
|
785
787
|
createdAt: message.createdAt.toISOString(),
|
|
786
788
|
role: message.role,
|
|
787
|
-
type: message.type,
|
|
789
|
+
type: message.type || 'v2',
|
|
788
790
|
})),
|
|
789
791
|
clickhouse_settings: {
|
|
790
792
|
// Allows to insert serialized JS Dates (such as '2023-12-06T10:54:48.000Z')
|