@mohak34/opencode-notifier 0.1.6 → 0.1.8
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 +12 -1
- package/dist/index.js +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,12 +8,23 @@ Add the plugin to your `opencode.json` or `opencode.jsonc`:
|
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
11
|
-
"plugin": ["@mohak34/opencode-notifier"]
|
|
11
|
+
"plugin": ["@mohak34/opencode-notifier@latest"]
|
|
12
12
|
}
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Restart OpenCode. The plugin will be automatically installed and loaded.
|
|
16
16
|
|
|
17
|
+
## Updating
|
|
18
|
+
|
|
19
|
+
OpenCode caches plugins in `~/.cache/opencode`. To update to the latest version:
|
|
20
|
+
|
|
21
|
+
1. **Clear the plugin from cache:**
|
|
22
|
+
```rm -rf ~/.cache/opencode/node_modules/@mohak34/opencode-notifier```
|
|
23
|
+
2. Restart OpenCode - it will download the latest version.
|
|
24
|
+
|
|
25
|
+
To check your installed version:
|
|
26
|
+
```cat ~/.cache/opencode/node_modules/@mohak34/opencode-notifier/package.json | grep version```
|
|
27
|
+
|
|
17
28
|
## Platform Notes
|
|
18
29
|
|
|
19
30
|
The plugin works out of the box on all platforms. For best results:
|
package/dist/index.js
CHANGED
|
@@ -3925,7 +3925,7 @@ async function playOnMac(soundPath) {
|
|
|
3925
3925
|
await runCommand("afplay", [soundPath]);
|
|
3926
3926
|
}
|
|
3927
3927
|
async function playOnWindows(soundPath) {
|
|
3928
|
-
const script =
|
|
3928
|
+
const script = `& { (New-Object Media.SoundPlayer $args[0]).PlaySync() }`;
|
|
3929
3929
|
await runCommand("powershell", ["-c", script, soundPath]);
|
|
3930
3930
|
}
|
|
3931
3931
|
async function playSound(event, customPath) {
|
|
@@ -3976,6 +3976,9 @@ var NotifierPlugin = async () => {
|
|
|
3976
3976
|
if (event.type === "permission.updated") {
|
|
3977
3977
|
await handleEvent(config, "permission");
|
|
3978
3978
|
}
|
|
3979
|
+
if (event.type === "permission.asked") {
|
|
3980
|
+
await handleEvent(config, "permission");
|
|
3981
|
+
}
|
|
3979
3982
|
if (event.type === "session.idle") {
|
|
3980
3983
|
await handleEvent(config, "complete");
|
|
3981
3984
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohak34/opencode-notifier",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node-notifier": "^10.0.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@opencode-ai/plugin": "^1.0.
|
|
38
|
+
"@opencode-ai/plugin": "^1.0.224",
|
|
39
39
|
"@types/node": "^22.0.0",
|
|
40
40
|
"@types/node-notifier": "^8.0.5",
|
|
41
41
|
"typescript": "^5.0.0"
|