clawpulse 0.1.0
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/LICENSE +21 -0
- package/QUICKSTART.md +413 -0
- package/README.md +315 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Abdelhak Akermi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# ClawPulse - Quick Start Guide
|
|
2
|
+
|
|
3
|
+
Get ClawPulse running in 5 minutes! 🚀
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 22+ installed
|
|
8
|
+
- OpenClaw Gateway running on your system
|
|
9
|
+
- OpenClaw CLI installed (`openclaw` command available)
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
### Option 1: From npm (when published)
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g clawpulse
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Option 2: From source
|
|
19
|
+
```bash
|
|
20
|
+
git clone https://github.com/abakermi/clawpulse.git
|
|
21
|
+
cd clawpulse
|
|
22
|
+
npm install
|
|
23
|
+
npm run build
|
|
24
|
+
npm link # Makes 'clawpulse' command available globally
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### Step 1: Initialize
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
clawpulse init
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This creates `~/.clawpulse/` with your database.
|
|
36
|
+
|
|
37
|
+
### Step 2: Add Your First Job
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Simple job (logs only)
|
|
41
|
+
clawpulse add \
|
|
42
|
+
--cron "*/5 * * * *" \
|
|
43
|
+
--message "What's the time?" \
|
|
44
|
+
--name "time-check" \
|
|
45
|
+
--agent main
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Step 3: Start the Scheduler
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
clawpulse daemon
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
You should see:
|
|
55
|
+
```
|
|
56
|
+
🦞 Starting ClawPulse Scheduler...
|
|
57
|
+
✅ OpenClaw CLI found
|
|
58
|
+
📋 Loaded 1 enabled jobs
|
|
59
|
+
⏰ Scheduled job: time-check (*/5 * * * *)
|
|
60
|
+
✅ ClawPulse Scheduler started
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Every 5 minutes, the job will execute and you'll see responses in the OpenClaw Gateway logs.
|
|
64
|
+
|
|
65
|
+
### Step 4: View Your Jobs
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
clawpulse list
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Common Examples
|
|
74
|
+
|
|
75
|
+
### 1. Daily Morning Briefing to WhatsApp
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
clawpulse add \
|
|
79
|
+
--cron "0 9 * * *" \
|
|
80
|
+
--message "Good morning! What's on my agenda today?" \
|
|
81
|
+
--name "morning-briefing" \
|
|
82
|
+
--agent main \
|
|
83
|
+
--channel whatsapp \
|
|
84
|
+
--deliver
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Result**: Every day at 9 AM, you'll receive a WhatsApp message with your agenda!
|
|
88
|
+
|
|
89
|
+
### 2. Hourly Status Update to Telegram
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# First, get your Telegram chat ID from @userinfobot
|
|
93
|
+
clawpulse add \
|
|
94
|
+
--cron "0 * * * *" \
|
|
95
|
+
--message "Hourly system status check" \
|
|
96
|
+
--name "status-telegram" \
|
|
97
|
+
--agent main \
|
|
98
|
+
--channel telegram \
|
|
99
|
+
--deliver \
|
|
100
|
+
--reply-to YOUR_CHAT_ID
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Result**: Every hour, you'll receive a Telegram message with the status!
|
|
104
|
+
|
|
105
|
+
### 3. Weekly Report every Monday
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
clawpulse add \
|
|
109
|
+
--cron "0 10 * * 1" \
|
|
110
|
+
--message "Generate weekly activity report from last 7 days" \
|
|
111
|
+
--name "weekly-report" \
|
|
112
|
+
--agent main \
|
|
113
|
+
--channel whatsapp \
|
|
114
|
+
--deliver
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Result**: Every Monday at 10 AM, get your weekly report!
|
|
118
|
+
|
|
119
|
+
### 4. Every 15 Minutes Health Check (Logs Only)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
clawpulse add \
|
|
123
|
+
--cron "*/15 * * * *" \
|
|
124
|
+
--message "System health check" \
|
|
125
|
+
--name "health-check" \
|
|
126
|
+
--agent main
|
|
127
|
+
# Note: No --channel or --deliver = responses only in logs
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Result**: Agent responds every 15 minutes, visible in gateway logs.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Understanding Cron Expressions
|
|
135
|
+
|
|
136
|
+
Cron format: `minute hour day month weekday`
|
|
137
|
+
|
|
138
|
+
### Common Patterns
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Every minute
|
|
142
|
+
*/1 * * * *
|
|
143
|
+
|
|
144
|
+
# Every 5 minutes
|
|
145
|
+
*/5 * * * *
|
|
146
|
+
|
|
147
|
+
# Every hour
|
|
148
|
+
0 * * * *
|
|
149
|
+
|
|
150
|
+
# Every day at 9 AM
|
|
151
|
+
0 9 * * *
|
|
152
|
+
|
|
153
|
+
# Every day at 9 AM and 5 PM
|
|
154
|
+
0 9,17 * * *
|
|
155
|
+
|
|
156
|
+
# Every weekday at 9 AM
|
|
157
|
+
0 9 * * 1-5
|
|
158
|
+
|
|
159
|
+
# Every Monday at 10 AM
|
|
160
|
+
0 10 * * 1
|
|
161
|
+
|
|
162
|
+
# Every Sunday at midnight
|
|
163
|
+
0 0 * * 0
|
|
164
|
+
|
|
165
|
+
# First day of every month at 9 AM
|
|
166
|
+
0 9 1 * *
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Need help?** Use [crontab.guru](https://crontab.guru) to build and test expressions!
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Channel Delivery
|
|
174
|
+
|
|
175
|
+
### WhatsApp (Easiest)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
clawpulse add \
|
|
179
|
+
--cron "0 9 * * *" \
|
|
180
|
+
--message "Morning update" \
|
|
181
|
+
--agent main \
|
|
182
|
+
--channel whatsapp \
|
|
183
|
+
--deliver
|
|
184
|
+
# No --reply-to needed - uses your personal WhatsApp chat
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Telegram (Requires Chat ID)
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# 1. Get chat ID from @userinfobot on Telegram
|
|
191
|
+
# 2. Use it with --reply-to
|
|
192
|
+
clawpulse add \
|
|
193
|
+
--cron "0 9 * * *" \
|
|
194
|
+
--message "Morning update" \
|
|
195
|
+
--agent main \
|
|
196
|
+
--channel telegram \
|
|
197
|
+
--deliver \
|
|
198
|
+
--reply-to 123456789
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Slack (Requires Channel)
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
clawpulse add \
|
|
205
|
+
--cron "0 9 * * *" \
|
|
206
|
+
--message "Morning update" \
|
|
207
|
+
--agent main \
|
|
208
|
+
--channel slack \
|
|
209
|
+
--deliver \
|
|
210
|
+
--reply-to "#general"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Logs Only (No Delivery)
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
clawpulse add \
|
|
217
|
+
--cron "0 9 * * *" \
|
|
218
|
+
--message "Morning update" \
|
|
219
|
+
--agent main
|
|
220
|
+
# Omit --channel and --deliver flags
|
|
221
|
+
# Response only appears in OpenClaw Gateway logs
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## CLI Commands
|
|
227
|
+
|
|
228
|
+
### Add a Job
|
|
229
|
+
```bash
|
|
230
|
+
clawpulse add --cron "0 9 * * *" --message "Morning briefing" --agent main
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### List All Jobs
|
|
234
|
+
```bash
|
|
235
|
+
clawpulse list
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Output:
|
|
239
|
+
```
|
|
240
|
+
📋 Found 2 jobs:
|
|
241
|
+
|
|
242
|
+
morning-briefing (1770547841976-d382qjv)
|
|
243
|
+
Status: ✓ enabled
|
|
244
|
+
Cron: */1 * * * *
|
|
245
|
+
Message: Good morning! What's on the agenda today?
|
|
246
|
+
Channel: whatsapp
|
|
247
|
+
Agent: main
|
|
248
|
+
Deliver: yes
|
|
249
|
+
Runs: 5 success, 0 failed
|
|
250
|
+
Last run: 2/8/2026, 10:48:35 AM
|
|
251
|
+
Next run: 2/8/2026, 10:49:00 AM
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Show Status
|
|
255
|
+
```bash
|
|
256
|
+
clawpulse status
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Output:
|
|
260
|
+
```
|
|
261
|
+
📊 ClawPulse Status
|
|
262
|
+
|
|
263
|
+
Total jobs: 2
|
|
264
|
+
Enabled jobs: 2
|
|
265
|
+
Running jobs: 2
|
|
266
|
+
Total runs: 10
|
|
267
|
+
Successful runs: 10
|
|
268
|
+
Failed runs: 0
|
|
269
|
+
Last run: 2/8/2026, 10:48:35 AM
|
|
270
|
+
Next run: 2/8/2026, 10:49:00 AM
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Remove a Job
|
|
274
|
+
```bash
|
|
275
|
+
clawpulse remove 1770547841976-d382qjv
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Manually Trigger a Job
|
|
279
|
+
```bash
|
|
280
|
+
clawpulse trigger 1770547841976-d382qjv
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Troubleshooting
|
|
286
|
+
|
|
287
|
+
### 1. Jobs not firing?
|
|
288
|
+
|
|
289
|
+
Make sure the daemon is running:
|
|
290
|
+
```bash
|
|
291
|
+
# In one terminal
|
|
292
|
+
clawpulse daemon
|
|
293
|
+
|
|
294
|
+
# In another terminal
|
|
295
|
+
clawpulse status
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### 2. "OpenClaw CLI not found"?
|
|
299
|
+
|
|
300
|
+
Check OpenClaw is installed:
|
|
301
|
+
```bash
|
|
302
|
+
which openclaw
|
|
303
|
+
openclaw --version
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
If not installed, install OpenClaw first.
|
|
307
|
+
|
|
308
|
+
### 3. Telegram delivery fails?
|
|
309
|
+
|
|
310
|
+
Error: `Delivering to Telegram requires target <chatId>`
|
|
311
|
+
|
|
312
|
+
**Solution**: Add `--reply-to` with your Telegram chat ID:
|
|
313
|
+
```bash
|
|
314
|
+
# Get chat ID from @userinfobot
|
|
315
|
+
clawpulse add ... --channel telegram --deliver --reply-to 123456789
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### 4. Database errors?
|
|
319
|
+
|
|
320
|
+
Reset the database:
|
|
321
|
+
```bash
|
|
322
|
+
rm ~/.clawpulse/data.db*
|
|
323
|
+
clawpulse init
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### 5. "Command hangs after adding job"?
|
|
327
|
+
|
|
328
|
+
This was a bug in earlier versions. Make sure you have the latest build:
|
|
329
|
+
```bash
|
|
330
|
+
cd clawpulse
|
|
331
|
+
npm run build
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## Advanced Usage
|
|
337
|
+
|
|
338
|
+
### Custom Agent
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
clawpulse add \
|
|
342
|
+
--cron "0 9 * * *" \
|
|
343
|
+
--message "Analyze yesterday's metrics" \
|
|
344
|
+
--agent analytics # Use 'analytics' agent instead of 'main'
|
|
345
|
+
--channel slack \
|
|
346
|
+
--deliver \
|
|
347
|
+
--reply-to "#metrics"
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Target Specific Session
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
clawpulse add \
|
|
354
|
+
--cron "0 9 * * *" \
|
|
355
|
+
--message "Continue our discussion about project X" \
|
|
356
|
+
--session-id abc123 # Resume specific conversation
|
|
357
|
+
--channel whatsapp \
|
|
358
|
+
--deliver
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Custom Timezone
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
export TZ=America/New_York
|
|
365
|
+
clawpulse daemon
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## Real-World Use Cases
|
|
371
|
+
|
|
372
|
+
### Personal Assistant
|
|
373
|
+
```bash
|
|
374
|
+
# Morning briefing
|
|
375
|
+
clawpulse add --cron "0 8 * * 1-5" --message "Good morning! Summarize my calendar and top 3 priorities" --agent main --channel whatsapp --deliver
|
|
376
|
+
|
|
377
|
+
# Evening wrap-up
|
|
378
|
+
clawpulse add --cron "0 18 * * 1-5" --message "Summarize what I accomplished today" --agent main --channel whatsapp --deliver
|
|
379
|
+
|
|
380
|
+
# Weekend planning
|
|
381
|
+
clawpulse add --cron "0 9 * * 6" --message "What's on my calendar for next week?" --agent main --channel whatsapp --deliver
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Team Notifications
|
|
385
|
+
```bash
|
|
386
|
+
# Daily standup reminder
|
|
387
|
+
clawpulse add --cron "0 9 * * 1-5" --message "Daily standup in 30 minutes! Prepare your updates" --agent main --channel slack --deliver --reply-to "#team"
|
|
388
|
+
|
|
389
|
+
# Weekly retrospective
|
|
390
|
+
clawpulse add --cron "0 15 * * 5" --message "Weekly retro in 1 hour! Review the sprint board" --agent main --channel slack --deliver --reply-to "#team"
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Monitoring & Alerts
|
|
394
|
+
```bash
|
|
395
|
+
# Health checks
|
|
396
|
+
clawpulse add --cron "*/15 * * * *" --message "Check system health and alert if issues" --agent monitoring --channel telegram --deliver --reply-to 123456789
|
|
397
|
+
|
|
398
|
+
# Daily metrics
|
|
399
|
+
clawpulse add --cron "0 10 * * *" --message "Generate yesterday's metrics report" --agent analytics --channel slack --deliver --reply-to "#metrics"
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## What's Next?
|
|
405
|
+
|
|
406
|
+
1. **Check the full README** for all options: [README.md](./README.md)
|
|
407
|
+
2. **Join the community**: OpenClaw Discord `#extensions` channel
|
|
408
|
+
3. **Report issues**: GitHub Issues (when repo is public)
|
|
409
|
+
4. **Contribute**: See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
**You're all set!** ClawPulse is now scheduling your jobs reliably. 🦞⚡
|
package/README.md
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# ClawPulse 🦞⚡
|
|
2
|
+
|
|
3
|
+
> **Reliable cron scheduler for OpenClaw** - Fix broken scheduling and build truly proactive AI agents
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
## The Problem
|
|
8
|
+
|
|
9
|
+
OpenClaw's built-in cron scheduler has critical issues (10+ bugs in the past month):
|
|
10
|
+
- Jobs never fire despite scheduler reporting 'started'
|
|
11
|
+
- `schedule.kind: 'every'` without anchorMs never triggers
|
|
12
|
+
- Timer re-arms but runDueJobs finds nothing
|
|
13
|
+
- Scheduler lane wedges for hours
|
|
14
|
+
|
|
15
|
+
**Result**: Users cannot build proactive agents. No reminders, no monitoring, no automation.
|
|
16
|
+
|
|
17
|
+
## The Solution
|
|
18
|
+
|
|
19
|
+
ClawPulse is a lightweight, reliable scheduler that integrates seamlessly with OpenClaw:
|
|
20
|
+
|
|
21
|
+
- ✅ **Rock-solid scheduling** - Uses battle-tested Croner library
|
|
22
|
+
- 📱 **Multi-channel delivery** - WhatsApp, Telegram, Slack, Discord, etc.
|
|
23
|
+
- 🎯 **Agent targeting** - Route to specific agents or sessions
|
|
24
|
+
- 📊 **Execution history** - Track what fired, when, and results
|
|
25
|
+
- 🔧 **Simple CLI** - Add jobs in seconds
|
|
26
|
+
- 💾 **SQLite persistence** - Jobs survive restarts
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Install
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install -g clawpulse
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### 2. Initialize
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
clawpulse init
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Add your first job
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Send to WhatsApp every day at 9 AM
|
|
46
|
+
clawpulse add \
|
|
47
|
+
--cron "0 9 * * *" \
|
|
48
|
+
--message "Good morning! What's on the agenda today?" \
|
|
49
|
+
--agent main \
|
|
50
|
+
--channel whatsapp \
|
|
51
|
+
--deliver
|
|
52
|
+
|
|
53
|
+
# Send to Telegram every hour
|
|
54
|
+
clawpulse add \
|
|
55
|
+
--cron "0 * * * *" \
|
|
56
|
+
--message "Hourly status update" \
|
|
57
|
+
--agent main \
|
|
58
|
+
--channel telegram \
|
|
59
|
+
--deliver \
|
|
60
|
+
--reply-to YOUR_CHAT_ID
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 4. Start the scheduler
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
clawpulse daemon
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## CLI Commands
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Add a scheduled job
|
|
73
|
+
clawpulse add --cron "0 9 * * *" --message "Morning briefing" --agent main
|
|
74
|
+
|
|
75
|
+
# List all jobs
|
|
76
|
+
clawpulse list
|
|
77
|
+
|
|
78
|
+
# Show scheduler status
|
|
79
|
+
clawpulse status
|
|
80
|
+
|
|
81
|
+
# Update a job
|
|
82
|
+
clawpulse update <job-id> --message "Updated message" --cron "0 10 * * *"
|
|
83
|
+
|
|
84
|
+
# Enable/disable jobs
|
|
85
|
+
clawpulse enable <job-id>
|
|
86
|
+
clawpulse disable <job-id>
|
|
87
|
+
|
|
88
|
+
# View execution history
|
|
89
|
+
clawpulse logs <job-id> --limit 20
|
|
90
|
+
|
|
91
|
+
# Remove a job
|
|
92
|
+
clawpulse remove <job-id>
|
|
93
|
+
|
|
94
|
+
# Manually trigger a job
|
|
95
|
+
clawpulse trigger <job-id>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Options
|
|
99
|
+
|
|
100
|
+
### --cron
|
|
101
|
+
Cron expression for scheduling. Examples:
|
|
102
|
+
- `"*/5 * * * *"` - Every 5 minutes
|
|
103
|
+
- `"0 9 * * *"` - Every day at 9 AM
|
|
104
|
+
- `"0 0 * * 0"` - Every Sunday at midnight
|
|
105
|
+
- `"0 9 * * 1-5"` - Every weekday at 9 AM
|
|
106
|
+
|
|
107
|
+
Use [crontab.guru](https://crontab.guru) to create expressions.
|
|
108
|
+
|
|
109
|
+
### --channel
|
|
110
|
+
Delivery channel (optional):
|
|
111
|
+
- `whatsapp` - WhatsApp (default personal chat)
|
|
112
|
+
- `telegram` - Telegram (requires --reply-to)
|
|
113
|
+
- `slack` - Slack
|
|
114
|
+
- `discord` - Discord
|
|
115
|
+
- `signal` - Signal
|
|
116
|
+
- And more...
|
|
117
|
+
|
|
118
|
+
### --agent
|
|
119
|
+
OpenClaw agent ID (default: `main`)
|
|
120
|
+
|
|
121
|
+
### --deliver
|
|
122
|
+
Send the agent's response back to the channel. Without this flag, responses only appear in gateway logs.
|
|
123
|
+
|
|
124
|
+
### --reply-to
|
|
125
|
+
Target for delivery (required for Telegram):
|
|
126
|
+
- Telegram: Chat ID (e.g., `123456789`)
|
|
127
|
+
- Slack: Channel name (e.g., `#general`)
|
|
128
|
+
- Discord: Channel ID
|
|
129
|
+
|
|
130
|
+
### --session-id
|
|
131
|
+
Target specific session instead of agent
|
|
132
|
+
|
|
133
|
+
### --to
|
|
134
|
+
Target phone number in E.164 format (alternative to --agent)
|
|
135
|
+
|
|
136
|
+
## Examples
|
|
137
|
+
|
|
138
|
+
### Daily morning briefing to WhatsApp
|
|
139
|
+
```bash
|
|
140
|
+
clawpulse add \
|
|
141
|
+
--cron "0 9 * * *" \
|
|
142
|
+
--message "Good morning! Summarize my calendar and top emails" \
|
|
143
|
+
--name "morning-briefing" \
|
|
144
|
+
--agent main \
|
|
145
|
+
--channel whatsapp \
|
|
146
|
+
--deliver
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Hourly status check to Telegram
|
|
150
|
+
```bash
|
|
151
|
+
clawpulse add \
|
|
152
|
+
--cron "0 * * * *" \
|
|
153
|
+
--message "System status check" \
|
|
154
|
+
--name "status-check" \
|
|
155
|
+
--agent main \
|
|
156
|
+
--channel telegram \
|
|
157
|
+
--deliver \
|
|
158
|
+
--reply-to 5661599285
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Weekly report every Monday at 10 AM
|
|
162
|
+
```bash
|
|
163
|
+
clawpulse add \
|
|
164
|
+
--cron "0 10 * * 1" \
|
|
165
|
+
--message "Generate weekly activity report" \
|
|
166
|
+
--name "weekly-report" \
|
|
167
|
+
--agent main \
|
|
168
|
+
--channel slack \
|
|
169
|
+
--deliver \
|
|
170
|
+
--reply-to "#reports"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Every 5 minutes health check (logs only)
|
|
174
|
+
```bash
|
|
175
|
+
clawpulse add \
|
|
176
|
+
--cron "*/5 * * * *" \
|
|
177
|
+
--message "Health check ping" \
|
|
178
|
+
--name "health-check" \
|
|
179
|
+
--agent main
|
|
180
|
+
# Note: No --deliver flag - responses only in logs
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## How It Works
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
187
|
+
│ ClawPulse │ │ OpenClaw │ │ Channels │
|
|
188
|
+
│ Scheduler │──────▶│ CLI Agent │──────▶│ (Output) │
|
|
189
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
190
|
+
│ │ │
|
|
191
|
+
Cron Jobs Process Msg WhatsApp
|
|
192
|
+
SQLite DB Generate Reply Telegram
|
|
193
|
+
Job History Gateway Auth Slack, etc.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
1. **ClawPulse** stores jobs in SQLite and triggers them on schedule
|
|
197
|
+
2. **OpenClaw CLI** receives the message and sends it to your agent
|
|
198
|
+
3. **Channels** (optional) deliver the agent's response to WhatsApp/Telegram/etc.
|
|
199
|
+
|
|
200
|
+
## Architecture
|
|
201
|
+
|
|
202
|
+
- **Language**: TypeScript
|
|
203
|
+
- **Runtime**: Node.js 22+
|
|
204
|
+
- **Scheduler**: [Croner](https://github.com/hexagon/croner) (battle-tested, 99.9%+ reliability)
|
|
205
|
+
- **Database**: SQLite with WAL mode
|
|
206
|
+
- **Integration**: OpenClaw CLI (handles authentication automatically)
|
|
207
|
+
|
|
208
|
+
## Configuration
|
|
209
|
+
|
|
210
|
+
ClawPulse stores data in `~/.clawpulse/`:
|
|
211
|
+
- `data.db` - SQLite database (jobs and execution history)
|
|
212
|
+
- `data.db-wal` - Write-ahead log
|
|
213
|
+
- `data.db-shm` - Shared memory
|
|
214
|
+
|
|
215
|
+
### Environment Variables
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# Gateway URL (default: ws://localhost:18789)
|
|
219
|
+
export OPENCLAW_GATEWAY_URL=ws://localhost:18789
|
|
220
|
+
|
|
221
|
+
# Database path (default: ~/.clawpulse/data.db)
|
|
222
|
+
export CLAWPULSE_DB=/custom/path/data.db
|
|
223
|
+
|
|
224
|
+
# Timezone (default: system timezone)
|
|
225
|
+
export TZ=America/New_York
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Development
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
# Clone repository
|
|
232
|
+
git clone https://github.com/abakermi/clawpulse.git
|
|
233
|
+
cd clawpulse
|
|
234
|
+
|
|
235
|
+
# Install dependencies
|
|
236
|
+
npm install
|
|
237
|
+
|
|
238
|
+
# Build
|
|
239
|
+
npm run build
|
|
240
|
+
|
|
241
|
+
# Run tests
|
|
242
|
+
npm test
|
|
243
|
+
|
|
244
|
+
# Run in dev mode
|
|
245
|
+
npm run dev -- daemon
|
|
246
|
+
|
|
247
|
+
# Test specific command
|
|
248
|
+
npm run dev -- add --cron "*/1 * * * *" --message "Test" --agent main
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Troubleshooting
|
|
252
|
+
|
|
253
|
+
### Jobs not firing?
|
|
254
|
+
|
|
255
|
+
Check that the daemon is running:
|
|
256
|
+
```bash
|
|
257
|
+
clawpulse status
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Telegram delivery failing?
|
|
261
|
+
|
|
262
|
+
Make sure you provide a chat ID:
|
|
263
|
+
```bash
|
|
264
|
+
# Get your Telegram chat ID from @userinfobot
|
|
265
|
+
clawpulse add --channel telegram --deliver --reply-to YOUR_CHAT_ID ...
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Database errors?
|
|
269
|
+
|
|
270
|
+
Reset the database:
|
|
271
|
+
```bash
|
|
272
|
+
rm ~/.clawpulse/data.db*
|
|
273
|
+
clawpulse init
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## Roadmap
|
|
277
|
+
|
|
278
|
+
### ✅ Phase 1: MVP (Complete)
|
|
279
|
+
- [x] Reliable cron scheduling with Croner
|
|
280
|
+
- [x] SQLite persistence
|
|
281
|
+
- [x] OpenClaw CLI integration
|
|
282
|
+
- [x] Multi-channel delivery (WhatsApp, Telegram, etc.)
|
|
283
|
+
- [x] Job management (add/list/remove/update/enable/disable/logs)
|
|
284
|
+
- [x] Execution history
|
|
285
|
+
- [x] Input validation with helpful error messages
|
|
286
|
+
- [x] Unit tests (68.5% coverage, 39/39 passing)
|
|
287
|
+
|
|
288
|
+
### 📋 Phase 3: Advanced Features (Future)
|
|
289
|
+
- [ ] HTTP webhook receiver
|
|
290
|
+
- [ ] GitHub event integration
|
|
291
|
+
- [ ] Event chains (when A completes, trigger B)
|
|
292
|
+
- [ ] Web dashboard (basic UI)
|
|
293
|
+
- [ ] PostgreSQL support
|
|
294
|
+
|
|
295
|
+
## Contributing
|
|
296
|
+
|
|
297
|
+
We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
298
|
+
|
|
299
|
+
## License
|
|
300
|
+
|
|
301
|
+
MIT License - see [LICENSE](./LICENSE)
|
|
302
|
+
|
|
303
|
+
Copyright (c) 2026 Abdelhak Akermi
|
|
304
|
+
|
|
305
|
+
## Support
|
|
306
|
+
|
|
307
|
+
- **Issues**: [GitHub Issues](https://github.com/abakermi/clawpulse/issues)
|
|
308
|
+
- **Discussions**: [GitHub Discussions](https://github.com/abakermi/clawpulse/discussions)
|
|
309
|
+
- **OpenClaw Discord**: `#extensions` channel
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
**Built with ❤️ for the OpenClaw community** 🦞
|
|
314
|
+
|
|
315
|
+
**Status**: Alpha - Working and tested with OpenClaw Gateway
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "clawpulse",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Event-driven orchestrator for OpenClaw - fix broken cron and enable proactive AI agents",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openclaw",
|
|
7
|
+
"cron",
|
|
8
|
+
"scheduler",
|
|
9
|
+
"events",
|
|
10
|
+
"webhooks",
|
|
11
|
+
"automation",
|
|
12
|
+
"ai-agents"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Abdelhak Akermi",
|
|
16
|
+
"homepage": "https://github.com/abakermi/clawpulse#readme",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/abakermi/clawpulse.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/abakermi/clawpulse/issues"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"clawpulse": "./dist/cli.js"
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "tsx src/cli.ts",
|
|
31
|
+
"build": "tsc && cp -r src/database/*.sql dist/database/",
|
|
32
|
+
"test": "vitest",
|
|
33
|
+
"test:coverage": "vitest --coverage",
|
|
34
|
+
"lint": "eslint src/**/*.ts",
|
|
35
|
+
"format": "prettier --write src/**/*.ts",
|
|
36
|
+
"start": "node dist/cli.js"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"better-sqlite3": "^11.0.0",
|
|
40
|
+
"chalk": "^5.6.0",
|
|
41
|
+
"commander": "^12.0.0",
|
|
42
|
+
"croner": "^10.0.0",
|
|
43
|
+
"dotenv": "^17.0.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
47
|
+
"@types/node": "^22.0.0",
|
|
48
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
49
|
+
"eslint": "^9.0.0",
|
|
50
|
+
"prettier": "^3.0.0",
|
|
51
|
+
"tsx": "^4.0.0",
|
|
52
|
+
"typescript": "^5.6.0",
|
|
53
|
+
"vitest": "^4.0.0"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=20.0.0"
|
|
57
|
+
},
|
|
58
|
+
"files": [
|
|
59
|
+
"dist",
|
|
60
|
+
"LICENSE",
|
|
61
|
+
"README.md",
|
|
62
|
+
"QUICKSTART.md"
|
|
63
|
+
]
|
|
64
|
+
}
|