@mastra/convex 1.9.0 → 1.9.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.
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +4 -4
- package/dist/index.cjs +25 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +4 -0
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.9.0",
|
|
2
|
+
"version": "1.9.1-alpha.0",
|
|
3
3
|
"package": "@mastra/convex",
|
|
4
4
|
"exports": {
|
|
5
5
|
"ConvexCacheClient": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"ConvexNativeVector": {
|
|
11
11
|
"types": "dist/vector/native.d.ts",
|
|
12
12
|
"implementation": "dist/index.js",
|
|
13
|
-
"line":
|
|
13
|
+
"line": 2884
|
|
14
14
|
},
|
|
15
15
|
"ConvexServerCache": {
|
|
16
16
|
"types": "dist/cache/index.d.ts",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"ConvexStore": {
|
|
21
21
|
"types": "dist/storage/index.d.ts",
|
|
22
22
|
"implementation": "dist/index.js",
|
|
23
|
-
"line":
|
|
23
|
+
"line": 2581
|
|
24
24
|
},
|
|
25
25
|
"ConvexVector": {
|
|
26
26
|
"types": "dist/vector/index.d.ts",
|
|
27
27
|
"implementation": "dist/index.js",
|
|
28
|
-
"line":
|
|
28
|
+
"line": 2605
|
|
29
29
|
},
|
|
30
30
|
"TABLE_OBSERVATIONAL_MEMORY": {
|
|
31
31
|
"types": "dist/schema.d.ts",
|
package/dist/index.cjs
CHANGED
|
@@ -2339,6 +2339,25 @@ var ScoresConvex = class extends _mastra_core_storage.ScoresStorage {
|
|
|
2339
2339
|
}
|
|
2340
2340
|
};
|
|
2341
2341
|
// src/storage/domains/workflows/index.ts
|
|
2342
|
+
/**
|
|
2343
|
+
* A stored snapshot reduced to what `listWorkflowRuns({ summary: true })` returns: `status` and
|
|
2344
|
+
* `timestamp` when set, and `parentWorkflow` only when both of its IDs are non-empty strings.
|
|
2345
|
+
* A missing snapshot reduces to `{}`. Reads the stored value in place, without a full copy.
|
|
2346
|
+
*/
|
|
2347
|
+
function summarySnapshot(stored) {
|
|
2348
|
+
const parsed = typeof stored === "string" ? JSON.parse(stored) : stored;
|
|
2349
|
+
const { status, timestamp, parentWorkflow } = parsed !== null && typeof parsed === "object" ? parsed : {};
|
|
2350
|
+
const summary = {};
|
|
2351
|
+
if (status !== void 0 && status !== null) summary.status = status;
|
|
2352
|
+
if (timestamp !== void 0 && timestamp !== null) summary.timestamp = timestamp;
|
|
2353
|
+
const workflowId = parentWorkflow?.workflowId;
|
|
2354
|
+
const runId = parentWorkflow?.runId;
|
|
2355
|
+
if (typeof workflowId === "string" && workflowId !== "" && typeof runId === "string" && runId !== "") summary.parentWorkflow = {
|
|
2356
|
+
workflowId,
|
|
2357
|
+
runId
|
|
2358
|
+
};
|
|
2359
|
+
return summary;
|
|
2360
|
+
}
|
|
2342
2361
|
var WorkflowsConvex = class WorkflowsConvex extends _mastra_core_storage.WorkflowsStorage {
|
|
2343
2362
|
/**
|
|
2344
2363
|
* Tables `prune()` can clean up. Run ownership records anchor on `updatedAt` (epoch ms), which every
|
|
@@ -2443,8 +2462,12 @@ var WorkflowsConvex = class WorkflowsConvex extends _mastra_core_storage.Workflo
|
|
|
2443
2462
|
if (!row) return null;
|
|
2444
2463
|
return typeof row.snapshot === "string" ? JSON.parse(row.snapshot) : JSON.parse(JSON.stringify(row.snapshot));
|
|
2445
2464
|
}
|
|
2465
|
+
/**
|
|
2466
|
+
* Lists runs newest first. With `summary`, each snapshot keeps only its status, timestamp and
|
|
2467
|
+
* parent run; the full rows are still read from Convex.
|
|
2468
|
+
*/
|
|
2446
2469
|
async listWorkflowRuns(args = {}) {
|
|
2447
|
-
const { workflowName, fromDate, toDate, perPage, page, resourceId, status } = args;
|
|
2470
|
+
const { workflowName, fromDate, toDate, perPage, page, resourceId, status, summary } = args;
|
|
2448
2471
|
const filters = [];
|
|
2449
2472
|
if (workflowName) filters.push({
|
|
2450
2473
|
field: "workflow_name",
|
|
@@ -2471,7 +2494,7 @@ var WorkflowsConvex = class WorkflowsConvex extends _mastra_core_storage.Workflo
|
|
|
2471
2494
|
runs: rows.map((run) => ({
|
|
2472
2495
|
workflowName: run.workflow_name,
|
|
2473
2496
|
runId: run.run_id,
|
|
2474
|
-
snapshot: this.ensureSnapshot(run),
|
|
2497
|
+
snapshot: summary ? summarySnapshot(run.snapshot) : this.ensureSnapshot(run),
|
|
2475
2498
|
createdAt: new Date(run.createdAt),
|
|
2476
2499
|
updatedAt: new Date(run.updatedAt),
|
|
2477
2500
|
resourceId: run.resourceId
|