claude-notification-plugin 1.1.58 → 1.1.61
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/install.js +2 -1
- package/bin/listener-cli.js +77 -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.61",
|
|
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/install.js
CHANGED
|
@@ -497,7 +497,8 @@ async function main () {
|
|
|
497
497
|
const version = getVersion();
|
|
498
498
|
|
|
499
499
|
console.log('');
|
|
500
|
-
console.log(`
|
|
500
|
+
console.log(`claude-notify v${version}`);
|
|
501
|
+
console.log('Registering plugin in Claude Code...');
|
|
501
502
|
|
|
502
503
|
const installPath = copyToCache(version);
|
|
503
504
|
console.log(` Cached: ${installPath}`);
|
package/bin/listener-cli.js
CHANGED
|
@@ -11,6 +11,16 @@ import {
|
|
|
11
11
|
|
|
12
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
13
|
const __dirname = path.dirname(__filename);
|
|
14
|
+
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
15
|
+
|
|
16
|
+
function getVersion () {
|
|
17
|
+
try {
|
|
18
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT, 'package.json'), 'utf-8'));
|
|
19
|
+
return pkg.version;
|
|
20
|
+
} catch {
|
|
21
|
+
return 'unknown';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
14
24
|
|
|
15
25
|
function getLogFile () {
|
|
16
26
|
try {
|
|
@@ -180,7 +190,9 @@ function stopDaemon () {
|
|
|
180
190
|
console.log('Listener stopped');
|
|
181
191
|
}
|
|
182
192
|
|
|
183
|
-
function showStatus () {
|
|
193
|
+
async function showStatus () {
|
|
194
|
+
console.log(`claude-notify v${getVersion()}`);
|
|
195
|
+
|
|
184
196
|
const pid = readPid();
|
|
185
197
|
if (!pid) {
|
|
186
198
|
console.log('Status: not running');
|
|
@@ -193,11 +205,72 @@ function showStatus () {
|
|
|
193
205
|
return;
|
|
194
206
|
}
|
|
195
207
|
|
|
208
|
+
console.log(`Status: running (PID: ${pid})`);
|
|
209
|
+
|
|
210
|
+
// Read config for Telegram info and listener section
|
|
211
|
+
let config = {};
|
|
212
|
+
try {
|
|
213
|
+
config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf-8'));
|
|
214
|
+
} catch {
|
|
215
|
+
// ignore
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const token = process.env.CLAUDE_NOTIFY_TELEGRAM_TOKEN || config.telegramToken || config.telegram?.token;
|
|
219
|
+
const chatId = process.env.CLAUDE_NOTIFY_TELEGRAM_CHAT_ID || config.telegramChatId || config.telegram?.chatId;
|
|
220
|
+
|
|
221
|
+
// Telegram info
|
|
222
|
+
console.log('\nTelegram:');
|
|
223
|
+
if (token) {
|
|
224
|
+
const masked = token.length > 10
|
|
225
|
+
? token.slice(0, 5) + '...' + token.slice(-4)
|
|
226
|
+
: '***';
|
|
227
|
+
console.log(` Token: ${masked}`);
|
|
228
|
+
|
|
229
|
+
// Fetch bot name
|
|
230
|
+
try {
|
|
231
|
+
const meRes = await fetch(`https://api.telegram.org/bot${token}/getMe`);
|
|
232
|
+
const meData = await meRes.json();
|
|
233
|
+
if (meData.ok) {
|
|
234
|
+
console.log(` Bot: @${meData.result.username} (${meData.result.first_name})`);
|
|
235
|
+
}
|
|
236
|
+
} catch {
|
|
237
|
+
// ignore fetch errors
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
console.log(' Token: not configured');
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (chatId) {
|
|
244
|
+
console.log(` Chat ID: ${chatId}`);
|
|
245
|
+
|
|
246
|
+
// Fetch chat name
|
|
247
|
+
if (token) {
|
|
248
|
+
try {
|
|
249
|
+
const chatRes = await fetch(`https://api.telegram.org/bot${token}/getChat?chat_id=${chatId}`);
|
|
250
|
+
const chatData = await chatRes.json();
|
|
251
|
+
if (chatData.ok) {
|
|
252
|
+
const c = chatData.result;
|
|
253
|
+
const name = c.title || c.first_name || c.username || '';
|
|
254
|
+
const type = c.type || '';
|
|
255
|
+
console.log(` Chat: ${name}${type ? ` (${type})` : ''}`);
|
|
256
|
+
}
|
|
257
|
+
} catch {
|
|
258
|
+
// ignore fetch errors
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
console.log(' Chat ID: not configured');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Listener config
|
|
266
|
+
if (config.listener) {
|
|
267
|
+
console.log(`\nListener config:\n${JSON.stringify({ listener: config.listener }, null, 2)}`);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Log file and recent lines
|
|
196
271
|
const logFile = getLogFile();
|
|
197
|
-
console.log(
|
|
198
|
-
Log: ${logFile}`);
|
|
272
|
+
console.log(`\nLog: ${logFile}`);
|
|
199
273
|
|
|
200
|
-
// Show last few log lines
|
|
201
274
|
try {
|
|
202
275
|
if (fs.existsSync(logFile)) {
|
|
203
276
|
const content = fs.readFileSync(logFile, 'utf-8');
|
package/commit-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
abbc3917465b38585bb933edc777768f40f4b107
|
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.61",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|