@mohak34/opencode-notifier 0.1.10 → 0.1.11

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/README.md CHANGED
@@ -18,7 +18,7 @@ To pin a specific version:
18
18
 
19
19
  ```json
20
20
  {
21
- "plugin": ["@mohak34/opencode-notifier@0.1.8"]
21
+ "plugin": ["@mohak34/opencode-notifier@0.1.10"]
22
22
  }
23
23
  ```
24
24
 
@@ -46,13 +46,13 @@ Remove-Item -Recurse -Force "$env:USERPROFILE\.cache\opencode\node_modules\@moha
46
46
 
47
47
  Then restart OpenCode - it will download the latest version automatically.
48
48
 
49
- ### If you use a pinned version (e.g., `@0.1.7`)
49
+ ### If you use a pinned version (e.g., `@0.1.10`)
50
50
 
51
51
  1. Update the version in your `opencode.json`:
52
52
 
53
53
  ```json
54
54
  {
55
- "plugin": ["@mohak34/opencode-notifier@0.1.8"]
55
+ "plugin": ["@mohak34/opencode-notifier@0.1.10"]
56
56
  }
57
57
  ```
58
58
 
@@ -177,7 +177,7 @@ If a custom sound file path is provided but the file doesn't exist, the plugin w
177
177
 
178
178
  ### macOS: Notifications not showing (only sound works)
179
179
 
180
- **Update to v0.1.8 or later** - this version includes a fix for macOS notification events.
180
+ **Update to v0.1.10 or later** - this version includes a fix for macOS notification events.
181
181
 
182
182
  If notifications still don't work after updating:
183
183
 
package/dist/index.js CHANGED
@@ -3731,11 +3731,11 @@ import { readFileSync, existsSync } from "fs";
3731
3731
  import { join } from "path";
3732
3732
  import { homedir } from "os";
3733
3733
  var DEFAULT_EVENT_CONFIG = {
3734
- sound: false,
3734
+ sound: true,
3735
3735
  notification: true
3736
3736
  };
3737
3737
  var DEFAULT_CONFIG = {
3738
- sound: false,
3738
+ sound: true,
3739
3739
  notification: true,
3740
3740
  timeout: 5,
3741
3741
  events: {
@@ -3879,7 +3879,17 @@ var __dirname2 = dirname(fileURLToPath(import.meta.url));
3879
3879
  var DEBOUNCE_MS2 = 1000;
3880
3880
  var lastSoundTime = {};
3881
3881
  function getBundledSoundPath(event) {
3882
- return join2(__dirname2, "..", "sounds", `${event}.wav`);
3882
+ const soundFilename = `${event}.wav`;
3883
+ const possiblePaths = [
3884
+ join2(__dirname2, "..", "sounds", soundFilename),
3885
+ join2(__dirname2, "sounds", soundFilename)
3886
+ ];
3887
+ for (const path of possiblePaths) {
3888
+ if (existsSync2(path)) {
3889
+ return path;
3890
+ }
3891
+ }
3892
+ return join2(__dirname2, "..", "sounds", soundFilename);
3883
3893
  }
3884
3894
  function getSoundFilePath(event, customPath) {
3885
3895
  if (customPath && existsSync2(customPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohak34/opencode-notifier",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "OpenCode plugin that sends system notifications and plays sounds when permission is needed, generation completes, or errors occur",
5
5
  "author": "mohak34",
6
6
  "license": "MIT",