claude-notification-plugin 1.0.40 → 1.0.42
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/.claude-plugin/plugin.json +1 -2
- package/README.md +7 -2
- package/notifier/notifier.js +13 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-notification-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.42",
|
|
4
4
|
"description": "Claude Code notifications щт task completion: Telegram, Windows toast, sound, and voice",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Viacheslav Makarov",
|
|
@@ -10,6 +10,5 @@
|
|
|
10
10
|
"repository": "https://github.com/Bazilio-san/claude-notification-plugin",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"keywords": ["notification", "telegram", "windows", "sound", "voice", "hooks"],
|
|
13
|
-
"hooks": "./hooks/hooks.json",
|
|
14
13
|
"commands": "./commands/"
|
|
15
14
|
}
|
package/README.md
CHANGED
|
@@ -64,7 +64,8 @@ Config file: `~/.claude/notifier.config.json`
|
|
|
64
64
|
"enabled": true,
|
|
65
65
|
"token": "YOUR_BOT_TOKEN",
|
|
66
66
|
"chatId": "YOUR_CHAT_ID",
|
|
67
|
-
"deleteAfterHours": 24
|
|
67
|
+
"deleteAfterHours": 24,
|
|
68
|
+
"includeLastCcMessageInTelegram": true
|
|
68
69
|
},
|
|
69
70
|
"windowsNotification": {
|
|
70
71
|
"enabled": true
|
|
@@ -86,6 +87,8 @@ Each channel has an `enabled` flag (`true`/`false`) for global control.
|
|
|
86
87
|
|
|
87
88
|
`deleteAfterHours` — auto-delete old Telegram messages after the specified number of hours (default: `24`, set `0` to disable).
|
|
88
89
|
|
|
90
|
+
`includeLastCcMessageInTelegram` — append Claude's last assistant message to the Telegram notification (default: `true`). Only affects Telegram, not Windows toast notifications. Long messages are truncated to 3500 characters.
|
|
91
|
+
|
|
89
92
|
`notifyOnWaiting` — send notifications when Claude is waiting for user input, e.g. permission prompts (default: `false`, set `true` to enable).
|
|
90
93
|
|
|
91
94
|
`debug` — include extra info in notifications: voice phrase text, full hook event JSON (formatted as code block in Telegram). Default: `false`.
|
|
@@ -104,6 +107,7 @@ These env vars override the global config per channel (`"1"` = on, `"0"` = off):
|
|
|
104
107
|
| `CLAUDE_NOTIFY_VOICE` | Voice announcement (TTS) |
|
|
105
108
|
| `CLAUDE_NOTIFY_WAITING` | Waiting-for-input events |
|
|
106
109
|
| `CLAUDE_NOTIFY_DEBUG` | Debug mode |
|
|
110
|
+
| `CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM` | Include last Claude message in Telegram |
|
|
107
111
|
|
|
108
112
|
### Per-project configuration
|
|
109
113
|
|
|
@@ -118,7 +122,8 @@ Add to `.claude/settings.local.json` in the project root to control channels per
|
|
|
118
122
|
"CLAUDE_NOTIFY_SOUND": 1,
|
|
119
123
|
"CLAUDE_NOTIFY_VOICE": 1,
|
|
120
124
|
"CLAUDE_NOTIFY_WAITING": 1,
|
|
121
|
-
"CLAUDE_NOTIFY_DEBUG": 0
|
|
125
|
+
"CLAUDE_NOTIFY_DEBUG": 0,
|
|
126
|
+
"CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM": 1
|
|
122
127
|
}
|
|
123
128
|
}
|
|
124
129
|
```
|
package/notifier/notifier.js
CHANGED
|
@@ -19,6 +19,7 @@ function loadConfig () {
|
|
|
19
19
|
token: '',
|
|
20
20
|
chatId: '',
|
|
21
21
|
deleteAfterHours: 24,
|
|
22
|
+
includeLastCcMessageInTelegram: true,
|
|
22
23
|
},
|
|
23
24
|
windowsNotification: {
|
|
24
25
|
enabled: true,
|
|
@@ -91,6 +92,9 @@ function loadConfig () {
|
|
|
91
92
|
if (process.env.CLAUDE_NOTIFY_DEBUG !== undefined) {
|
|
92
93
|
config.debug = process.env.CLAUDE_NOTIFY_DEBUG === '1';
|
|
93
94
|
}
|
|
95
|
+
if (process.env.CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM !== undefined) {
|
|
96
|
+
config.telegram.includeLastCcMessageInTelegram = process.env.CLAUDE_NOTIFY_INCLUDE_LAST_CC_MESSAGE_IN_TELEGRAM === '1';
|
|
97
|
+
}
|
|
94
98
|
|
|
95
99
|
return config;
|
|
96
100
|
}
|
|
@@ -458,6 +462,15 @@ process.stdin.on('end', async () => {
|
|
|
458
462
|
let telegramMessage =
|
|
459
463
|
`${title}\n\nProject: *${project}*\nDuration: ${duration}s\nTrigger: ${eventType}`;
|
|
460
464
|
|
|
465
|
+
if (config.telegram.includeLastCcMessageInTelegram && event.last_assistant_message) {
|
|
466
|
+
const maxLen = 3500;
|
|
467
|
+
let lastMsg = event.last_assistant_message;
|
|
468
|
+
if (lastMsg.length > maxLen) {
|
|
469
|
+
lastMsg = lastMsg.slice(0, maxLen) + '…';
|
|
470
|
+
}
|
|
471
|
+
telegramMessage += `\n\n${lastMsg}`;
|
|
472
|
+
}
|
|
473
|
+
|
|
461
474
|
if (config.debug) {
|
|
462
475
|
const debugBlock = '\n\n*Debug:*\n'
|
|
463
476
|
+ (config.voice.enabled ? `\nVoice: ${getVoicePhrase(duration)}` : '')
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-notification-plugin",
|
|
3
3
|
"productName": "claude-notification-plugin",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.42",
|
|
5
5
|
"description": "Claude Code notifications щт task completion: Telegram, Windows toast, sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|