claude-notification-plugin 1.1.58 → 1.1.60
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 -1
- package/bin/listener-cli.js +65 -4
- package/commit-sha +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-notification-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.60",
|
|
4
4
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Viacheslav Makarov",
|
package/bin/listener-cli.js
CHANGED
|
@@ -180,7 +180,7 @@ function stopDaemon () {
|
|
|
180
180
|
console.log('Listener stopped');
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function showStatus () {
|
|
183
|
+
async function showStatus () {
|
|
184
184
|
const pid = readPid();
|
|
185
185
|
if (!pid) {
|
|
186
186
|
console.log('Status: not running');
|
|
@@ -193,11 +193,72 @@ function showStatus () {
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
console.log(`Status: running (PID: ${pid})`);
|
|
197
|
+
|
|
198
|
+
// Read config for Telegram info and listener section
|
|
199
|
+
let config = {};
|
|
200
|
+
try {
|
|
201
|
+
config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
|
|
202
|
+
} catch {
|
|
203
|
+
// ignore
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const token = process.env.CLAUDE_NOTIFY_TELEGRAM_TOKEN || config.telegramToken || config.telegram?.token;
|
|
207
|
+
const chatId = process.env.CLAUDE_NOTIFY_TELEGRAM_CHAT_ID || config.telegramChatId || config.telegram?.chatId;
|
|
208
|
+
|
|
209
|
+
// Telegram info
|
|
210
|
+
console.log('\nTelegram:');
|
|
211
|
+
if (token) {
|
|
212
|
+
const masked = token.length > 10
|
|
213
|
+
? token.slice(0, 5) + '...' + token.slice(-4)
|
|
214
|
+
: '***';
|
|
215
|
+
console.log(` Token: ${masked}`);
|
|
216
|
+
|
|
217
|
+
// Fetch bot name
|
|
218
|
+
try {
|
|
219
|
+
const meRes = await fetch(`https://api.telegram.org/bot${token}/getMe`);
|
|
220
|
+
const meData = await meRes.json();
|
|
221
|
+
if (meData.ok) {
|
|
222
|
+
console.log(` Bot: @${meData.result.username} (${meData.result.first_name})`);
|
|
223
|
+
}
|
|
224
|
+
} catch {
|
|
225
|
+
// ignore fetch errors
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
console.log(' Token: not configured');
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (chatId) {
|
|
232
|
+
console.log(` Chat ID: ${chatId}`);
|
|
233
|
+
|
|
234
|
+
// Fetch chat name
|
|
235
|
+
if (token) {
|
|
236
|
+
try {
|
|
237
|
+
const chatRes = await fetch(`https://api.telegram.org/bot${token}/getChat?chat_id=${chatId}`);
|
|
238
|
+
const chatData = await chatRes.json();
|
|
239
|
+
if (chatData.ok) {
|
|
240
|
+
const c = chatData.result;
|
|
241
|
+
const name = c.title || c.first_name || c.username || '';
|
|
242
|
+
const type = c.type || '';
|
|
243
|
+
console.log(` Chat: ${name}${type ? ` (${type})` : ''}`);
|
|
244
|
+
}
|
|
245
|
+
} catch {
|
|
246
|
+
// ignore fetch errors
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
console.log(' Chat ID: not configured');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Listener config
|
|
254
|
+
if (config.listener) {
|
|
255
|
+
console.log(`\nListener config:\n${JSON.stringify({ listener: config.listener }, null, 2)}`);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Log file and recent lines
|
|
196
259
|
const logFile = getLogFile();
|
|
197
|
-
console.log(
|
|
198
|
-
Log: ${logFile}`);
|
|
260
|
+
console.log(`\nLog: ${logFile}`);
|
|
199
261
|
|
|
200
|
-
// Show last few log lines
|
|
201
262
|
try {
|
|
202
263
|
if (fs.existsSync(logFile)) {
|
|
203
264
|
const content = fs.readFileSync(logFile, 'utf-8');
|
package/commit-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f80a38052530b65482f761ddfab8087fceab2587
|
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.1.
|
|
4
|
+
"version": "1.1.60",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|