claude-notification-plugin 1.0.109 → 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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-notification-plugin",
3
- "version": "1.0.109",
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
@@ -181,13 +181,18 @@ function copyToCache (version) {
181
181
  }
182
182
 
183
183
  try {
184
- execSync('npm install --production --ignore-scripts', {
184
+ const env = { ...process.env };
185
+ delete env.npm_config_global;
186
+ delete env.npm_config_prefix;
187
+ execSync('npm install --omit=dev --ignore-scripts', {
185
188
  cwd: dest,
186
189
  stdio: 'pipe',
187
190
  windowsHide: true,
191
+ env,
188
192
  });
189
- } catch {
193
+ } catch (err) {
190
194
  console.warn(' Warning: could not install dependencies in plugin cache.');
195
+ console.warn(' Reason:', err.stderr?.toString?.() || err.message);
191
196
  }
192
197
 
193
198
  return dest;
@@ -514,7 +519,7 @@ Send any message to your bot in Telegram, then press Enter.\x1b[0m`);
514
519
  } else {
515
520
  const telegramMsg = token && chatId
516
521
  ? 'Telegram: using existing config.'
517
- : 'Telegram: skipped. Run "claude-notify install" to configure.';
522
+ : 'Interactive setup skipped. Run "claude-notify install" to configure.';
518
523
  console.log(`\nNon-interactive install (stdin is not a terminal).\n${telegramMsg}`);
519
524
  }
520
525
 
@@ -647,4 +652,12 @@ To disable per project, add to .claude/settings.local.json: { "env": { "CLAUDE_N
647
652
  closeLog();
648
653
  }
649
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
+
650
663
  main().then(() => 0);
package/commit-sha CHANGED
@@ -1 +1 @@
1
- a1937f5758650c5b8a75b15a85b30e56bf35c15c
1
+ f6763248ba170bad2656ef697ffc4710bbf6636c
@@ -655,4 +655,7 @@ async function mainLoop () {
655
655
  }
656
656
  }
657
657
 
658
- mainLoop();
658
+ (async () => {
659
+ await poller.flush();
660
+ await mainLoop();
661
+ })();
@@ -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.109",
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": {