opencode-smart-voice-notify 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util/config.js +172 -35
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-smart-voice-notify",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Smart voice notification plugin for OpenCode with multiple TTS engines (ElevenLabs, Edge TTS, Windows SAPI) and intelligent reminder system",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/util/config.js CHANGED
@@ -24,77 +24,214 @@ const getPluginDir = () => {
24
24
  };
25
25
 
26
26
  /**
27
- * Generate a minimal default configuration file content.
28
- * This provides a working config with helpful comments pointing to the full example.
27
+ * Generate a comprehensive default configuration file content.
28
+ * This provides users with ALL available options fully documented.
29
29
  */
30
30
  const generateDefaultConfig = () => {
31
31
  return `{
32
32
  // ============================================================
33
33
  // OpenCode Smart Voice Notify - Configuration
34
34
  // ============================================================
35
- // This file was auto-generated with minimal defaults.
36
- // For ALL available options, see the full example config:
37
- // node_modules/opencode-smart-voice-notify/example.config.jsonc
38
- // Or visit: https://github.com/MasuRii/opencode-smart-voice-notify#configuration
35
+ //
36
+ // This file was auto-generated with all available options.
37
+ // Customize the settings below to your preference.
38
+ //
39
+ // Sound files have been automatically copied to:
40
+ // ~/.config/opencode/assets/
41
+ //
42
+ // Documentation: https://github.com/MasuRii/opencode-smart-voice-notify
43
+ //
39
44
  // ============================================================
40
45
 
41
- // NOTIFICATION MODE
42
- // 'sound-first' - Play sound immediately, TTS reminder after delay (RECOMMENDED)
43
- // 'tts-first' - Speak TTS immediately, no sound
44
- // 'both' - Play sound AND speak TTS immediately
45
- // 'sound-only' - Only play sound, no TTS at all
46
+ // ============================================================
47
+ // NOTIFICATION MODE SETTINGS (Smart Notification System)
48
+ // ============================================================
49
+ // Controls how notifications are delivered:
50
+ // 'sound-first' - Play sound immediately, TTS reminder after delay (RECOMMENDED)
51
+ // 'tts-first' - Speak TTS immediately, no sound
52
+ // 'both' - Play sound AND speak TTS immediately
53
+ // 'sound-only' - Only play sound, no TTS at all
46
54
  "notificationMode": "sound-first",
55
+
56
+ // ============================================================
57
+ // TTS REMINDER SETTINGS (When user doesn't respond to sound)
58
+ // ============================================================
59
+
60
+ // Enable TTS reminder if user doesn't respond after sound notification
61
+ "enableTTSReminder": true,
62
+
63
+ // Delay (in seconds) before TTS reminder fires
64
+ // Set globally or per-notification type
65
+ "ttsReminderDelaySeconds": 30, // Global default
66
+ "idleReminderDelaySeconds": 30, // For task completion notifications
67
+ "permissionReminderDelaySeconds": 20, // For permission requests (more urgent)
68
+
69
+ // Follow-up reminders if user STILL doesn't respond after first TTS
70
+ "enableFollowUpReminders": true,
71
+ "maxFollowUpReminders": 3, // Max number of follow-up TTS reminders
72
+ "reminderBackoffMultiplier": 1.5, // Each follow-up waits longer (30s, 45s, 67s...)
47
73
 
48
74
  // ============================================================
49
75
  // TTS ENGINE SELECTION
50
76
  // ============================================================
51
- // 'elevenlabs' - Best quality (requires API key, free tier: 10k chars/month)
52
- // 'edge' - Good quality (free, requires: pip install edge-tts)
53
- // 'sapi' - Windows built-in (free, offline, robotic)
77
+ // 'elevenlabs' - Best quality, anime-like voices (requires API key, free tier: 10k chars/month)
78
+ // 'edge' - Good quality neural voices (free, requires: pip install edge-tts)
79
+ // 'sapi' - Windows built-in voices (free, offline, robotic)
54
80
  "ttsEngine": "edge",
81
+
82
+ // Enable TTS for notifications (falls back to sound files if TTS fails)
55
83
  "enableTTS": true,
56
-
84
+
57
85
  // ============================================================
58
- // ELEVENLABS SETTINGS (Optional - for best quality)
86
+ // ELEVENLABS SETTINGS (Best Quality - Anime-like Voices)
59
87
  // ============================================================
60
- // Get your free API key from: https://elevenlabs.io/app/settings/api-keys
61
- // Uncomment and add your key to use ElevenLabs:
88
+ // Get your API key from: https://elevenlabs.io/app/settings/api-keys
89
+ // Free tier: 10,000 characters/month
90
+ //
91
+ // To use ElevenLabs:
92
+ // 1. Uncomment elevenLabsApiKey and add your key
93
+ // 2. Change ttsEngine above to "elevenlabs"
94
+ //
62
95
  // "elevenLabsApiKey": "YOUR_API_KEY_HERE",
63
- // "elevenLabsVoiceId": "cgSgspJ2msm6clMCkdW9",
64
-
96
+
97
+ // Voice ID - Recommended cute/anime-like voices:
98
+ // 'cgSgspJ2msm6clMCkdW9' - Jessica (Playful, Bright, Warm) - RECOMMENDED
99
+ // 'FGY2WhTYpPnrIDTdsKH5' - Laura (Enthusiast, Quirky)
100
+ // 'jsCqWAovK2LkecY7zXl4' - Freya (Expressive, Confident)
101
+ // 'EXAVITQu4vr4xnSDxMaL' - Sarah (Soft, Warm)
102
+ // Browse more at: https://elevenlabs.io/voice-library
103
+ "elevenLabsVoiceId": "cgSgspJ2msm6clMCkdW9",
104
+
105
+ // Model: 'eleven_turbo_v2_5' (fast, good), 'eleven_multilingual_v2' (highest quality)
106
+ "elevenLabsModel": "eleven_turbo_v2_5",
107
+
108
+ // Voice tuning (0.0 to 1.0)
109
+ "elevenLabsStability": 0.5, // Lower = more expressive, Higher = more consistent
110
+ "elevenLabsSimilarity": 0.75, // How closely to match the original voice
111
+ "elevenLabsStyle": 0.5, // Style exaggeration (higher = more expressive)
112
+
65
113
  // ============================================================
66
- // EDGE TTS SETTINGS (Default - Free Neural Voices)
114
+ // EDGE TTS SETTINGS (Free Neural Voices - Default Engine)
67
115
  // ============================================================
68
116
  // Requires: pip install edge-tts
117
+
118
+ // Voice options (run 'edge-tts --list-voices' to see all):
119
+ // 'en-US-AnaNeural' - Young, cute, cartoon-like (RECOMMENDED)
120
+ // 'en-US-JennyNeural' - Friendly, warm
121
+ // 'en-US-AriaNeural' - Confident, clear
122
+ // 'en-GB-SoniaNeural' - British, friendly
123
+ // 'en-AU-NatashaNeural' - Australian, warm
69
124
  "edgeVoice": "en-US-AnaNeural",
125
+
126
+ // Pitch adjustment: +0Hz to +100Hz (higher = more anime-like)
70
127
  "edgePitch": "+50Hz",
128
+
129
+ // Speech rate: -50% to +100%
71
130
  "edgeRate": "+10%",
72
-
131
+
73
132
  // ============================================================
74
- // TTS REMINDER SETTINGS
133
+ // SAPI SETTINGS (Windows Built-in - Last Resort Fallback)
75
134
  // ============================================================
76
- "enableTTSReminder": true,
77
- "ttsReminderDelaySeconds": 30,
78
- "permissionReminderDelaySeconds": 20,
79
- "enableFollowUpReminders": true,
80
- "maxFollowUpReminders": 3,
135
+
136
+ // Voice (run PowerShell to list all installed voices):
137
+ // Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() | % { $_.VoiceInfo.Name }
138
+ //
139
+ // Common Windows voices:
140
+ // 'Microsoft Zira Desktop' - Female, US English
141
+ // 'Microsoft David Desktop' - Male, US English
142
+ // 'Microsoft Hazel Desktop' - Female, UK English
143
+ "sapiVoice": "Microsoft Zira Desktop",
144
+
145
+ // Speech rate: -10 (slowest) to +10 (fastest), 0 is normal
146
+ "sapiRate": -1,
147
+
148
+ // Pitch: 'x-low', 'low', 'medium', 'high', 'x-high'
149
+ "sapiPitch": "medium",
150
+
151
+ // Volume: 'silent', 'x-soft', 'soft', 'medium', 'loud', 'x-loud'
152
+ "sapiVolume": "loud",
153
+
154
+ // ============================================================
155
+ // INITIAL TTS MESSAGES (Used immediately or after sound)
156
+ // These are randomly selected each time for variety
157
+ // ============================================================
158
+
159
+ // Messages when agent finishes work (task completion)
160
+ "idleTTSMessages": [
161
+ "All done! Your task has been completed successfully.",
162
+ "Hey there! I finished working on your request.",
163
+ "Task complete! Ready for your review whenever you are.",
164
+ "Good news! Everything is done and ready for you.",
165
+ "Finished! Let me know if you need anything else."
166
+ ],
167
+
168
+ // Messages for permission requests
169
+ "permissionTTSMessages": [
170
+ "Attention please! I need your permission to continue.",
171
+ "Hey! Quick approval needed to proceed with the task.",
172
+ "Heads up! There is a permission request waiting for you.",
173
+ "Excuse me! I need your authorization before I can continue.",
174
+ "Permission required! Please review and approve when ready."
175
+ ],
81
176
 
82
177
  // ============================================================
83
- // SOUND FILES (Relative to ~/.config/opencode/)
178
+ // TTS REMINDER MESSAGES (More urgent - used after delay if no response)
179
+ // These are more personalized and urgent to get user attention
180
+ // ============================================================
181
+
182
+ // Reminder messages when agent finished but user hasn't responded
183
+ "idleReminderTTSMessages": [
184
+ "Hey, are you still there? Your task has been waiting for review.",
185
+ "Just a gentle reminder - I finished your request a while ago!",
186
+ "Hello? I completed your task. Please take a look when you can.",
187
+ "Still waiting for you! The work is done and ready for review.",
188
+ "Knock knock! Your completed task is patiently waiting for you."
189
+ ],
190
+
191
+ // Reminder messages when permission still needed
192
+ "permissionReminderTTSMessages": [
193
+ "Hey! I still need your permission to continue. Please respond!",
194
+ "Reminder: There is a pending permission request. I cannot proceed without you.",
195
+ "Hello? I am waiting for your approval. This is getting urgent!",
196
+ "Please check your screen! I really need your permission to move forward.",
197
+ "Still waiting for authorization! The task is on hold until you respond."
198
+ ],
199
+
200
+ // ============================================================
201
+ // SOUND FILES (For immediate notifications)
202
+ // These are played first before TTS reminder kicks in
84
203
  // ============================================================
85
- // NOTE: You need to copy the sound files to your config directory!
86
- // Copy from: node_modules/opencode-smart-voice-notify/assets/
87
- // To: ~/.config/opencode/assets/
204
+ // Paths are relative to ~/.config/opencode/ directory
205
+ // Sound files are automatically copied here on first run
206
+ // You can replace with your own custom MP3/WAV files
207
+
88
208
  "idleSound": "assets/Soft-high-tech-notification-sound-effect.mp3",
89
209
  "permissionSound": "assets/Machine-alert-beep-sound-effect.mp3",
90
-
210
+
91
211
  // ============================================================
92
212
  // GENERAL SETTINGS
93
213
  // ============================================================
94
- "enableSound": true,
95
- "enableToast": true,
214
+
215
+ // Wake monitor from sleep when notifying (Windows/macOS)
96
216
  "wakeMonitor": true,
217
+
218
+ // Force system volume up if below threshold
97
219
  "forceVolume": true,
220
+
221
+ // Volume threshold (0-100): force volume if current level is below this
222
+ "volumeThreshold": 50,
223
+
224
+ // Show TUI toast notifications in OpenCode terminal
225
+ "enableToast": true,
226
+
227
+ // Enable audio notifications (sound files and TTS)
228
+ "enableSound": true,
229
+
230
+ // Consider monitor asleep after this many seconds of inactivity (Windows only)
231
+ "idleThresholdSeconds": 60,
232
+
233
+ // Enable debug logging to ~/.config/opencode/smart-voice-notify-debug.log
234
+ // Useful for troubleshooting notification issues
98
235
  "debugLog": false
99
236
  }
100
237
  `;