@wahooks/channel 2.2.0 → 2.2.1
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/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -754,11 +754,15 @@ async function main() {
|
|
|
754
754
|
fs.writeFileSync(PENDING_FILE, "[]", { mode: 0o600 });
|
|
755
755
|
return;
|
|
756
756
|
}
|
|
757
|
+
const debugLog = path.join(WAHOOKS_DIR, "channel-debug.log");
|
|
758
|
+
const log = (msg) => fs.appendFileSync(debugLog, `${new Date().toISOString()} ${msg}\n`);
|
|
759
|
+
log(`Found ${active.length} pending, claudeConnected=${claudeConnected}`);
|
|
757
760
|
console.error(`[wahooks-channel] Found ${active.length} pending reminder(s), delivering...`);
|
|
758
761
|
for (const item of active) {
|
|
762
|
+
log(`Delivering: ${item.reminderId}`);
|
|
759
763
|
console.error(`[wahooks-channel] Delivering: ${item.reminderId}`);
|
|
760
764
|
try {
|
|
761
|
-
await mcp.notification({
|
|
765
|
+
const result = await mcp.notification({
|
|
762
766
|
method: "notifications/claude/channel",
|
|
763
767
|
params: {
|
|
764
768
|
content: `[Scheduled Reminder] ${item.task}\n\nTarget chat: ${item.chatId}\nScheduled for: ${item.scheduledFor}\n\nPlease execute this task now and send the results to the target chat using wahooks_reply.`,
|
|
@@ -768,9 +772,11 @@ async function main() {
|
|
|
768
772
|
},
|
|
769
773
|
},
|
|
770
774
|
});
|
|
775
|
+
log(`Delivered: ${item.reminderId}, result=${JSON.stringify(result)}`);
|
|
771
776
|
console.error(`[wahooks-channel] Delivered: ${item.reminderId}`);
|
|
772
777
|
}
|
|
773
778
|
catch (err) {
|
|
779
|
+
log(`FAILED: ${item.reminderId}, error=${err}`);
|
|
774
780
|
console.error(`[wahooks-channel] Delivery failed: ${err}`);
|
|
775
781
|
claudeConnected = false;
|
|
776
782
|
return;
|
|
@@ -778,7 +784,7 @@ async function main() {
|
|
|
778
784
|
}
|
|
779
785
|
// Clear queue after all delivered
|
|
780
786
|
fs.writeFileSync(PENDING_FILE, "[]", { mode: 0o600 });
|
|
781
|
-
|
|
787
|
+
log("Queue cleared");
|
|
782
788
|
}
|
|
783
789
|
// Poll every 10s
|
|
784
790
|
setInterval(pollPending, 10_000);
|