@mastra/clickhouse 0.0.0-toolOptionTypes-20250917085558 → 0.0.0-trace-timeline-update-20251121114225
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 +599 -3
- package/README.md +47 -21
- package/dist/index.cjs +416 -868
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +417 -869
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +14 -39
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/operations/index.d.ts.map +1 -1
- package/dist/storage/domains/scores/index.d.ts +12 -4
- package/dist/storage/domains/scores/index.d.ts.map +1 -1
- package/dist/storage/domains/utils.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +3 -10
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts +24 -68
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +14 -9
- package/dist/storage/domains/legacy-evals/index.d.ts +0 -21
- package/dist/storage/domains/legacy-evals/index.d.ts.map +0 -1
- package/dist/storage/domains/traces/index.d.ts +0 -21
- package/dist/storage/domains/traces/index.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -26,29 +26,32 @@ const store = new ClickhouseStore({
|
|
|
26
26
|
|
|
27
27
|
// Create a thread
|
|
28
28
|
await store.saveThread({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
thread: {
|
|
30
|
+
id: 'thread-123',
|
|
31
|
+
resourceId: 'resource-456',
|
|
32
|
+
title: 'My Thread',
|
|
33
|
+
metadata: { key: 'value' },
|
|
34
|
+
createdAt: new Date(),
|
|
35
|
+
},
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
// Add messages to thread
|
|
38
|
-
await store.saveMessages(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
await store.saveMessages({
|
|
40
|
+
messages: [
|
|
41
|
+
{
|
|
42
|
+
id: 'msg-789',
|
|
43
|
+
threadId: 'thread-123',
|
|
44
|
+
role: 'user',
|
|
45
|
+
content: { content: 'Hello' },
|
|
46
|
+
resourceId: 'resource-456',
|
|
47
|
+
createdAt: new Date(),
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
});
|
|
48
51
|
|
|
49
52
|
// Query threads and messages
|
|
50
53
|
const savedThread = await store.getThreadById({ threadId: 'thread-123' });
|
|
51
|
-
const messages = await store.
|
|
54
|
+
const { messages } = await store.listMessages({ threadId: 'thread-123' });
|
|
52
55
|
|
|
53
56
|
// Clean up
|
|
54
57
|
await store.close();
|
|
@@ -89,21 +92,44 @@ The store uses different table engines for different types of data:
|
|
|
89
92
|
|
|
90
93
|
### Thread Operations
|
|
91
94
|
|
|
92
|
-
- `saveThread(thread)`: Create or update a thread
|
|
95
|
+
- `saveThread({ thread })`: Create or update a thread
|
|
93
96
|
- `getThreadById({ threadId })`: Get a thread by ID
|
|
97
|
+
- `listThreadsByResourceId({ resourceId, offset, limit, orderBy? })`: List paginated threads for a resource
|
|
94
98
|
- `updateThread({ id, title, metadata })`: Update thread title and metadata
|
|
95
99
|
- `deleteThread({ threadId })`: Delete a thread and its messages
|
|
96
100
|
|
|
97
101
|
### Message Operations
|
|
98
102
|
|
|
99
|
-
- `saveMessages(messages)`: Save multiple messages
|
|
100
|
-
- `
|
|
101
|
-
- `
|
|
103
|
+
- `saveMessages({ messages })`: Save multiple messages
|
|
104
|
+
- `listMessages({ threadId, perPage?, page? })`: Get messages for a thread with pagination
|
|
105
|
+
- `updateMessages({ messages })`: Update existing messages
|
|
106
|
+
|
|
107
|
+
### Resource Operations
|
|
108
|
+
|
|
109
|
+
- `getResourceById({ resourceId })`: Get a resource by ID
|
|
110
|
+
- `saveResource({ resource })`: Create or save a resource
|
|
111
|
+
- `updateResource({ resourceId, workingMemory })`: Update resource working memory
|
|
102
112
|
|
|
103
113
|
### Workflow Operations
|
|
104
114
|
|
|
105
115
|
- `persistWorkflowSnapshot({ workflowName, runId, snapshot })`: Save workflow state
|
|
106
116
|
- `loadWorkflowSnapshot({ workflowName, runId })`: Load workflow state
|
|
117
|
+
- `listWorkflowRuns({ workflowName, pagination })`: List workflow runs with pagination
|
|
118
|
+
- `getWorkflowRunById({ workflowName, runId })`: Get a specific workflow run
|
|
119
|
+
|
|
120
|
+
### Evaluation/Scoring Operations
|
|
121
|
+
|
|
122
|
+
- `getScoreById({ id })`: Get a score by ID
|
|
123
|
+
- `saveScore(score)`: Save an evaluation score
|
|
124
|
+
- `listScoresByScorerId({ scorerId, pagination })`: List scores by scorer with pagination
|
|
125
|
+
- `listScoresByRunId({ runId, pagination })`: List scores by run with pagination
|
|
126
|
+
- `listScoresByEntityId({ entityId, entityType, pagination })`: List scores by entity with pagination
|
|
127
|
+
- `listScoresBySpan({ traceId, spanId, pagination })`: List scores by span with pagination
|
|
128
|
+
|
|
129
|
+
### Operations Not Currently Supported
|
|
130
|
+
|
|
131
|
+
- `deleteMessages(messageIds)`: Message deletion is not supported in ClickHouse
|
|
132
|
+
- AI Observability (traces/spans): Not currently supported
|
|
107
133
|
|
|
108
134
|
## Data Types
|
|
109
135
|
|