@jl1990/pi-scheduler 0.2.1 → 0.2.2
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.
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { realpathSync } = require("node:fs");
|
|
2
|
+
const { createRequire } = require("node:module");
|
|
3
|
+
|
|
4
|
+
function loadCroner() {
|
|
5
|
+
try {
|
|
6
|
+
return require("croner");
|
|
7
|
+
} catch (error) {
|
|
8
|
+
if (error?.code !== "MODULE_NOT_FOUND" || !String(error?.message ?? "").includes("'croner'")) {
|
|
9
|
+
throw error;
|
|
10
|
+
}
|
|
11
|
+
// Pi's extension loader can preserve the npm/pnpm package symlink path. In that
|
|
12
|
+
// mode Node does not walk up into pnpm's real virtual-store node_modules, so
|
|
13
|
+
// resolve from this file's real path as a fallback.
|
|
14
|
+
return createRequire(realpathSync(__filename))("croner");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { Cron } = loadCroner();
|
|
2
19
|
|
|
3
20
|
const VALID_ACTIONS = new Set(["notify", "prompt", "shell", "message"]);
|
|
4
21
|
const VALID_TYPES = new Set(["once", "interval", "cron"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jl1990/pi-scheduler",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Give Pi coding agents a clock: schedule reminders, shell commands, and self-waking prompts for CI polling and autonomous follow-ups.",
|
|
5
5
|
"author": "jl1990",
|
|
6
6
|
"license": "MIT",
|