claude-notification-plugin 1.0.110 → 1.0.112
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 +8 -0
- package/commit-sha +1 -1
- package/listener/listener.js +4 -1
- package/listener/telegram-poller.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.112",
|
|
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
|
@@ -652,4 +652,12 @@ To disable per project, add to .claude/settings.local.json: { "env": { "CLAUDE_N
|
|
|
652
652
|
closeLog();
|
|
653
653
|
}
|
|
654
654
|
|
|
655
|
+
// Skip postinstall for local (non-global) npm installs
|
|
656
|
+
const isGlobal = process.env.npm_config_global === 'true'
|
|
657
|
+
|| process.env.npm_lifecycle_event !== 'postinstall';
|
|
658
|
+
if (process.env.npm_lifecycle_event === 'postinstall' && !isGlobal) {
|
|
659
|
+
console.log('claude-notification-plugin: skipping postinstall (local install detected)');
|
|
660
|
+
process.exit(0);
|
|
661
|
+
}
|
|
662
|
+
|
|
655
663
|
main().then(() => 0);
|
package/commit-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
f6763248ba170bad2656ef697ffc4710bbf6636c
|
package/listener/listener.js
CHANGED
|
@@ -12,6 +12,19 @@ export class TelegramPoller {
|
|
|
12
12
|
this.offset = 0;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
async flush () {
|
|
16
|
+
try {
|
|
17
|
+
const url = `${this.baseUrl}/getUpdates?offset=-1&timeout=0&allowed_updates=["message"]`;
|
|
18
|
+
const res = await fetch(url, { signal: AbortSignal.timeout(10000) });
|
|
19
|
+
const data = await res.json();
|
|
20
|
+
if (data.ok && data.result?.length) {
|
|
21
|
+
this.offset = data.result[data.result.length - 1].update_id + 1;
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
// ignore — first getUpdates will still work with offset=0
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
async getUpdates () {
|
|
16
29
|
try {
|
|
17
30
|
const url = `${this.baseUrl}/getUpdates?offset=${this.offset}&timeout=${POLL_TIMEOUT}&allowed_updates=["message"]`;
|
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.112",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|