claude-notification-plugin 1.1.75 → 1.1.76

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.1.75",
3
+ "version": "1.1.76",
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/commit-sha CHANGED
@@ -1 +1 @@
1
- 09e7c656d459f08696ec5408b01cb3ca67045d52
1
+ 8d2fc918805c6a42eb0158fbc60e35c34761ed82
@@ -26,6 +26,28 @@ function debugLog (config, ...args) {
26
26
  }
27
27
  }
28
28
 
29
+ function normalizePath (p) {
30
+ return path.resolve(p).replace(/\\/g, '/').toLowerCase();
31
+ }
32
+
33
+ function resolveProjectName (cwd, config) {
34
+ const fallback = path.basename(cwd);
35
+ const projects = config?.listenerProjects;
36
+ if (!projects || typeof projects !== 'object') {
37
+ return fallback;
38
+ }
39
+ const normalizedCwd = normalizePath(cwd);
40
+ for (const entry of Object.values(projects)) {
41
+ if (!entry?.path) {
42
+ continue;
43
+ }
44
+ if (normalizedCwd === normalizePath(entry.path) && entry.name) {
45
+ return entry.name;
46
+ }
47
+ }
48
+ return fallback;
49
+ }
50
+
29
51
  function getBranch (cwd) {
30
52
  try {
31
53
  return execSync('git rev-parse --abbrev-ref HEAD', {
@@ -98,6 +120,9 @@ function loadConfig () {
98
120
  if (typeof user.webhookUrl === 'string') {
99
121
  config.webhookUrl = user.webhookUrl;
100
122
  }
123
+ if (user.listener?.projects) {
124
+ config.listenerProjects = user.listener.projects;
125
+ }
101
126
  } catch {
102
127
  // ignore malformed config
103
128
  }
@@ -720,7 +745,7 @@ process.stdin.on('end', async () => {
720
745
 
721
746
  const eventType = event.hook_event_name || 'unknown';
722
747
  const cwd = event.cwd || process.cwd();
723
- const project = path.basename(cwd);
748
+ const project = resolveProjectName(cwd, config);
724
749
  const sessionId = event.session_id || 'default';
725
750
 
726
751
  const disabled = isNotifierDisabled();
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.75",
4
+ "version": "1.1.76",
5
5
  "description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
6
6
  "type": "module",
7
7
  "engines": {