@mastra/convex 0.1.0-beta.5 → 0.1.0-beta.6
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 +218 -0
- package/dist/chunk-H5QJE733.cjs +104 -0
- package/dist/chunk-H5QJE733.cjs.map +1 -0
- package/dist/chunk-HXB4DWFE.js +73 -0
- package/dist/chunk-HXB4DWFE.js.map +1 -0
- package/dist/index.cjs +180 -281
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +168 -269
- package/dist/index.js.map +1 -1
- package/dist/schema.cjs +17 -17
- package/dist/schema.d.ts +52 -75
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -1
- package/dist/server/index.cjs +14 -14
- package/dist/server/index.js +1 -1
- package/dist/storage/db/index.d.ts +57 -0
- package/dist/storage/db/index.d.ts.map +1 -0
- package/dist/storage/domains/{memory.d.ts → memory/index.d.ts} +6 -4
- package/dist/storage/domains/memory/index.d.ts.map +1 -0
- package/dist/storage/domains/{scores.d.ts → scores/index.d.ts} +11 -18
- package/dist/storage/domains/scores/index.d.ts.map +1 -0
- package/dist/storage/domains/{workflows.d.ts → workflows/index.d.ts} +6 -4
- package/dist/storage/domains/workflows/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +50 -151
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-PKUUSREO.js +0 -76
- package/dist/chunk-PKUUSREO.js.map +0 -1
- package/dist/chunk-ZBUP3DS6.cjs +0 -93
- package/dist/chunk-ZBUP3DS6.cjs.map +0 -1
- package/dist/server/schema.d.ts +0 -115
- package/dist/server/schema.d.ts.map +0 -1
- package/dist/storage/domains/memory.d.ts.map +0 -1
- package/dist/storage/domains/scores.d.ts.map +0 -1
- package/dist/storage/domains/workflows.d.ts.map +0 -1
- package/dist/storage/operations.d.ts +0 -40
- package/dist/storage/operations.d.ts.map +0 -1
package/dist/schema.d.ts
CHANGED
|
@@ -1,103 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convex schema definitions for Mastra tables.
|
|
3
|
+
*
|
|
4
|
+
* This file dynamically builds Convex table definitions from the canonical
|
|
5
|
+
* TABLE_SCHEMAS in @mastra/core/storage/constants to ensure they stay in sync.
|
|
6
|
+
*
|
|
7
|
+
* The import path @mastra/core/storage/constants is specifically designed to
|
|
8
|
+
* avoid pulling in Node.js dependencies, making it safe to use in Convex's
|
|
9
|
+
* sandboxed schema evaluation environment.
|
|
10
|
+
*/
|
|
11
|
+
import { TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS, TABLE_RESOURCES, TABLE_SCORERS } from '@mastra/core/storage/constants';
|
|
12
|
+
/**
|
|
13
|
+
* Threads table - stores conversation threads
|
|
14
|
+
* Schema: TABLE_SCHEMAS[TABLE_THREADS]
|
|
15
|
+
*/
|
|
1
16
|
export declare const mastraThreadsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
id: string;
|
|
5
|
-
createdAt: string;
|
|
6
|
-
updatedAt: string;
|
|
7
|
-
}, {
|
|
8
|
-
id: import("convex/values").VString<string, "required">;
|
|
9
|
-
resourceId: import("convex/values").VString<string, "optional">;
|
|
10
|
-
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
11
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
12
|
-
updatedAt: import("convex/values").VString<string, "required">;
|
|
13
|
-
}, "required", "id" | "createdAt" | "resourceId" | "metadata" | "updatedAt" | `metadata.${string}`>, {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
}, Record<string, any>, "required", string>, {
|
|
14
19
|
by_record_id: ["id", "_creationTime"];
|
|
15
20
|
by_resource: ["resourceId", "_creationTime"];
|
|
16
21
|
by_created: ["createdAt", "_creationTime"];
|
|
17
22
|
by_updated: ["updatedAt", "_creationTime"];
|
|
18
23
|
}, {}, {}>;
|
|
24
|
+
/**
|
|
25
|
+
* Messages table - stores conversation messages
|
|
26
|
+
* Schema: TABLE_SCHEMAS[TABLE_MESSAGES]
|
|
27
|
+
*/
|
|
19
28
|
export declare const mastraMessagesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
createdAt: string;
|
|
23
|
-
role: string;
|
|
24
|
-
type: string;
|
|
25
|
-
content: string;
|
|
26
|
-
thread_id: string;
|
|
27
|
-
}, {
|
|
28
|
-
id: import("convex/values").VString<string, "required">;
|
|
29
|
-
thread_id: import("convex/values").VString<string, "required">;
|
|
30
|
-
content: import("convex/values").VString<string, "required">;
|
|
31
|
-
role: import("convex/values").VString<string, "required">;
|
|
32
|
-
type: import("convex/values").VString<string, "required">;
|
|
33
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
34
|
-
resourceId: import("convex/values").VString<string, "optional">;
|
|
35
|
-
}, "required", "id" | "createdAt" | "role" | "resourceId" | "type" | "content" | "thread_id">, {
|
|
29
|
+
[x: string]: any;
|
|
30
|
+
}, Record<string, any>, "required", string>, {
|
|
36
31
|
by_record_id: ["id", "_creationTime"];
|
|
37
32
|
by_thread: ["thread_id", "_creationTime"];
|
|
38
33
|
by_thread_created: ["thread_id", "createdAt", "_creationTime"];
|
|
39
34
|
by_resource: ["resourceId", "_creationTime"];
|
|
40
35
|
}, {}, {}>;
|
|
36
|
+
/**
|
|
37
|
+
* Resources table - stores resource/user working memory
|
|
38
|
+
* Schema: TABLE_SCHEMAS[TABLE_RESOURCES]
|
|
39
|
+
*/
|
|
41
40
|
export declare const mastraResourcesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
updatedAt: string;
|
|
45
|
-
data: any;
|
|
46
|
-
}, {
|
|
47
|
-
id: import("convex/values").VString<string, "required">;
|
|
48
|
-
data: import("convex/values").VAny<any, "required", string>;
|
|
49
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
50
|
-
updatedAt: import("convex/values").VString<string, "required">;
|
|
51
|
-
}, "required", "id" | "createdAt" | "updatedAt" | "data" | `data.${string}`>, {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
}, Record<string, any>, "required", string>, {
|
|
52
43
|
by_record_id: ["id", "_creationTime"];
|
|
53
44
|
by_updated: ["updatedAt", "_creationTime"];
|
|
54
45
|
}, {}, {}>;
|
|
46
|
+
/**
|
|
47
|
+
* Workflow snapshots table - stores workflow execution state
|
|
48
|
+
* Schema: TABLE_SCHEMAS[TABLE_WORKFLOW_SNAPSHOT]
|
|
49
|
+
*/
|
|
55
50
|
export declare const mastraWorkflowSnapshotsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
run_id: string;
|
|
59
|
-
workflow_name: string;
|
|
60
|
-
createdAt: string;
|
|
61
|
-
state: any;
|
|
62
|
-
}, {
|
|
63
|
-
id: import("convex/values").VString<string, "required">;
|
|
64
|
-
workflow_name: import("convex/values").VString<string, "required">;
|
|
65
|
-
run_id: import("convex/values").VString<string, "required">;
|
|
66
|
-
state: import("convex/values").VAny<any, "required", string>;
|
|
67
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
68
|
-
resourceId: import("convex/values").VString<string, "optional">;
|
|
69
|
-
}, "required", "id" | "run_id" | "workflow_name" | "createdAt" | "resourceId" | "state" | `state.${string}`>, {
|
|
51
|
+
[x: string]: any;
|
|
52
|
+
}, Record<string, any>, "required", string>, {
|
|
70
53
|
by_record_id: ["id", "_creationTime"];
|
|
71
54
|
by_workflow_run: ["workflow_name", "run_id", "_creationTime"];
|
|
72
55
|
by_workflow: ["workflow_name", "_creationTime"];
|
|
73
56
|
by_resource: ["resourceId", "_creationTime"];
|
|
74
57
|
by_created: ["createdAt", "_creationTime"];
|
|
75
58
|
}, {}, {}>;
|
|
59
|
+
/**
|
|
60
|
+
* Scores table - stores evaluation scores
|
|
61
|
+
* Schema: TABLE_SCHEMAS[TABLE_SCORERS]
|
|
62
|
+
*/
|
|
76
63
|
export declare const mastraScoresTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
id: string;
|
|
80
|
-
createdAt: string;
|
|
81
|
-
score: number;
|
|
82
|
-
entityType: string;
|
|
83
|
-
entityId: string;
|
|
84
|
-
scorerId: string;
|
|
85
|
-
}, {
|
|
86
|
-
id: import("convex/values").VString<string, "required">;
|
|
87
|
-
scorerId: import("convex/values").VString<string, "required">;
|
|
88
|
-
entityId: import("convex/values").VString<string, "required">;
|
|
89
|
-
entityType: import("convex/values").VString<string, "required">;
|
|
90
|
-
score: import("convex/values").VFloat64<number, "required">;
|
|
91
|
-
runId: import("convex/values").VString<string, "optional">;
|
|
92
|
-
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
93
|
-
createdAt: import("convex/values").VString<string, "required">;
|
|
94
|
-
}, "required", "id" | "runId" | "createdAt" | "metadata" | "score" | "entityType" | "entityId" | "scorerId" | `metadata.${string}`>, {
|
|
64
|
+
[x: string]: any;
|
|
65
|
+
}, Record<string, any>, "required", string>, {
|
|
95
66
|
by_record_id: ["id", "_creationTime"];
|
|
96
67
|
by_scorer: ["scorerId", "_creationTime"];
|
|
97
68
|
by_entity: ["entityId", "entityType", "_creationTime"];
|
|
98
69
|
by_run: ["runId", "_creationTime"];
|
|
99
70
|
by_created: ["createdAt", "_creationTime"];
|
|
100
71
|
}, {}, {}>;
|
|
72
|
+
/**
|
|
73
|
+
* Vector indexes table - stores metadata about vector indexes
|
|
74
|
+
*/
|
|
101
75
|
export declare const mastraVectorIndexesTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
102
76
|
id: string;
|
|
103
77
|
createdAt: string;
|
|
@@ -114,6 +88,10 @@ export declare const mastraVectorIndexesTable: import("convex/server").TableDefi
|
|
|
114
88
|
by_record_id: ["id", "_creationTime"];
|
|
115
89
|
by_name: ["indexName", "_creationTime"];
|
|
116
90
|
}, {}, {}>;
|
|
91
|
+
/**
|
|
92
|
+
* Vectors table - stores vector embeddings
|
|
93
|
+
* Uses indexName field to support multiple indexes with different dimensions
|
|
94
|
+
*/
|
|
117
95
|
export declare const mastraVectorsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
118
96
|
metadata?: any;
|
|
119
97
|
id: string;
|
|
@@ -128,6 +106,9 @@ export declare const mastraVectorsTable: import("convex/server").TableDefinition
|
|
|
128
106
|
by_index_id: ["indexName", "id", "_creationTime"];
|
|
129
107
|
by_index: ["indexName", "_creationTime"];
|
|
130
108
|
}, {}, {}>;
|
|
109
|
+
/**
|
|
110
|
+
* Generic documents table - fallback for unknown table types
|
|
111
|
+
*/
|
|
131
112
|
export declare const mastraDocumentsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
132
113
|
record: any;
|
|
133
114
|
table: string;
|
|
@@ -140,11 +121,7 @@ export declare const mastraDocumentsTable: import("convex/server").TableDefiniti
|
|
|
140
121
|
by_table: ["table", "_creationTime"];
|
|
141
122
|
by_table_primary: ["table", "primaryKey", "_creationTime"];
|
|
142
123
|
}, {}, {}>;
|
|
143
|
-
export
|
|
144
|
-
export declare const TABLE_MESSAGES = "mastra_messages";
|
|
145
|
-
export declare const TABLE_THREADS = "mastra_threads";
|
|
146
|
-
export declare const TABLE_RESOURCES = "mastra_resources";
|
|
147
|
-
export declare const TABLE_SCORERS = "mastra_scores";
|
|
124
|
+
export { TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, TABLE_THREADS, TABLE_RESOURCES, TABLE_SCORERS };
|
|
148
125
|
export declare const TABLE_VECTOR_INDEXES = "mastra_vector_indexes";
|
|
149
126
|
export declare const TABLE_VECTORS = "mastra_vectors";
|
|
150
127
|
export declare const TABLE_DOCUMENTS = "mastra_documents";
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAEL,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,eAAe,EACf,aAAa,EACd,MAAM,gCAAgC,CAAC;AAoDxC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;UAIM,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;UAIO,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;UAEI,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;UAKJ,CAAC;AAEtC;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;UAKO,CAAC;AAMtC;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;UAQH,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;UAOI,CAAC;AAMpC;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;UAMoB,CAAC;AAMtD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC;AAGlG,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAC5D,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAC9C,eAAO,MAAM,eAAe,qBAAqB,CAAC"}
|
package/dist/schema.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { TABLE_DOCUMENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_VECTORS, TABLE_VECTOR_INDEXES, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from './chunk-
|
|
1
|
+
export { TABLE_DOCUMENTS, TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_VECTORS, TABLE_VECTOR_INDEXES, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from './chunk-HXB4DWFE.js';
|
|
2
2
|
//# sourceMappingURL=schema.js.map
|
|
3
3
|
//# sourceMappingURL=schema.js.map
|
package/dist/server/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkBKVR7SL7_cjs = require('../chunk-BKVR7SL7.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkH5QJE733_cjs = require('../chunk-H5QJE733.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,55 +11,55 @@ Object.defineProperty(exports, "mastraStorage", {
|
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "TABLE_MESSAGES", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkH5QJE733_cjs.TABLE_MESSAGES; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "TABLE_RESOURCES", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkH5QJE733_cjs.TABLE_RESOURCES; }
|
|
19
19
|
});
|
|
20
20
|
Object.defineProperty(exports, "TABLE_SCORERS", {
|
|
21
21
|
enumerable: true,
|
|
22
|
-
get: function () { return
|
|
22
|
+
get: function () { return chunkH5QJE733_cjs.TABLE_SCORERS; }
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "TABLE_THREADS", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkH5QJE733_cjs.TABLE_THREADS; }
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkH5QJE733_cjs.TABLE_WORKFLOW_SNAPSHOT; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "mastraDocumentsTable", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkH5QJE733_cjs.mastraDocumentsTable; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "mastraMessagesTable", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkH5QJE733_cjs.mastraMessagesTable; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "mastraResourcesTable", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkH5QJE733_cjs.mastraResourcesTable; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "mastraScoresTable", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkH5QJE733_cjs.mastraScoresTable; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "mastraThreadsTable", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkH5QJE733_cjs.mastraThreadsTable; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "mastraVectorIndexesTable", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkH5QJE733_cjs.mastraVectorIndexesTable; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "mastraVectorsTable", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkH5QJE733_cjs.mastraVectorsTable; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "mastraWorkflowSnapshotsTable", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkH5QJE733_cjs.mastraWorkflowSnapshotsTable; }
|
|
63
63
|
});
|
|
64
64
|
//# sourceMappingURL=index.cjs.map
|
|
65
65
|
//# sourceMappingURL=index.cjs.map
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { mastraStorage } from '../chunk-KSAPIIEJ.js';
|
|
2
|
-
export { TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from '../chunk-
|
|
2
|
+
export { TABLE_MESSAGES, TABLE_RESOURCES, TABLE_SCORERS, TABLE_THREADS, TABLE_WORKFLOW_SNAPSHOT, mastraDocumentsTable, mastraMessagesTable, mastraResourcesTable, mastraScoresTable, mastraThreadsTable, mastraVectorIndexesTable, mastraVectorsTable, mastraWorkflowSnapshotsTable } from '../chunk-HXB4DWFE.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { MastraBase } from '@mastra/core/base';
|
|
2
|
+
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
3
|
+
import { ConvexAdminClient } from '../client.js';
|
|
4
|
+
import type { EqualityFilter } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration for standalone domain usage.
|
|
7
|
+
* Accepts either:
|
|
8
|
+
* 1. An existing ConvexAdminClient
|
|
9
|
+
* 2. Config to create a new client internally
|
|
10
|
+
*/
|
|
11
|
+
export type ConvexDomainConfig = ConvexDomainClientConfig | ConvexDomainRestConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Pass an existing ConvexAdminClient
|
|
14
|
+
*/
|
|
15
|
+
export interface ConvexDomainClientConfig {
|
|
16
|
+
client: ConvexAdminClient;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pass config to create a new ConvexAdminClient internally
|
|
20
|
+
*/
|
|
21
|
+
export interface ConvexDomainRestConfig {
|
|
22
|
+
deploymentUrl: string;
|
|
23
|
+
adminAuthToken: string;
|
|
24
|
+
storageFunction?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolves ConvexDomainConfig to a ConvexAdminClient.
|
|
28
|
+
* Handles creating a new client if config is provided.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveConvexConfig(config: ConvexDomainConfig): ConvexAdminClient;
|
|
31
|
+
export declare class ConvexDB extends MastraBase {
|
|
32
|
+
private readonly client;
|
|
33
|
+
constructor(client: ConvexAdminClient);
|
|
34
|
+
hasColumn(_table: string, _column: string): Promise<boolean>;
|
|
35
|
+
clearTable({ tableName }: {
|
|
36
|
+
tableName: TABLE_NAMES;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
dropTable({ tableName }: {
|
|
39
|
+
tableName: TABLE_NAMES;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
insert({ tableName, record }: {
|
|
42
|
+
tableName: TABLE_NAMES;
|
|
43
|
+
record: Record<string, any>;
|
|
44
|
+
}): Promise<void>;
|
|
45
|
+
batchInsert({ tableName, records }: {
|
|
46
|
+
tableName: TABLE_NAMES;
|
|
47
|
+
records: Record<string, any>[];
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
load<R>({ tableName, keys }: {
|
|
50
|
+
tableName: TABLE_NAMES;
|
|
51
|
+
keys: Record<string, any>;
|
|
52
|
+
}): Promise<R | null>;
|
|
53
|
+
queryTable<R>(tableName: TABLE_NAMES, filters?: EqualityFilter[]): Promise<R[]>;
|
|
54
|
+
deleteMany(tableName: TABLE_NAMES, ids: string[]): Promise<void>;
|
|
55
|
+
private normalizeRec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,WAAW,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrG,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAU9G,IAAI,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE;QAAE,SAAS,EAAE,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAU/F,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAQ/E,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7E,OAAO,CAAC,eAAe;CAqBxB"}
|
|
@@ -2,10 +2,12 @@ import type { MastraMessageContentV2 } from '@mastra/core/agent';
|
|
|
2
2
|
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
|
|
3
3
|
import { MemoryStorage } from '@mastra/core/storage';
|
|
4
4
|
import type { StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsByResourceIdInput, StorageListThreadsByResourceIdOutput, StorageResourceType } from '@mastra/core/storage';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ConvexDomainConfig } from '../../db/index.js';
|
|
6
6
|
export declare class MemoryConvex extends MemoryStorage {
|
|
7
|
-
private
|
|
8
|
-
constructor(
|
|
7
|
+
#private;
|
|
8
|
+
constructor(config: ConvexDomainConfig);
|
|
9
|
+
init(): Promise<void>;
|
|
10
|
+
dangerouslyClearAll(): Promise<void>;
|
|
9
11
|
getThreadById({ threadId }: {
|
|
10
12
|
threadId: string;
|
|
11
13
|
}): Promise<StorageThreadType | null>;
|
|
@@ -56,4 +58,4 @@ export declare class MemoryConvex extends MemoryStorage {
|
|
|
56
58
|
private parseStoredMessage;
|
|
57
59
|
private addContextMessages;
|
|
58
60
|
}
|
|
59
|
-
//# sourceMappingURL=
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EACL,aAAa,EAQd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,mCAAmC,EACnC,oCAAoC,EACpC,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAYnD,qBAAa,YAAa,SAAQ,aAAa;;gBAEjC,MAAM,EAAE,kBAAkB;IAMhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAMpC,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAkBpF,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,iBAAiB,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAWjF,YAAY,CAAC,EACjB,EAAE,EACF,KAAK,EACL,QAAQ,GACT,EAAE;QACD,EAAE,EAA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AmB,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAiB3F,eAAe,CAAC,EAAE,UAAU,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAiB5F,cAAc,CAAC,EACnB,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE;QACD,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA4BhC,OAAO,CAAC,kBAAkB;YAaZ,kBAAkB;CA0CjC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { SaveScorePayload, ScoreRowData, ScoringEntityType, ScoringSource } from '@mastra/core/evals';
|
|
1
|
+
import type { ListScoresResponse, SaveScorePayload, ScoreRowData, ScoringEntityType, ScoringSource } from '@mastra/core/evals';
|
|
2
2
|
import { ScoresStorage } from '@mastra/core/storage';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { StoragePagination } from '@mastra/core/storage';
|
|
4
|
+
import type { ConvexDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class ScoresConvex extends ScoresStorage {
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
6
|
+
#private;
|
|
7
|
+
constructor(config: ConvexDomainConfig);
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
dangerouslyClearAll(): Promise<void>;
|
|
8
10
|
getScoreById({ id }: {
|
|
9
11
|
id: string;
|
|
10
12
|
}): Promise<ScoreRowData | null>;
|
|
@@ -17,26 +19,17 @@ export declare class ScoresConvex extends ScoresStorage {
|
|
|
17
19
|
entityId?: string;
|
|
18
20
|
entityType?: ScoringEntityType;
|
|
19
21
|
source?: ScoringSource;
|
|
20
|
-
}): Promise<
|
|
21
|
-
pagination: PaginationInfo;
|
|
22
|
-
scores: ScoreRowData[];
|
|
23
|
-
}>;
|
|
22
|
+
}): Promise<ListScoresResponse>;
|
|
24
23
|
listScoresByRunId({ runId, pagination, }: {
|
|
25
24
|
runId: string;
|
|
26
25
|
pagination: StoragePagination;
|
|
27
|
-
}): Promise<
|
|
28
|
-
pagination: PaginationInfo;
|
|
29
|
-
scores: ScoreRowData[];
|
|
30
|
-
}>;
|
|
26
|
+
}): Promise<ListScoresResponse>;
|
|
31
27
|
listScoresByEntityId({ entityId, entityType, pagination, }: {
|
|
32
28
|
entityId: string;
|
|
33
29
|
entityType: ScoringEntityType;
|
|
34
30
|
pagination: StoragePagination;
|
|
35
|
-
}): Promise<
|
|
36
|
-
pagination: PaginationInfo;
|
|
37
|
-
scores: ScoreRowData[];
|
|
38
|
-
}>;
|
|
31
|
+
}): Promise<ListScoresResponse>;
|
|
39
32
|
private listScores;
|
|
40
33
|
private deserialize;
|
|
41
34
|
}
|
|
42
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/scores/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAiB,aAAa,EAAwB,MAAM,sBAAsB,CAAC;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAOnD,qBAAa,YAAa,SAAQ,aAAa;;gBAEjC,MAAM,EAAE,kBAAkB;IAMhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IAQlE,SAAS,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IAiBpE,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,GACP,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,iBAAiB,CAAC;QAC/B,MAAM,CAAC,EAAE,aAAa,CAAC;KACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOzB,iBAAiB,CAAC,EACtB,KAAK,EACL,UAAU,GACX,EAAE;QACD,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAOzB,oBAAoB,CAAC,EACzB,QAAQ,EACR,UAAU,EACV,UAAU,GACX,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,iBAAiB,CAAC;QAC9B,UAAU,EAAE,iBAAiB,CAAC;KAC/B,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAOjB,UAAU;IA4CxB,OAAO,CAAC,WAAW;CAOpB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { WorkflowsStorage } from '@mastra/core/storage';
|
|
2
2
|
import type { StorageListWorkflowRunsInput, WorkflowRun, WorkflowRuns, UpdateWorkflowStateOptions } from '@mastra/core/storage';
|
|
3
3
|
import type { StepResult, WorkflowRunState } from '@mastra/core/workflows';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ConvexDomainConfig } from '../../db/index.js';
|
|
5
5
|
export declare class WorkflowsConvex extends WorkflowsStorage {
|
|
6
|
-
private
|
|
7
|
-
constructor(
|
|
6
|
+
#private;
|
|
7
|
+
constructor(config: ConvexDomainConfig);
|
|
8
|
+
init(): Promise<void>;
|
|
9
|
+
dangerouslyClearAll(): Promise<void>;
|
|
8
10
|
updateWorkflowResults({ workflowName, runId, stepId, result, requestContext, }: {
|
|
9
11
|
workflowName: string;
|
|
10
12
|
runId: string;
|
|
@@ -39,4 +41,4 @@ export declare class WorkflowsConvex extends WorkflowsStorage {
|
|
|
39
41
|
private getRun;
|
|
40
42
|
private ensureSnapshot;
|
|
41
43
|
}
|
|
42
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/domains/workflows/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EACV,4BAA4B,EAE5B,WAAW,EACX,YAAY,EACZ,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAQnD,qBAAa,eAAgB,SAAQ,gBAAgB;;gBAEvC,MAAM,EAAE,kBAAkB;IAMhC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,qBAAqB,CAAC,EAC1B,YAAY,EACZ,KAAK,EACL,MAAM,EACN,MAAM,EACN,cAAc,GACf,EAAE;QACD,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACvC,cAAc,EAAE,MAAM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