@jl1990/pi-scheduler 0.2.0 → 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.
package/README.md CHANGED
@@ -205,9 +205,7 @@ Prompt priority:
205
205
  2. `failurePrompt` on failure
206
206
  3. `followUpPrompt` fallback
207
207
 
208
- ## How this differs from `pi-schedule-prompt`
209
-
210
- [`pi-schedule-prompt`](https://github.com/tintinweb/pi-schedule-prompt) is a mature prompt scheduler with a richer prompt-focused UI and optional per-task model/subagent mode.
208
+ ## Design focus
211
209
 
212
210
  Pi Scheduler focuses on **scheduled actions**:
213
211
 
@@ -217,7 +215,7 @@ Pi Scheduler focuses on **scheduled actions**:
217
215
  - bounded command polling with `maxRuns`
218
216
  - prompt/notify/message actions as lightweight companions
219
217
 
220
- If you mainly want recurring prompts and a full jobs overlay, `pi-schedule-prompt` may be the better fit. If you want delayed or recurring command execution with result-aware follow-up, use Pi Scheduler.
218
+ The goal is to make command-driven automation simple: schedule the check, capture the result, and wake the agent only when useful.
221
219
 
222
220
  ## Important limitations
223
221
 
@@ -1,4 +1,21 @@
1
- const { Cron } = require("croner");
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.0",
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",