@wahooks/channel 2.1.0 → 2.1.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/dist/daemon.js +2 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/dist/daemon.js
CHANGED
|
@@ -109,7 +109,8 @@ function checkReminders(parseExpression) {
|
|
|
109
109
|
}
|
|
110
110
|
async function main() {
|
|
111
111
|
fs.mkdirSync(WAHOOKS_DIR, { recursive: true });
|
|
112
|
-
const
|
|
112
|
+
const cronParser = await import("cron-parser");
|
|
113
|
+
const parseExpression = cronParser.default?.parseExpression ?? cronParser.parseExpression;
|
|
113
114
|
console.log(`[reminders] Daemon started — checking every ${CHECK_INTERVAL / 1000}s`);
|
|
114
115
|
checkReminders(parseExpression);
|
|
115
116
|
setInterval(() => checkReminders(parseExpression), CHECK_INTERVAL);
|
package/dist/index.js
CHANGED
|
@@ -533,11 +533,13 @@ mcp.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
533
533
|
}
|
|
534
534
|
case "wahooks_schedule_reminder": {
|
|
535
535
|
const id = `rem_${Date.now().toString(36)}`;
|
|
536
|
-
const
|
|
536
|
+
const rawOneTime = args.one_time;
|
|
537
|
+
const oneTime = rawOneTime === true || rawOneTime === "true";
|
|
537
538
|
// Calculate next run
|
|
538
539
|
let nextRunAt;
|
|
539
540
|
try {
|
|
540
|
-
const
|
|
541
|
+
const cronParser = await import("cron-parser");
|
|
542
|
+
const parseExpression = cronParser.default?.parseExpression ?? cronParser.parseExpression;
|
|
541
543
|
const interval = parseExpression(args.schedule);
|
|
542
544
|
nextRunAt = interval.next().toDate().toISOString();
|
|
543
545
|
}
|