@mastra/clickhouse 0.0.0-workflow-deno-20250616130925 → 0.0.0-working-memory-per-user-20250620161509

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 CHANGED
@@ -1,6 +1,28 @@
1
1
  # @mastra/clickhouse
2
2
 
3
- ## 0.0.0-workflow-deno-20250616130925
3
+ ## 0.0.0-working-memory-per-user-20250620161509
4
+
5
+ ### Patch Changes
6
+
7
+ - d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
8
+ - 2097952: [MASTRA-4021] Fix PG getMessages and update messageLimit for all storage adapters
9
+ - Updated dependencies [d8f2d19]
10
+ - Updated dependencies [9d52b17]
11
+ - Updated dependencies [2097952]
12
+ - Updated dependencies [8ba1b51]
13
+ - @mastra/core@0.0.0-working-memory-per-user-20250620161509
14
+
15
+ ## 0.11.1-alpha.0
16
+
17
+ ### Patch Changes
18
+
19
+ - d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
20
+ - Updated dependencies [d8f2d19]
21
+ - Updated dependencies [9d52b17]
22
+ - Updated dependencies [8ba1b51]
23
+ - @mastra/core@0.10.7-alpha.0
24
+
25
+ ## 0.11.0
4
26
 
5
27
  ### Minor Changes
6
28
 
@@ -18,14 +40,21 @@
18
40
  - 63f6b7d: dependencies updates:
19
41
  - Updated dependency [`@clickhouse/client@^1.11.2` ↗︎](https://www.npmjs.com/package/@clickhouse/client/v/1.11.2) (from `^1.11.0`, in `dependencies`)
20
42
  - Updated dependencies [63f6b7d]
43
+ - Updated dependencies [12a95fc]
44
+ - Updated dependencies [4b0f8a6]
45
+ - Updated dependencies [51264a5]
46
+ - Updated dependencies [8e6f677]
47
+ - Updated dependencies [d70c420]
21
48
  - Updated dependencies [ee9af57]
22
49
  - Updated dependencies [36f1c36]
50
+ - Updated dependencies [2a16996]
23
51
  - Updated dependencies [10d352e]
24
- - Updated dependencies [3ca9a67]
52
+ - Updated dependencies [9589624]
25
53
  - Updated dependencies [53d3c37]
54
+ - Updated dependencies [751c894]
26
55
  - Updated dependencies [577ce3a]
27
56
  - Updated dependencies [9260b3a]
28
- - @mastra/core@0.0.0-workflow-deno-20250616130925
57
+ - @mastra/core@0.10.6
29
58
 
30
59
  ## 0.11.0-alpha.1
31
60
 
@@ -1,5 +1,6 @@
1
1
  import type { ClickHouseClient } from '@clickhouse/client';
2
2
  import type { EvalRow } from '@mastra/core/storage';
3
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
3
4
  import type { MastraMessageV1 } from '@mastra/core/memory';
4
5
  import type { MastraMessageV2 } from '@mastra/core/memory';
5
6
  import { MastraStorage } from '@mastra/core/storage';
@@ -160,6 +161,15 @@ declare class ClickhouseStore extends MastraStorage {
160
161
  messages: MastraMessageV1[] | MastraMessageV2[];
161
162
  }>;
162
163
  close(): Promise<void>;
164
+ updateMessages(_args: {
165
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
166
+ id: string;
167
+ content?: {
168
+ metadata?: MastraMessageContentV2['metadata'];
169
+ content?: MastraMessageContentV2['content'];
170
+ };
171
+ }[];
172
+ }): Promise<MastraMessageV2[]>;
163
173
  }
164
174
  export { ClickhouseStore }
165
175
  export { ClickhouseStore as ClickhouseStore_alias_1 }
@@ -1,5 +1,6 @@
1
1
  import type { ClickHouseClient } from '@clickhouse/client';
2
2
  import type { EvalRow } from '@mastra/core/storage';
3
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
3
4
  import type { MastraMessageV1 } from '@mastra/core/memory';
4
5
  import type { MastraMessageV2 } from '@mastra/core/memory';
5
6
  import { MastraStorage } from '@mastra/core/storage';
