opencode-plugin-boops 2.0.0 → 2.0.2

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
@@ -64,30 +64,27 @@ Sounds are downloaded once on first use and cached in `~/.cache/opencode/boops/`
64
64
 
65
65
  ## Configuration
66
66
 
67
- The plugin uses a TOML configuration file located at `~/.config/opencode/boops.toml`.
67
+ The plugin automatically creates a configuration file at `~/.config/opencode/plugins/boops/boops.toml` on first install.
68
68
 
69
- ### Create your config
69
+ ### Customize your config
70
70
 
71
- Copy the default configuration:
71
+ The config is automatically created from `boops.default.toml` when you install the plugin. Edit it to customize your sounds:
72
72
 
73
73
  ```bash
74
- # Get the default config template
75
- curl -o ~/.config/opencode/boops.toml https://raw.githubusercontent.com/towc/opencode-plugin-boops/main/boops.default.toml
74
+ # Edit your config
75
+ $EDITOR ~/.config/opencode/plugins/boops/boops.toml
76
76
  ```
77
77
 
78
- Or create it manually:
78
+ Example configuration:
79
79
 
80
80
  ```toml
81
- # ~/.config/opencode/boops.toml
81
+ # ~/.config/opencode/plugins/boops/boops.toml
82
82
 
83
83
  [sounds]
84
- # Simple: Use notificationsounds.com IDs (recommended)
85
- "session.idle" = "1150-pristine"
86
- "permission.asked" = "1217-relax"
87
- "session.error" = "1219-magic"
88
-
89
- # Or search by name (finds first match):
90
- # "session.idle" = "pristine"
84
+ # Use sound names from sounds.json (recommended)
85
+ "session.idle" = "pristine"
86
+ "permission.asked" = "relax"
87
+ "session.error" = "magic"
91
88
 
92
89
  # Or use full URLs:
93
90
  # "session.idle" = "https://example.com/sound.ogg"
@@ -100,13 +97,14 @@ Or create it manually:
100
97
 
101
98
  The plugin supports multiple ways to specify sounds:
102
99
 
103
- **1. notificationsounds.com IDs (easiest):**
100
+ **1. Sound names from sounds.json (easiest):**
104
101
  ```toml
105
- "session.idle" = "1150-pristine" # Direct ID (fast)
106
- "session.idle" = "pristine" # Search by name (slower, first match)
102
+ "session.idle" = "pristine"
103
+ "permission.asked" = "relax"
104
+ "session.error" = "magic"
107
105
  ```
108
106
 
109
- Browse sounds at [notificationsounds.com](https://notificationsounds.com/notification-sounds) to find IDs.
107
+ Use the TUI browser (`~/.config/opencode/plugins/boops/browse`) to explore all 448 sounds with semantic tags!
110
108
 
111
109
  **2. Full URLs:**
112
110
  ```toml
@@ -177,7 +175,7 @@ For advanced use cases, you can add filters to play sounds only when certain con
177
175
 
178
176
  ```toml
179
177
  [sounds.session.idle]
180
- sound = "https://notificationsounds.com/storage/sounds/file-sounds-1150-pristine.ogg"
178
+ sound = "pristine"
181
179
  not_if = { agent = "explore" } # Skip subagent completions
182
180
  ```
183
181
 
@@ -208,8 +206,9 @@ You can test sounds without restarting OpenCode using the custom tool:
208
206
  test-sound session.idle
209
207
 
210
208
  # Test a sound ID directly
209
+ # Test by sound name
211
210
  test-sound pristine
212
- test-sound 1150-pristine
211
+ test-sound "access granted computer voice"
213
212
 
214
213
  # Test a URL directly
215
214
  test-sound https://example.com/sound.ogg
@@ -4,20 +4,19 @@
4
4
  # player = "paplay" # Auto-detected if not set (paplay/aplay/afplay)
5
5
 
6
6
  [sounds]
7
- "session.idle" = "1150-pristine" # AI completes response
8
- "permission.asked" = "1217-relax" # AI needs permission
9
- "session.error" = "1219-magic" # Error occurs
7
+ "session.idle" = "pristine" # AI completes response
8
+ "permission.asked" = "relax" # AI needs permission
9
+ "session.error" = "magic" # Error occurs
10
10
 
