opencode-smart-voice-notify 1.0.1 → 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.
- package/example.config.jsonc +58 -12
- package/package.json +1 -1
- package/util/config.js +172 -35
- package/util/tts.js +2 -2
package/example.config.jsonc
CHANGED
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
+
// ============================================================
|
|
3
|
+
// OpenCode Smart Voice Notify - Full Configuration Reference
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// IMPORTANT: This is a REFERENCE file showing ALL available options.
|
|
7
|
+
//
|
|
8
|
+
// To use this plugin:
|
|
9
|
+
// 1. Copy this file to: ~/.config/opencode/smart-voice-notify.jsonc
|
|
10
|
+
// (On Windows: C:\Users\<YourUser>\.config\opencode\smart-voice-notify.jsonc)
|
|
11
|
+
// 2. Customize the settings below to your preference
|
|
12
|
+
// 3. The plugin auto-creates a minimal config if none exists
|
|
13
|
+
//
|
|
14
|
+
// Sound files are automatically copied to ~/.config/opencode/assets/
|
|
15
|
+
// on first run. You can also use your own custom sound files.
|
|
16
|
+
//
|
|
17
|
+
// ============================================================
|
|
18
|
+
|
|
2
19
|
// ============================================================
|
|
3
20
|
// NOTIFICATION MODE SETTINGS (Smart Notification System)
|
|
4
21
|
// ============================================================
|
|
@@ -67,9 +84,11 @@
|
|
|
67
84
|
// Requires: pip install edge-tts
|
|
68
85
|
|
|
69
86
|
// Voice options (run 'edge-tts --list-voices' to see all):
|
|
70
|
-
// 'en-US-AnaNeural' - Young, cute, cartoon-like
|
|
87
|
+
// 'en-US-AnaNeural' - Young, cute, cartoon-like (RECOMMENDED)
|
|
71
88
|
// 'en-US-JennyNeural' - Friendly, warm
|
|
72
89
|
// 'en-US-AriaNeural' - Confident, clear
|
|
90
|
+
// 'en-GB-SoniaNeural' - British, friendly
|
|
91
|
+
// 'en-AU-NatashaNeural' - Australian, warm
|
|
73
92
|
"edgeVoice": "en-US-AnaNeural",
|
|
74
93
|
|
|
75
94
|
// Pitch adjustment: +0Hz to +100Hz (higher = more anime-like)
|
|
@@ -82,19 +101,30 @@
|
|
|
82
101
|
// SAPI SETTINGS (Windows Built-in - Last Resort Fallback)
|
|
83
102
|
// ============================================================
|
|
84
103
|
|
|
85
|
-
// Voice (run PowerShell to list all):
|
|
104
|
+
// Voice (run PowerShell to list all installed voices):
|
|
86
105
|
// Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() | % { $_.VoiceInfo.Name }
|
|
106
|
+
//
|
|
107
|
+
// Common Windows voices:
|
|
108
|
+
// 'Microsoft Zira Desktop' - Female, US English
|
|
109
|
+
// 'Microsoft David Desktop' - Male, US English
|
|
110
|
+
// 'Microsoft Hazel Desktop' - Female, UK English
|
|
87
111
|
"sapiVoice": "Microsoft Zira Desktop",
|
|
112
|
+
|
|
113
|
+
// Speech rate: -10 (slowest) to +10 (fastest), 0 is normal
|
|
88
114
|
"sapiRate": -1,
|
|
115
|
+
|
|
116
|
+
// Pitch: 'x-low', 'low', 'medium', 'high', 'x-high'
|
|
89
117
|
"sapiPitch": "medium",
|
|
118
|
+
|
|
119
|
+
// Volume: 'silent', 'x-soft', 'soft', 'medium', 'loud', 'x-loud'
|
|
90
120
|
"sapiVolume": "loud",
|
|
91
121
|
|
|
92
122
|
// ============================================================
|
|
93
123
|
// INITIAL TTS MESSAGES (Used immediately or after sound)
|
|
94
|
-
// These are randomly selected each time
|
|
124
|
+
// These are randomly selected each time for variety
|
|
95
125
|
// ============================================================
|
|
96
126
|
|
|
97
|
-
// Messages when agent finishes work
|
|
127
|
+
// Messages when agent finishes work (task completion)
|
|
98
128
|
"idleTTSMessages": [
|
|
99
129
|
"All done! Your task has been completed successfully.",
|
|
100
130
|
"Hey there! I finished working on your request.",
|
|
@@ -138,8 +168,10 @@
|
|
|
138
168
|
// ============================================================
|
|
139
169
|
// SOUND FILES (For immediate notifications)
|
|
140
170
|
// These are played first before TTS reminder kicks in
|
|
141
|
-
// Paths are relative to OpenCode config directory (~/.config/opencode/)
|
|
142
171
|
// ============================================================
|
|
172
|
+
// Paths are relative to ~/.config/opencode/ directory
|
|
173
|
+
// The plugin automatically copies bundled sounds to assets/ on first run
|
|
174
|
+
// You can replace with your own custom MP3/WAV files
|
|
143
175
|
|
|
144
176
|
"idleSound": "assets/Soft-high-tech-notification-sound-effect.mp3",
|
|
145
177
|
"permissionSound": "assets/Machine-alert-beep-sound-effect.mp3",
|
|
@@ -148,11 +180,25 @@
|
|
|
148
180
|
// GENERAL SETTINGS
|
|
149
181
|
// ============================================================
|
|
150
182
|
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
"
|
|
156
|
-
|
|
157
|
-
|
|
183
|
+
// Wake monitor from sleep when notifying (Windows/macOS)
|
|
184
|
+
"wakeMonitor": true,
|
|
185
|
+
|
|
186
|
+
// Force system volume up if below threshold
|
|
187
|
+
"forceVolume": true,
|
|
188
|
+
|
|
189
|
+
// Volume threshold (0-100): force volume if current level is below this
|
|
190
|
+
"volumeThreshold": 50,
|
|
191
|
+
|
|
192
|
+
// Show TUI toast notifications in OpenCode terminal
|
|
193
|
+
"enableToast": true,
|
|
194
|
+
|
|
195
|
+
// Enable audio notifications (sound files and TTS)
|
|
196
|
+
"enableSound": true,
|
|
197
|
+
|
|
198
|
+
// Consider monitor asleep after this many seconds of inactivity (Windows only)
|
|
199
|
+
"idleThresholdSeconds": 60,
|
|
200
|
+
|
|
201
|
+
// Enable debug logging to ~/.config/opencode/smart-voice-notify-debug.log
|
|
202
|
+
// Useful for troubleshooting notification issues
|
|
203
|
+
"debugLog": false
|
|
158
204
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-smart-voice-notify",
|
|
3
|
-
"version": "1.0.
|
|
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
|
|
28
|
-
* This provides
|
|
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
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
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
|
-
//
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
//
|
|
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 (
|
|
86
|
+
// ELEVENLABS SETTINGS (Best Quality - Anime-like Voices)
|
|
59
87
|
// ============================================================
|
|
60
|
-
// Get your
|
|
61
|
-
//
|
|
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
|
-
|
|
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 (
|
|
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
|
-
//
|
|
133
|
+
// SAPI SETTINGS (Windows Built-in - Last Resort Fallback)
|
|
75
134
|
// ============================================================
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
86
|
-
//
|
|
87
|
-
//
|
|
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
|
-
|
|
95
|
-
|
|
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
|
`;
|
package/util/tts.js
CHANGED
|
@@ -94,8 +94,8 @@ export const getTTSConfig = () => {
|
|
|
94
94
|
// ============================================================
|
|
95
95
|
// SOUND FILES (Used for immediate notifications)
|
|
96
96
|
// ============================================================
|
|
97
|
-
idleSound: '
|
|
98
|
-
permissionSound: '
|
|
97
|
+
idleSound: 'assets/Soft-high-tech-notification-sound-effect.mp3',
|
|
98
|
+
permissionSound: 'assets/Machine-alert-beep-sound-effect.mp3',
|
|
99
99
|
|
|
100
100
|
// ============================================================
|
|
101
101
|
// GENERAL SETTINGS
|