@mastra/convex 0.0.0-remove-ai-peer-dep-from-evals-20260105220639 → 0.0.0-salesman-20260127182805

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,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-beta.7",
2
+ "version": "1.0.0",
3
3
  "package": "@mastra/convex",
4
4
  "exports": {
5
5
  "mastraStorage": {
@@ -8,55 +8,55 @@
8
8
  },
9
9
  "TABLE_MESSAGES": {
10
10
  "types": "dist/index.d.ts",
11
- "implementation": "dist/chunk-HXB4DWFE.js"
11
+ "implementation": "dist/chunk-G5FLGAPE.js"
12
12
  },
13
13
  "TABLE_RESOURCES": {
14
14
  "types": "dist/index.d.ts",
15
- "implementation": "dist/chunk-HXB4DWFE.js"
15
+ "implementation": "dist/chunk-G5FLGAPE.js"
16
16
  },
17
17
  "TABLE_SCORERS": {
18
18
  "types": "dist/index.d.ts",
19
- "implementation": "dist/chunk-HXB4DWFE.js"
19
+ "implementation": "dist/chunk-G5FLGAPE.js"
20
20
  },
21
21
  "TABLE_THREADS": {
22
22
  "types": "dist/index.d.ts",
23
- "implementation": "dist/chunk-HXB4DWFE.js"
23
+ "implementation": "dist/chunk-G5FLGAPE.js"
24
24
  },
25
25
  "TABLE_WORKFLOW_SNAPSHOT": {
26
26
  "types": "dist/index.d.ts",
27
- "implementation": "dist/chunk-HXB4DWFE.js"
27
+ "implementation": "dist/chunk-G5FLGAPE.js"
28
28
  },
29
29
  "mastraDocumentsTable": {
30
30
  "types": "dist/index.d.ts",
31
- "implementation": "dist/chunk-HXB4DWFE.js"
31
+ "implementation": "dist/chunk-G5FLGAPE.js"
32
32
  },
33
33
  "mastraMessagesTable": {
34
34
  "types": "dist/index.d.ts",
35
- "implementation": "dist/chunk-HXB4DWFE.js"
35
+ "implementation": "dist/chunk-G5FLGAPE.js"
36
36
  },
37
37
  "mastraResourcesTable": {
38
38
  "types": "dist/index.d.ts",
39
- "implementation": "dist/chunk-HXB4DWFE.js"
39
+ "implementation": "dist/chunk-G5FLGAPE.js"
40
40
  },
41
41
  "mastraScoresTable": {
42
42
  "types": "dist/index.d.ts",
43
- "implementation": "dist/chunk-HXB4DWFE.js"
43
+ "implementation": "dist/chunk-G5FLGAPE.js"
44
44
  },
45
45
  "mastraThreadsTable": {
46
46
  "types": "dist/index.d.ts",
47
- "implementation": "dist/chunk-HXB4DWFE.js"
47
+ "implementation": "dist/chunk-G5FLGAPE.js"
48
48
  },
49
49
  "mastraVectorIndexesTable": {
50
50
  "types": "dist/index.d.ts",
51
- "implementation": "dist/chunk-HXB4DWFE.js"
51
+ "implementation": "dist/chunk-G5FLGAPE.js"
52
52
  },
53
53
  "mastraVectorsTable": {
54
54
  "types": "dist/index.d.ts",
55
- "implementation": "dist/chunk-HXB4DWFE.js"
55
+ "implementation": "dist/chunk-G5FLGAPE.js"
56
56
  },
57
57
  "mastraWorkflowSnapshotsTable": {
58
58
  "types": "dist/index.d.ts",
59
- "implementation": "dist/chunk-HXB4DWFE.js"
59
+ "implementation": "dist/chunk-G5FLGAPE.js"
60
60
  }
61
61
  },
62
62
  "modules": {}
@@ -11,10 +11,13 @@
11
11
 
