@staticduo/opencode-scheduler 1.3.2 → 1.3.3

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12520,7 +12520,19 @@ function queryTimerState(run, timerUnit, query) {
12520
12520
  } catch (error45) {
12521
12521
  output = commandOutput(error45);
12522
12522
  }
12523
- return query === "is-enabled" ? ["enabled", "enabled-runtime", "linked", "linked-runtime", "alias"].includes(output) : ["active", "activating", "reloading"].includes(output);
12523
+ const enabledStates = ["enabled", "enabled-runtime", "linked", "linked-runtime", "alias"];
12524
+ const disabledStates = ["disabled", "static", "indirect", "masked", "masked-runtime", "not-found"];
12525
+ const activeStates = ["active", "activating", "reloading"];
12526
+ const inactiveStates = ["inactive", "failed", "deactivating", "unknown"];
12527
+ if (query === "is-enabled" && enabledStates.includes(output))
12528
+ return true;
12529
+ if (query === "is-enabled" && disabledStates.includes(output))
12530
+ return false;
12531
+ if (query === "is-active" && activeStates.includes(output))
12532
+ return true;
12533
+ if (query === "is-active" && inactiveStates.includes(output))
12534
+ return false;
12535
+ throw new Error(`Unable to determine whether ${timerUnit} ${query}: ${output || "no status returned"}`);
12524
12536
  }
12525
12537
  function restoreFile(snapshot, fileSystem) {
12526
12538
  if (!snapshot.existed) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@staticduo/opencode-scheduler",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "OpenCode plugin for scheduling recurring jobs using launchd, systemd, Task Scheduler, or cron fallback",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",