claude-notification-plugin 1.0.17 → 1.0.18
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 +7 -2
- package/notifier/notifier.js +12 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,8 @@ Config file: `~/.claude/notifier.config.json`
|
|
|
47
47
|
"enabled": true
|
|
48
48
|
},
|
|
49
49
|
"minSeconds": 15,
|
|
50
|
-
"notifyOnWaiting": false
|
|
50
|
+
"notifyOnWaiting": false,
|
|
51
|
+
"debug": false
|
|
51
52
|
}
|
|
52
53
|
```
|
|
53
54
|
|
|
@@ -57,6 +58,8 @@ Each channel has an `enabled` flag (`true`/`false`) for global control.
|
|
|
57
58
|
|
|
58
59
|
`notifyOnWaiting` — send notifications when Claude is waiting for user input, e.g. permission prompts (default: `false`, set `true` to enable).
|
|
59
60
|
|
|
61
|
+
`debug` — include extra info in notifications for troubleshooting: voice phrase text when voice is enabled (default: `false`).
|
|
62
|
+
|
|
60
63
|
Environment variables `TELEGRAM_TOKEN` and `TELEGRAM_CHAT_ID` override config file values.
|
|
61
64
|
|
|
62
65
|
### Per-channel environment variables
|
|
@@ -70,6 +73,7 @@ These env vars override the global config per channel (`"1"` = on, `"0"` = off):
|
|
|
70
73
|
| `CLAUDE_NOTIFY_SOUND` | Sound alert |
|
|
71
74
|
| `CLAUDE_NOTIFY_VOICE` | Voice announcement (TTS) |
|
|
72
75
|
| `CLAUDE_NOTIFY_WAITING` | Waiting-for-input events |
|
|
76
|
+
| `CLAUDE_NOTIFY_DEBUG` | Debug mode |
|
|
73
77
|
|
|
74
78
|
### Per-project configuration
|
|
75
79
|
|
|
@@ -83,7 +87,8 @@ Add to `.claude/settings.local.json` in the project root to control channels per
|
|
|
83
87
|
"CLAUDE_NOTIFY_WINDOWS": 1,
|
|
84
88
|
"CLAUDE_NOTIFY_SOUND": 1,
|
|
85
89
|
"CLAUDE_NOTIFY_VOICE": 1,
|
|
86
|
-
"CLAUDE_NOTIFY_WAITING": 1
|
|
90
|
+
"CLAUDE_NOTIFY_WAITING": 1,
|
|
91
|
+
"CLAUDE_NOTIFY_DEBUG": 0
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
94
|
```
|
package/notifier/notifier.js
CHANGED
|
@@ -36,6 +36,7 @@ function loadConfig () {
|
|
|
36
36
|
},
|
|
37
37
|
minSeconds: 15,
|
|
38
38
|
notifyOnWaiting: false,
|
|
39
|
+
debug: false,
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
if (fs.existsSync(configPath)) {
|
|
@@ -60,6 +61,9 @@ function loadConfig () {
|
|
|
60
61
|
if (typeof user.notifyOnWaiting === 'boolean') {
|
|
61
62
|
config.notifyOnWaiting = user.notifyOnWaiting;
|
|
62
63
|
}
|
|
64
|
+
if (typeof user.debug === 'boolean') {
|
|
65
|
+
config.debug = user.debug;
|
|
66
|
+
}
|
|
63
67
|
} catch {
|
|
64
68
|
// ignore malformed config
|
|
65
69
|
}
|
|
@@ -88,6 +92,9 @@ function loadConfig () {
|
|
|
88
92
|
if (process.env.CLAUDE_NOTIFY_WAITING !== undefined) {
|
|
89
93
|
config.notifyOnWaiting = process.env.CLAUDE_NOTIFY_WAITING === '1';
|
|
90
94
|
}
|
|
95
|
+
if (process.env.CLAUDE_NOTIFY_DEBUG !== undefined) {
|
|
96
|
+
config.debug = process.env.CLAUDE_NOTIFY_DEBUG === '1';
|
|
97
|
+
}
|
|
91
98
|
|
|
92
99
|
return config;
|
|
93
100
|
}
|
|
@@ -315,9 +322,13 @@ process.stdin.on('end', async () => {
|
|
|
315
322
|
? 'Claude waiting for input'
|
|
316
323
|
: 'Claude finished coding';
|
|
317
324
|
|
|
318
|
-
|
|
325
|
+
let message =
|
|
319
326
|
`${title}\n\nProject: ${project}\nDuration: ${duration}s\nTrigger: ${eventType}`;
|
|
320
327
|
|
|
328
|
+
if (config.debug && config.voice.enabled) {
|
|
329
|
+
message += `\nVoice: ${getVoicePhrase(duration)}`;
|
|
330
|
+
}
|
|
331
|
+
|
|
321
332
|
state._telegramText = `\u{1F916} ${message}`;
|
|
322
333
|
await sendTelegram(config, state);
|
|
323
334
|
delete state._telegramText;
|
package/package.json
CHANGED