@mastra/lance 1.0.5-alpha.0 → 1.0.6-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 +18 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -605,11 +605,13 @@ function toRecord(task) {
|
|
|
605
605
|
args: serializeJson(task.args),
|
|
606
606
|
result: serializeJson(task.result),
|
|
607
607
|
error: serializeJson(task.error),
|
|
608
|
+
suspend_payload: serializeJson(task.suspendPayload),
|
|
608
609
|
retry_count: task.retryCount,
|
|
609
610
|
max_retries: task.maxRetries,
|
|
610
611
|
timeout_ms: task.timeoutMs,
|
|
611
612
|
createdAt: task.createdAt,
|
|
612
613
|
startedAt: task.startedAt ?? /* @__PURE__ */ new Date(0),
|
|
614
|
+
suspendedAt: task.suspendedAt ?? /* @__PURE__ */ new Date(0),
|
|
613
615
|
completedAt: task.completedAt ?? /* @__PURE__ */ new Date(0)
|
|
614
616
|
};
|
|
615
617
|
}
|
|
@@ -626,6 +628,7 @@ function fromRecord(row) {
|
|
|
626
628
|
return val;
|
|
627
629
|
};
|
|
628
630
|
const startedAt = row.startedAt instanceof Date ? row.startedAt : row.startedAt ? new Date(row.startedAt) : void 0;
|
|
631
|
+
const suspendedAt = row.suspendedAt instanceof Date ? row.suspendedAt : row.suspendedAt ? new Date(row.suspendedAt) : void 0;
|
|
629
632
|
const completedAt = row.completedAt instanceof Date ? row.completedAt : row.completedAt ? new Date(row.completedAt) : void 0;
|
|
630
633
|
return {
|
|
631
634
|
id: String(row.id),
|
|
@@ -639,11 +642,13 @@ function fromRecord(row) {
|
|
|
639
642
|
runId: row.run_id ?? "",
|
|
640
643
|
result: parseJson(row.result),
|
|
641
644
|
error: parseJson(row.error),
|
|
645
|
+
suspendPayload: parseJson(row.suspend_payload),
|
|
642
646
|
retryCount: Number(row.retry_count ?? 0),
|
|
643
647
|
maxRetries: Number(row.max_retries ?? 0),
|
|
644
648
|
timeoutMs: Number(row.timeout_ms ?? 3e5),
|
|
645
649
|
createdAt: row.createdAt instanceof Date ? row.createdAt : new Date(row.createdAt),
|
|
646
650
|
startedAt: startedAt && startedAt.getTime() > 0 ? startedAt : void 0,
|
|
651
|
+
suspendedAt: suspendedAt && suspendedAt.getTime() > 0 ? suspendedAt : void 0,
|
|
647
652
|
completedAt: completedAt && completedAt.getTime() > 0 ? completedAt : void 0
|
|
648
653
|
};
|
|
649
654
|
}
|
|
@@ -664,6 +669,11 @@ var StoreBackgroundTasksLance = class extends BackgroundTasksStorage {
|
|
|
664
669
|
tableName: TABLE_BACKGROUND_TASKS,
|
|
665
670
|
schema: TABLE_SCHEMAS[TABLE_BACKGROUND_TASKS]
|
|
666
671
|
});
|
|
672
|
+
await this.#db.alterTable({
|
|
673
|
+
tableName: TABLE_BACKGROUND_TASKS,
|
|
674
|
+
schema: TABLE_SCHEMAS[TABLE_BACKGROUND_TASKS],
|
|
675
|
+
ifNotExists: ["suspend_payload", "suspendedAt"]
|
|
676
|
+
});
|
|
667
677
|
}
|
|
668
678
|
async dangerouslyClearAll() {
|
|
669
679
|
await this.#db.clearTable({ tableName: TABLE_BACKGROUND_TASKS });
|
|
@@ -679,8 +689,10 @@ var StoreBackgroundTasksLance = class extends BackgroundTasksStorage {
|
|
|
679
689
|
if ("status" in update) merged.status = update.status;
|
|
680
690
|
if ("result" in update) merged.result = update.result;
|
|
681
691
|
if ("error" in update) merged.error = update.error;
|
|
692
|
+
if ("suspendPayload" in update) merged.suspendPayload = update.suspendPayload;
|
|
682
693
|
if ("retryCount" in update) merged.retryCount = update.retryCount;
|
|
683
694
|
if ("startedAt" in update) merged.startedAt = update.startedAt;
|
|
695
|
+
if ("suspendedAt" in update) merged.suspendedAt = update.suspendedAt;
|
|
684
696
|
if ("completedAt" in update) merged.completedAt = update.completedAt;
|
|
685
697
|
const table = await this.client.openTable(TABLE_BACKGROUND_TASKS);
|
|
686
698
|
await table.delete(`id = '${escapeStr(taskId)}'`);
|
|
@@ -710,6 +722,7 @@ var StoreBackgroundTasksLance = class extends BackgroundTasksStorage {
|
|
|
710
722
|
if (filter.resourceId) conditions.push(`resource_id = '${escapeStr(filter.resourceId)}'`);
|
|
711
723
|
if (filter.runId) conditions.push(`run_id = '${escapeStr(filter.runId)}'`);
|
|
712
724
|
if (filter.toolName) conditions.push(`tool_name = '${escapeStr(filter.toolName)}'`);
|
|
725
|
+
if (filter.toolCallId) conditions.push(`tool_call_id = '${escapeStr(filter.toolCallId)}'`);
|
|
713
726
|
let query = table.query();
|
|
714
727
|
if (conditions.length > 0) {
|
|
715
728
|
query = query.where(conditions.join(" AND "));
|