@@ -160,6 +161,15 @@ declare class ClickhouseStore extends MastraStorage {
160
161
  messages: MastraMessageV1[] | MastraMessageV2[];
161
162
  }>;
162
163
  close(): Promise<void>;
164
+ updateMessages(_args: {
165
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
166
+ id: string;
167
+ content?: {
168
+ metadata?: MastraMessageContentV2['metadata'];
169
+ content?: MastraMessageContentV2['content'];
170
+ };
171
+ }[];
172
+ }): Promise<MastraMessageV2[]>;
163
173
  }
164
174
  export { ClickhouseStore }
165
175
  export { ClickhouseStore as ClickhouseStore_alias_1 }
package/dist/index.cjs CHANGED
@@ -17,7 +17,8 @@ var TABLE_ENGINES = {
17
17
  [storage.TABLE_WORKFLOW_SNAPSHOT]: `ReplacingMergeTree()`,
18
18
  [storage.TABLE_TRACES]: `MergeTree()`,
19
19
  [storage.TABLE_THREADS]: `ReplacingMergeTree()`,
20
- [storage.TABLE_EVALS]: `MergeTree()`
20
+ [storage.TABLE_EVALS]: `MergeTree()`,
21
+ [storage.TABLE_RESOURCES]: `ReplacingMergeTree()`
21
22
  };
22
23
  var COLUMN_TYPES = {
23
24
  text: "String",
@@ -575,7 +576,7 @@ var ClickhouseStore = class extends storage.MastraStorage {
575
576
  }) {
576
577
  try {
577
578
  const messages = [];
578
- const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;
579
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: 40 });
579
580
  const include = selectBy?.include || [];