12
12
  The Convex storage implementation provides a serverless storage solution using [Convex](https://convex.dev), a full-stack TypeScript development platform with real-time sync and automatic caching.
13
13
 
14
+ > **Observability Not Supported**
15
+ Convex storage **does not support the observability domain**. Traces from the `DefaultExporter` cannot be persisted to Convex, and Mastra Studio's observability features won't work with Convex as your only storage provider. To enable observability, use [composite storage](https://mastra.ai/reference/storage/composite#specialized-storage-for-observability-recommended-for-production) to route observability data to a supported provider like ClickHouse or PostgreSQL.
16
+
14
17
  ## Installation
15
18
 
16
- ```bash
17
- npm install @mastra/convex@beta
19
+ ```bash npm2yarn
20
+ npm install @mastra/convex@latest
18
21
  ```
19
22
 
20
23
  ## Convex Setup
@@ -13,8 +13,8 @@ The ConvexVector class provides vector storage and similarity search using [Conv
13
13
 
14
14
  ## Installation
15
15
 
16
- ```bash
17
- npm install @mastra/convex@beta
16
+ ```bash npm2yarn
17
+ npm install @mastra/convex@latest
18
18
  ```
19
19
 
20
20
  ## Convex Setup
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkBKVR7SL7_cjs = require('./chunk-BKVR7SL7.cjs');
4
- var chunkH5QJE733_cjs = require('./chunk-H5QJE733.cjs');
4
+ var chunkFTVDAP6U_cjs = require('./chunk-FTVDAP6U.cjs');
5
5
  var storage = require('@mastra/core/storage');
6
6
  var agent = require('@mastra/core/agent');
7
7
  var error = require('@mastra/core/error');
@@ -90,6 +90,19 @@ var ConvexDB = class extends base.MastraBase {
90
90
  async hasColumn(_table, _column) {
91
91
  return true;
92
92
  }
93
+ async createTable({
94
+ tableName,
95
+ schema: _schema
96
+ }) {
97
+ this.logger.debug(`ConvexDB: createTable called for ${tableName} (schema managed server-side)`);
98
+ }
99
+ async alterTable({
100
+ tableName,
101
+ schema: _schema,
102
+ ifNotExists: _ifNotExists
103
+ }) {
104
+ this.logger.debug(`ConvexDB: alterTable called for ${tableName} (schema managed server-side)`);
105
+ }
93
106
  async clearTable({ tableName }) {
94
107
  let hasMore = true;
95
108
  while (hasMore) {
@@ -241,18 +254,41 @@ var MemoryConvex = class extends storage.MemoryStorage {
241
254
  );
242
255
  await this.#db.deleteMany(storage.TABLE_THREADS, [threadId]);
243
256
  }
244
- async listThreadsByResourceId(args) {
245
- const { resourceId, page = 0, perPage: perPageInput, orderBy } = args;
257
+ async listThreads(args) {
258
+ const { page = 0, perPage: perPageInput, orderBy, filter } = args;
259
+ try {
260
+ this.validatePaginationInput(page, perPageInput ?? 100);
261
+ } catch (error$1) {
262
+ throw new error.MastraError(
263
+ {
264
+ id: storage.createStorageErrorId("CONVEX", "LIST_THREADS", "INVALID_PAGE"),
265
+ domain: error.ErrorDomain.STORAGE,
266
+ category: error.ErrorCategory.USER,
267
+ details: { page, ...perPageInput !== void 0 && { perPage: perPageInput } }
268
+ },
269
+ error$1 instanceof Error ? error$1 : new Error("Invalid pagination parameters")
270
+ );
271
+ }
246
272
  const perPage = storage.normalizePerPage(perPageInput, 100);
247
273
  const { field, direction } = this.parseOrderBy(orderBy);
248
274
  const { offset, perPage: perPageForResponse } = storage.calculatePagination(page, perPageInput, perPage);
249
- const rows = await this.#db.queryTable(storage.TABLE_THREADS, [{ field: "resourceId", value: resourceId }]);
250
- const threads = rows.map((row) => ({
275
+ const queryFilters = [];
276
+ if (filter?.resourceId) {
277
+ queryFilters.push({ field: "resourceId", value: filter.resourceId });
278
+ }
279
+ const rows = await this.#db.queryTable(storage.TABLE_THREADS, queryFilters);
280
+ let threads = rows.map((row) => ({
251
281
  ...row,
252
282
  metadata: typeof row.metadata === "string" ? JSON.parse(row.metadata) : row.metadata,
253
283
  createdAt: new Date(row.createdAt),
254
284
  updatedAt: new Date(row.updatedAt)
255
285
  }));
286
+ if (filter?.metadata && Object.keys(filter.metadata).length > 0) {
287
+ threads = threads.filter((thread) => {
288
+ if (!thread.metadata) return false;
289
+ return Object.entries(filter.metadata).every(([key, value]) => thread.metadata[key] === value);
290
+ });
291
+ }
256
292
  threads.sort((a, b) => {
257
293
  const aValue = a[field];
258
294
  const bValue = b[field];
@@ -854,8 +890,7 @@ var WorkflowsConvex = class extends storage.WorkflowsStorage {
854
890
  var isClientConfig = (config) => {
855
891
  return "client" in config;
856
892
  };
857
- var ConvexStore = class extends storage.MastraStorage {
858
- stores = {};
893
+ var ConvexStore = class extends storage.MastraCompositeStore {
859
894
  constructor(config) {
860
895
  super({ id: config.id, name: config.name ?? "ConvexStore", disableInit: config.disableInit });
861
896
  const client = isClientConfig(config) ? config.client : new ConvexAdminClient(config);
@@ -1179,55 +1214,55 @@ Object.defineProperty(exports, "mastraStorage", {
1179
1214
  });
1180
1215
  Object.defineProperty(exports, "TABLE_MESSAGES", {
1181
1216
  enumerable: true,
1182
- get: function () { return chunkH5QJE733_cjs.TABLE_MESSAGES; }
1217
+ get: function () { return chunkFTVDAP6U_cjs.TABLE_MESSAGES; }
1183
1218
  });
1184
1219
  Object.defineProperty(exports, "TABLE_RESOURCES", {
1185
1220
  enumerable: true,
1186
- get: function () { return chunkH5QJE733_cjs.TABLE_RESOURCES; }
1221
+ get: function () { return chunkFTVDAP6U_cjs.TABLE_RESOURCES; }
1187
1222
  });
1188
1223
  Object.defineProperty(exports, "TABLE_SCORERS", {
1189
1224
  enumerable: true,
1190
- get: function () { return chunkH5QJE733_cjs.TABLE_SCORERS; }
1225
+ get: function () { return chunkFTVDAP6U_cjs.TABLE_SCORERS; }
1191
1226
  });
1192
1227
  Object.defineProperty(exports, "TABLE_THREADS", {
1193
1228
  enumerable: true,
1194
- get: function () { return chunkH5QJE733_cjs.TABLE_THREADS; }
1229
+ get: function () { return chunkFTVDAP6U_cjs.TABLE_THREADS; }
1195
1230
  });
1196
1231
  Object.defineProperty(exports, "TABLE_WORKFLOW_SNAPSHOT", {
1197
1232
  enumerable: true,
1198
- get: function () { return chunkH5QJE733_cjs.TABLE_WORKFLOW_SNAPSHOT; }
1233
+ get: function () { return chunkFTVDAP6U_cjs.TABLE_WORKFLOW_SNAPSHOT; }
1199
1234
  });
1200
1235
  Object.defineProperty(exports, "mastraDocumentsTable", {
1201
1236
  enumerable: true,
1202
- get: function () { return chunkH5QJE733_cjs.mastraDocumentsTable; }
1237
+ get: function () { return chunkFTVDAP6U_cjs.mastraDocumentsTable; }
1203
1238
  });
1204
1239
  Object.defineProperty(exports, "mastraMessagesTable", {
1205
1240
  enumerable: true,
1206
- get: function () { return chunkH5QJE733_cjs.mastraMessagesTable; }
1241
+ get: function () { return chunkFTVDAP6U_cjs.mastraMessagesTable; }
1207
1242
  });
1208
1243
  Object.defineProperty(exports, "mastraResourcesTable", {
1209
1244
  enumerable: true,
1210
- get: function () { return chunkH5QJE733_cjs.mastraResourcesTable; }
1245
+ get: function () { return chunkFTVDAP6U_cjs.mastraResourcesTable; }
1211
1246
  });
1212
1247
  Object.defineProperty(exports, "mastraScoresTable", {
1213
1248
  enumerable: true,
1214
- get: function () { return chunkH5QJE733_cjs.mastraScoresTable; }
1249
+ get: function () { return chunkFTVDAP6U_cjs.mastraScoresTable; }
1215
1250
  });
1216
1251
  Object.defineProperty(exports, "mastraThreadsTable", {
1217
1252
  enumerable: true,
1218
- get: function () { return chunkH5QJE733_cjs.mastraThreadsTable; }
1253
+ get: function () { return chunkFTVDAP6U_cjs.mastraThreadsTable; }
1219
1254
  });
1220
1255
  Object.defineProperty(exports, "mastraVectorIndexesTable", {
1221
1256
  enumerable: true,
1222
- get: function () { return chunkH5QJE733_cjs.mastraVectorIndexesTable; }
1257
+ get: function () { return chunkFTVDAP6U_cjs.mastraVectorIndexesTable; }
1223
1258
  });
1224
1259
  Object.defineProperty(exports, "mastraVectorsTable", {
1225
1260
  enumerable: true,
1226
- get: function () { return chunkH5QJE733_cjs.mastraVectorsTable; }
1261
+ get: function () { return chunkFTVDAP6U_cjs.mastraVectorsTable; }
1227
1262
  });
1228
1263
  Object.defineProperty(exports, "mastraWorkflowSnapshotsTable", {
1229
1264
  enumerable: true,
1230
- get: function () { return chunkH5QJE733_cjs.mastraWorkflowSnapshotsTable; }
1265
+ get: function () { return chunkFTVDAP6U_cjs.mastraWorkflowSnapshotsTable; }
1231
1266
  });
1232
1267
  exports.ConvexStore = ConvexStore;
1233
1268
  exports.ConvexVector = ConvexVector;