11
11
  # You can use:
12
- # - Sound IDs: "pristine" (searches notificationsounds.com)
13
- # - Numeric IDs: "1150-pristine" (direct match, faster)
12
+ # - Sound names: "pristine" (searches sounds.json by name)
14
13
  # - Full URLs: "https://example.com/sound.ogg"
15
14
  # - Local paths: "/usr/share/sounds/..."
16
15
 
17
16
  # Advanced: Event filters (play sound only when conditions match)
18
17
  # Uncomment and adjust after checking logs to see available properties
19
18
  # [sounds.session.idle]
20
- # sound = "1150-pristine"
19
+ # sound = "pristine"
21
20
  # not_if = { agent = "explore" } # Don't play for subagent completions
22
21
 
23
22
  # Optional events (uncomment to enable):
package/cli/browse CHANGED
@@ -58,7 +58,7 @@ const PLUGIN_INSTALLED = isPluginInstalled();
58
58
 
59
59
  // Load current boops.toml config
60
60
  function loadCurrentConfig() {
61
- const configPath = join(homedir(), ".config", "opencode", "boops.toml");
61
+ const configPath = join(homedir(), ".config", "opencode", "plugins", "boops", "boops.toml");
62
62
  if (!existsSync(configPath)) {
63
63
  return {};
64
64
  }
@@ -105,7 +105,7 @@ function saveConfig(config) {
105
105
  return false;
106
106
  }
107
107
 
108
- const configPath = join(homedir(), ".config", "opencode", "boops.toml");
108
+ const configPath = join(homedir(), ".config", "opencode", "plugins", "boops", "boops.toml");
109
109
  let content = "# OpenCode Boops Plugin Configuration\n\n[sounds]\n";
110
110
 
111
111
  if (config.sounds) {
package/index.ts CHANGED
@@ -62,7 +62,7 @@ export const BoopsPlugin: Plugin = async ({ client }) => {
62
62
  // Directory might already exist
63
63
  }
64
64
 
65
- const configPath = join(homedir(), ".config", "opencode", "boops.toml")
65
+ const configPath = join(homedir(), ".config", "opencode", "plugins", "boops", "boops.toml")
66
66
 
67
67
  // Load configuration (can be called multiple times to reload)
68
68
  const loadConfig = async (): Promise<BoopsConfig> => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-plugin-boops",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Sound notifications for OpenCode - plays pleasant sounds when tasks complete or input is needed",
5
5
  "main": "index.ts",
6
6
  "type": "module",
@@ -33,7 +33,7 @@
33
33
  "smol-toml": "^1.3.1"
34
34
  },
35
35
  "scripts": {
36
- "postinstall": "node -e \"const fs=require('fs'),p=require('path'),h=require('os').homedir(),d=p.join(h,'.config','opencode','plugins','boops');fs.mkdirSync(d,{recursive:true});fs.copyFileSync(p.join(__dirname,'cli','browse'),p.join(d,'browse'));fs.copyFileSync(p.join(__dirname,'sounds.json'),p.join(d,'sounds.json'));fs.chmodSync(p.join(d,'browse'),0o755);console.log('✓ Installed browse CLI to ~/.config/opencode/plugins/boops/browse')\""
36
+ "postinstall": "node -e \"const fs=require('fs'),p=require('path'),h=require('os').homedir(),d=p.join(h,'.config','opencode','plugins','boops');fs.mkdirSync(d,{recursive:true});const cfg=p.join(d,'boops.toml');if(!fs.existsSync(cfg))fs.copyFileSync(p.join(__dirname,'boops.default.toml'),cfg);fs.copyFileSync(p.join(__dirname,'cli','browse'),p.join(d,'browse'));fs.copyFileSync(p.join(__dirname,'sounds.json'),p.join(d,'sounds.json'));fs.chmodSync(p.join(d,'browse'),0o755);console.log('✓ Installed to ~/.config/opencode/plugins/boops/')\""
37
37
  },
38
38
  "files": [
39
39
  "index.ts",