@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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/clickhouse@0.10.0-alpha.1 build /home/runner/work/mastra/mastra/stores/clickhouse
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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 8589ms
9
+ TSC ⚡️ Build success in 8497ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 11115ms
16
+ DTS ⚡️ Build success in 11334ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 27.77 KB
21
- ESM ⚡️ Build success in 963ms
22
- CJS dist/index.cjs 28.01 KB
23
- CJS ⚡️ Build success in 986ms
20
+ ESM dist/index.js 27.83 KB
21
+ ESM ⚡️ Build success in 1072ms
22
+ CJS dist/index.cjs 28.07 KB
23
+ CJS ⚡️ 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: MessageType[];
99
- }): Promise<MessageType[]>;
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: MessageType[];
99
- }): Promise<MessageType[]>;
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.6",
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"
@@ -72,6 +72,8 @@ const createSampleWorkflowSnapshot = (status: WorkflowRunState['context']['steps
72
72
  status,
73
73
  payload: {},
74
74
  error: undefined,
75
+ startedAt: timestamp.getTime(),
76
+ endedAt: new Date(timestamp.getTime() + 15000).getTime(),
75
77
  },
76
78
  input: {},
77
79
  },
@@ -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 { MessageType, StorageThreadType } from '@mastra/core/memory';
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: MessageType[] }): Promise<MessageType[]> {
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')