claude-notification-plugin 1.0.13 → 1.0.17
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 +8 -2
- package/notifier/notifier.js +15 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ Notifications for Claude Code task completion. Sends alerts to Telegram and Wind
|
|
|
8
8
|
- Telegram bot messages
|
|
9
9
|
- Sound alert
|
|
10
10
|
- Voice announcement (TTS)
|
|
11
|
+
- Separate notifications for task completion and waiting-for-input events
|
|
11
12
|
- Skips short tasks (< 15s by default)
|
|
12
13
|
- Granular per-channel enable/disable (globally and per-project)
|
|
13
14
|
|
|
@@ -45,7 +46,8 @@ Config file: `~/.claude/notifier.config.json`
|
|
|
45
46
|
"voice": {
|
|
46
47
|
"enabled": true
|
|
47
48
|
},
|
|
48
|
-
"minSeconds": 15
|
|
49
|
+
"minSeconds": 15,
|
|
50
|
+
"notifyOnWaiting": false
|
|
49
51
|
}
|
|
50
52
|
```
|
|
51
53
|
|
|
@@ -53,6 +55,8 @@ Each channel has an `enabled` flag (`true`/`false`) for global control.
|
|
|
53
55
|
|
|
54
56
|
`deleteAfterHours` — auto-delete old Telegram messages after the specified number of hours (default: `24`, set `0` to disable).
|
|
55
57
|
|
|
58
|
+
`notifyOnWaiting` — send notifications when Claude is waiting for user input, e.g. permission prompts (default: `false`, set `true` to enable).
|
|
59
|
+
|
|
56
60
|
Environment variables `TELEGRAM_TOKEN` and `TELEGRAM_CHAT_ID` override config file values.
|
|
57
61
|
|
|
58
62
|
### Per-channel environment variables
|
|
@@ -65,6 +69,7 @@ These env vars override the global config per channel (`"1"` = on, `"0"` = off):
|
|
|
65
69
|
| `CLAUDE_NOTIFY_WINDOWS` | Windows toast notifications|
|
|
66
70
|
| `CLAUDE_NOTIFY_SOUND` | Sound alert |
|
|
67
71
|
| `CLAUDE_NOTIFY_VOICE` | Voice announcement (TTS) |
|
|
72
|
+
| `CLAUDE_NOTIFY_WAITING` | Waiting-for-input events |
|
|
68
73
|
|
|
69
74
|
### Per-project configuration
|
|
70
75
|
|
|
@@ -77,7 +82,8 @@ Add to `.claude/settings.local.json` in the project root to control channels per
|
|
|
77
82
|
"CLAUDE_NOTIFY_TELEGRAM": 1,
|
|
78
83
|
"CLAUDE_NOTIFY_WINDOWS": 1,
|
|
79
84
|
"CLAUDE_NOTIFY_SOUND": 1,
|
|
80
|
-
"CLAUDE_NOTIFY_VOICE": 1
|
|
85
|
+
"CLAUDE_NOTIFY_VOICE": 1,
|
|
86
|
+
"CLAUDE_NOTIFY_WAITING": 1
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
```
|
package/notifier/notifier.js
CHANGED
|
@@ -35,6 +35,7 @@ function loadConfig () {
|
|
|
35
35
|
enabled: true,
|
|
36
36
|
},
|
|
37
37
|
minSeconds: 15,
|
|
38
|
+
notifyOnWaiting: false,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
if (fs.existsSync(configPath)) {
|
|
@@ -56,6 +57,9 @@ function loadConfig () {
|
|
|
56
57
|
if (typeof user.minSeconds === 'number') {
|
|
57
58
|
config.minSeconds = user.minSeconds;
|
|
58
59
|
}
|
|
60
|
+
if (typeof user.notifyOnWaiting === 'boolean') {
|
|
61
|
+
config.notifyOnWaiting = user.notifyOnWaiting;
|
|
62
|
+
}
|
|
59
63
|
} catch {
|
|
60
64
|
// ignore malformed config
|
|
61
65
|
}
|
|
@@ -81,6 +85,9 @@ function loadConfig () {
|
|
|
81
85
|
if (process.env.CLAUDE_NOTIFY_VOICE !== undefined) {
|
|
82
86
|
config.voice.enabled = process.env.CLAUDE_NOTIFY_VOICE === '1';
|
|
83
87
|
}
|
|
88
|
+
if (process.env.CLAUDE_NOTIFY_WAITING !== undefined) {
|
|
89
|
+
config.notifyOnWaiting = process.env.CLAUDE_NOTIFY_WAITING === '1';
|
|
90
|
+
}
|
|
84
91
|
|
|
85
92
|
return config;
|
|
86
93
|
}
|
|
@@ -291,6 +298,10 @@ process.stdin.on('end', async () => {
|
|
|
291
298
|
process.exit(0);
|
|
292
299
|
}
|
|
293
300
|
|
|
301
|
+
if (eventType === 'Notification' && !config.notifyOnWaiting) {
|
|
302
|
+
process.exit(0);
|
|
303
|
+
}
|
|
304
|
+
|
|
294
305
|
let duration = 0;
|
|
295
306
|
if (state.start) {
|
|
296
307
|
duration = Math.round((Date.now() - state.start) / 1000);
|
|
@@ -300,16 +311,12 @@ process.stdin.on('end', async () => {
|
|
|
300
311
|
process.exit(0);
|
|
301
312
|
}
|
|
302
313
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
if (eventType === 'Notification') {
|
|
308
|
-
status = 'waiting';
|
|
309
|
-
}
|
|
314
|
+
const title = eventType === 'Notification'
|
|
315
|
+
? 'Claude waiting for input'
|
|
316
|
+
: 'Claude finished coding';
|
|
310
317
|
|
|
311
318
|
const message =
|
|
312
|
-
|
|
319
|
+
`${title}\n\nProject: ${project}\nDuration: ${duration}s\nTrigger: ${eventType}`;
|
|
313
320
|
|
|
314
321
|
state._telegramText = `\u{1F916} ${message}`;
|
|
315
322
|
await sendTelegram(config, state);
|
package/package.json
CHANGED