580
581
  if (include.length) {
581
582
  const includeResult = await this.db.query({
@@ -950,6 +951,10 @@ var ClickhouseStore = class extends storage.MastraStorage {
950
951
  async close() {
951
952
  await this.db.close();
952
953
  }
954
+ async updateMessages(_args) {
955
+ this.logger.error("updateMessages is not yet implemented in ClickhouseStore");
956
+ throw new Error("Method not implemented");
957
+ }
953
958
  };
954
959
 
955
960
  exports.COLUMN_TYPES = COLUMN_TYPES;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createClient } from '@clickhouse/client';
2
2
  import { MessageList } from '@mastra/core/agent';
3
- import { TABLE_EVALS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, TABLE_SCHEMAS } from '@mastra/core/storage';
3
+ import { TABLE_RESOURCES, TABLE_EVALS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, TABLE_SCHEMAS } from '@mastra/core/storage';
4
4
 
5
5
  // src/storage/index.ts
6
6
  function safelyParseJSON(jsonString) {
@@ -15,7 +15,8 @@ var TABLE_ENGINES = {
15
15
  [TABLE_WORKFLOW_SNAPSHOT]: `ReplacingMergeTree()`,
16
16
  [TABLE_TRACES]: `MergeTree()`,
17
17
  [TABLE_THREADS]: `ReplacingMergeTree()`,
18
- [TABLE_EVALS]: `MergeTree()`
18
+ [TABLE_EVALS]: `MergeTree()`,
19
+ [TABLE_RESOURCES]: `ReplacingMergeTree()`
19
20
  };
20
21
  var COLUMN_TYPES = {
21
22
  text: "String",
@@ -573,7 +574,7 @@ var ClickhouseStore = class extends MastraStorage {
573
574
  }) {
574
575
  try {
575
576
  const messages = [];
576
- const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;
577
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: 40 });
577
578
  const include = selectBy?.include || [];
578
579
  if (include.length) {
579
580
  const includeResult = await this.db.query({
@@ -948,6 +949,10 @@ var ClickhouseStore = class extends MastraStorage {
948
949
  async close() {
949
950
  await this.db.close();
950
951
  }
952
+ async updateMessages(_args) {
953
+ this.logger.error("updateMessages is not yet implemented in ClickhouseStore");
954
+ throw new Error("Method not implemented");
955
+ }
951
956
  };
952
957
 
953
958
  export { COLUMN_TYPES, ClickhouseStore, TABLE_ENGINES };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/clickhouse",
3
- "version": "0.0.0-workflow-deno-20250616130925",
3
+ "version": "0.0.0-working-memory-per-user-20250620161509",
4
4
  "description": "Clickhouse provider for Mastra - includes db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,12 +29,12 @@
29
29
  "tsup": "^8.5.0",
30
30
  "typescript": "^5.8.3",
31
31
  "vitest": "^3.2.3",
32
- "@internal/lint": "0.0.0-workflow-deno-20250616130925",
33
- "@mastra/core": "0.0.0-workflow-deno-20250616130925",
34
- "@internal/storage-test-utils": "0.0.0-workflow-deno-20250616130925"
32
+ "@internal/lint": "0.0.0-working-memory-per-user-20250620161509",
33
+ "@internal/storage-test-utils": "0.0.9",
34
+ "@mastra/core": "0.0.0-working-memory-per-user-20250620161509"
35
35
  },
36
36
  "peerDependencies": {
37
- "@mastra/core": ">=0.10.4-0 <0.11.0"
37
+ "@mastra/core": "0.0.0-working-memory-per-user-20250620161509"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -1,12 +1,14 @@
1
1
  import type { ClickHouseClient } from '@clickhouse/client';
2
2
  import { createClient } from '@clickhouse/client';
3
3
  import { MessageList } from '@mastra/core/agent';
4
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
4
5
  import type { MetricResult, TestInfo } from '@mastra/core/eval';
5
6
  import type { MastraMessageV1, MastraMessageV2, StorageThreadType } from '@mastra/core/memory';
6
7
  import {
7
8
  MastraStorage,
8
9
  TABLE_EVALS,
9
10
  TABLE_MESSAGES,
11
+ TABLE_RESOURCES,
10
12
  TABLE_SCHEMAS,
11
13
  TABLE_THREADS,
12
14
  TABLE_TRACES,
@@ -70,6 +72,7 @@ export const TABLE_ENGINES: Record<TABLE_NAMES, string> = {
70
72
  [TABLE_TRACES]: `MergeTree()`,
71
73
  [TABLE_THREADS]: `ReplacingMergeTree()`,
72
74
  [TABLE_EVALS]: `MergeTree()`,
75
+ [TABLE_RESOURCES]: `ReplacingMergeTree()`,
73
76
  };
74
77
 
75
78
  export const COLUMN_TYPES: Record<StorageColumn['type'], string> = {
@@ -730,7 +733,7 @@ export class ClickhouseStore extends MastraStorage {
730
733
  }: StorageGetMessagesArg & { format?: 'v1' | 'v2' }): Promise<MastraMessageV1[] | MastraMessageV2[]> {
731
734
  try {
732
735
  const messages: any[] = [];
733
- const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;
736
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: 40 });
734
737
  const include = selectBy?.include || [];
735
738
 
736
739
  if (include.length) {
@@ -1186,4 +1189,15 @@ export class ClickhouseStore extends MastraStorage {
1186
1189
  async close(): Promise<void> {
1187
1190
  await this.db.close();
1188
1191
  }
1192
+
1193
+ async updateMessages(_args: {
1194
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> &
1195
+ {
1196
+ id: string;
1197
+ content?: { metadata?: MastraMessageContentV2['metadata']; content?: MastraMessageContentV2['content'] };
1198
+ }[];
1199
+ }): Promise<MastraMessageV2[]> {
1200
+ this.logger.error('updateMessages is not yet implemented in ClickhouseStore');
1201
+ throw new Error('Method not implemented');
1202
+ }
1189
1203
  }
@@ -1,23 +0,0 @@
1
-
2
- > @mastra/clickhouse@0.11.0-alpha.1 build /home/runner/work/mastra/mastra/stores/clickhouse
3
- > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
-
5
- CLI Building entry: src/index.ts
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.5.0
8
- TSC Build start
9
- TSC ⚡️ Build success in 9413ms
10
- DTS Build start
11
- CLI Target: es2022
12
- Analysis will use the bundled TypeScript version 5.8.3
13
- Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.ts
14
- Analysis will use the bundled TypeScript version 5.8.3
15
- Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 11648ms
17
- CLI Cleaning output folder
18
- ESM Build start
19
- CJS Build start
20
- CJS dist/index.cjs 31.44 KB
21
- CJS ⚡️ Build success in 905ms
22
- ESM dist/index.js 31.18 KB
23
- ESM ⚡️ Build success in 912ms