opencode-supertask 0.1.21 → 0.1.23
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/README.md +30 -5
- package/dist/cli/index.js +617 -134
- package/dist/cli/index.js.map +1 -1
- package/dist/gateway/index.d.ts +3 -1
- package/dist/gateway/index.js +480 -101
- package/dist/gateway/index.js.map +1 -1
- package/dist/plugin/supertask.js +19 -2
- package/dist/plugin/supertask.js.map +1 -1
- package/dist/web/index.js +400 -36
- package/dist/web/index.js.map +1 -1
- package/dist/worker/index.js +17 -0
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
package/dist/worker/index.js
CHANGED
|
@@ -5504,6 +5504,23 @@ var TaskService = class {
|
|
|
5504
5504
|
).returning();
|
|
5505
5505
|
return result.length;
|
|
5506
5506
|
}
|
|
5507
|
+
static async resetOrphanRunningToPending() {
|
|
5508
|
+
const result = await db.update(tasks2).set({
|
|
5509
|
+
status: "pending",
|
|
5510
|
+
startedAt: null,
|
|
5511
|
+
finishedAt: null
|
|
5512
|
+
}).where(
|
|
5513
|
+
and(
|
|
5514
|
+
eq(tasks2.status, "running"),
|
|
5515
|
+
sql`NOT EXISTS (
|
|
5516
|
+
SELECT 1 FROM ${taskRuns2}
|
|
5517
|
+
WHERE ${taskRuns2.taskId} = ${tasks2.id}
|
|
5518
|
+
AND ${taskRuns2.status} = 'running'
|
|
5519
|
+
)`
|
|
5520
|
+
)
|
|
5521
|
+
).returning();
|
|
5522
|
+
return result.length;
|
|
5523
|
+
}
|
|
5507
5524
|
static async cancel(id, scope = {}) {
|
|
5508
5525
|
const conditions = [
|
|
5509
5526
|
eq(tasks2.id, id),
|