@mastra/convex 1.0.10 → 1.0.11-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/CHANGELOG.md +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -187,8 +187,10 @@ function toStored(task) {
|
|
|
187
187
|
args: serializeJson(task.args),
|
|
188
188
|
result: serializeJson(task.result),
|
|
189
189
|
error: serializeJson(task.error),
|
|
190
|
+
suspendPayload: serializeJson(task.suspendPayload),
|
|
190
191
|
createdAt: task.createdAt.toISOString(),
|
|
191
192
|
startedAt: task.startedAt?.toISOString(),
|
|
193
|
+
suspendedAt: task.suspendedAt?.toISOString(),
|
|
192
194
|
completedAt: task.completedAt?.toISOString()
|
|
193
195
|
};
|
|
194
196
|
}
|
|
@@ -213,11 +215,13 @@ function fromStored(stored) {
|
|
|
213
215
|
runId: stored.runId,
|
|
214
216
|
result: parseJson(stored.result),
|
|
215
217
|
error: parseJson(stored.error),
|
|
218
|
+
suspendPayload: parseJson(stored.suspendPayload),
|
|
216
219
|
retryCount: stored.retryCount,
|
|
217
220
|
maxRetries: stored.maxRetries,
|
|
218
221
|
timeoutMs: stored.timeoutMs,
|
|
219
222
|
createdAt: new Date(stored.createdAt),
|
|
220
223
|
startedAt: stored.startedAt ? new Date(stored.startedAt) : void 0,
|
|
224
|
+
suspendedAt: stored.suspendedAt ? new Date(stored.suspendedAt) : void 0,
|
|
221
225
|
completedAt: stored.completedAt ? new Date(stored.completedAt) : void 0
|
|
222
226
|
};
|
|
223
227
|
}
|
|
@@ -241,8 +245,10 @@ var BackgroundTasksConvex = class extends BackgroundTasksStorage {
|
|
|
241
245
|
if ("status" in update) merged.status = update.status;
|
|
242
246
|
if ("result" in update) merged.result = update.result;
|
|
243
247
|
if ("error" in update) merged.error = update.error;
|
|
248
|
+
if ("suspendPayload" in update) merged.suspendPayload = update.suspendPayload;
|
|
244
249
|
if ("retryCount" in update) merged.retryCount = update.retryCount;
|
|
245
250
|
if ("startedAt" in update) merged.startedAt = update.startedAt;
|
|
251
|
+
if ("suspendedAt" in update) merged.suspendedAt = update.suspendedAt;
|
|
246
252
|
if ("completedAt" in update) merged.completedAt = update.completedAt;
|
|
247
253
|
await this.#db.deleteMany(TABLE_BACKGROUND_TASKS, [taskId]);
|
|
248
254
|
await this.#db.insert({ tableName: TABLE_BACKGROUND_TASKS, record: toStored(merged) });
|
|
@@ -261,6 +267,7 @@ var BackgroundTasksConvex = class extends BackgroundTasksStorage {
|
|
|
261
267
|
if (filter.agentId) tasks = tasks.filter((t) => t.agentId === filter.agentId);
|
|
262
268
|
if (filter.threadId) tasks = tasks.filter((t) => t.threadId === filter.threadId);
|
|
263
269
|
if (filter.toolName) tasks = tasks.filter((t) => t.toolName === filter.toolName);
|
|
270
|
+
if (filter.toolCallId) tasks = tasks.filter((t) => t.toolCallId === filter.toolCallId);
|
|
264
271
|
if (filter.runId) tasks = tasks.filter((t) => t.runId === filter.runId);
|
|
265
272
|
const dateCol = filter.dateFilterBy ?? "createdAt";
|
|
266
273
|
if (filter.fromDate) {
|