opencode-supertask 0.1.21 → 0.1.22

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.
@@ -27121,6 +27121,23 @@ var TaskService = class {
27121
27121
  ).returning();
27122
27122
  return result.length;
27123
27123
  }
27124
+ static async resetOrphanRunningToPending() {
27125
+ const result = await db.update(tasks2).set({
27126
+ status: "pending",
27127
+ startedAt: null,
27128
+ finishedAt: null
27129
+ }).where(
27130
+ and(
27131
+ eq(tasks2.status, "running"),
27132
+ sql`NOT EXISTS (
27133
+ SELECT 1 FROM ${taskRuns2}
27134
+ WHERE ${taskRuns2.taskId} = ${tasks2.id}
27135
+ AND ${taskRuns2.status} = 'running'
27136
+ )`
27137
+ )
27138
+ ).returning();
27139
+ return result.length;
27140
+ }
27124
27141
  static async cancel(id, scope = {}) {
27125
27142
  const conditions = [
27126
27143
  eq(tasks2.id, id),
@@ -27391,9 +27408,9 @@ function parseDuration(input) {
27391
27408
 
27392
27409
  // src/daemon/pm2.ts
27393
27410
  import { execSync, spawnSync } from "child_process";
27394
- import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
27411
+ import { chmodSync, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
27395
27412
  import { homedir as homedir3 } from "os";
27396
- import { dirname as dirname2, join as join3 } from "path";
27413
+ import { dirname as dirname2, isAbsolute, join as join3 } from "path";
27397
27414
  import { fileURLToPath as fileURLToPath2 } from "url";
27398
27415
  import { Database as Database3 } from "bun:sqlite";
27399
27416