opencode-smart-voice-notify 1.2.5 → 1.3.0

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.
@@ -16,6 +16,9 @@
16
16
  //
17
17
  // ============================================================
18
18
 
19
+ // Internal version tracking - DO NOT REMOVE
20
+ "_configVersion": "1.2.5",
21
+
19
22
  // ============================================================
20
23
  // PLUGIN ENABLE/DISABLE
21
24
  // ============================================================
@@ -23,6 +26,25 @@
23
26
  // Set to false to disable all notifications without uninstalling.
24
27
  "enabled": true,
25
28
 
29
+ // ============================================================
30
+ // GRANULAR NOTIFICATION CONTROL
31
+ // ============================================================
32
+ // Enable or disable notifications for specific event types.
33
+ // If disabled, no sound, TTS, desktop, or webhook notifications
34
+ // will be sent for that specific category.
35
+ "enableIdleNotification": true, // Agent finished work
36
+ "enablePermissionNotification": true, // Agent needs permission
37
+ "enableQuestionNotification": true, // Agent asks a question
38
+ "enableErrorNotification": false, // Agent encountered an error
39
+
40
+ // Enable or disable reminders for specific event types.
41
+ // If disabled, the initial notification will still fire, but no
42
+ // follow-up TTS reminders will be scheduled.
43
+ "enableIdleReminder": true,
44
+ "enablePermissionReminder": true,
45
+ "enableQuestionReminder": true,
46
+ "enableErrorReminder": false,
47
+
26
48
  // ============================================================
27
49
  // NOTIFICATION MODE SETTINGS (Smart Notification System)
28
50
  // ============================================================
@@ -51,23 +73,13 @@
51
73
  "maxFollowUpReminders": 3, // Max number of follow-up TTS reminders
52
74
  "reminderBackoffMultiplier": 1.5, // Each follow-up waits longer (30s, 45s, 67s...)
53
75
 
54
- // ============================================================
55
- // PERMISSION BATCHING (Multiple permissions at once)
56
- // ============================================================
57
- // When multiple permissions arrive simultaneously (e.g., 5 at once),
58
- // batch them into a single notification instead of playing 5 overlapping sounds.
59
- // The notification will say "X permission requests require your attention".
60
-
61
- // Batch window (ms) - how long to wait for more permissions before notifying
62
- "permissionBatchWindowMs": 800,
63
-
64
76
  // ============================================================
65
77
  // TTS ENGINE SELECTION
66
78
  // ============================================================
67
- // 'openai' - OpenAI-compatible TTS (Self-hosted/Cloud, e.g. Kokoro, LocalAI)
68
- // 'elevenlabs' - Best quality, anime-like voices (requires API key, free tier: 10k chars/month)
69
- // 'edge' - Good quality neural voices (Free, Native Node.js implementation)
70
- // 'sapi' - Windows built-in voices (free, offline, robotic)
79
+ // 'openai' - OpenAI-compatible TTS (Self-hosted/Cloud, e.g. Kokoro, LocalAI)
80
+ // 'elevenlabs' - Best quality, anime-like voices (requires API key, free tier: 10k chars/month)
81
+ // 'edge' - Good quality neural voices (Free, Native Node.js implementation)
82
+ // 'sapi' - Windows built-in voices (free, offline, robotic)
71
83
  "ttsEngine": "elevenlabs",
72
84
 
73
85
  // Enable TTS for notifications (falls back to sound files if TTS fails)
@@ -121,11 +133,6 @@
121
133
 
122
134
  // Voice (run PowerShell to list all installed voices):
123
135
  // Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() | % { $_.VoiceInfo.Name }
124
- //
125
- // Common Windows voices:
126
- // 'Microsoft Zira Desktop' - Female, US English
127
- // 'Microsoft David Desktop' - Male, US English
128
- // 'Microsoft Hazel Desktop' - Female, UK English
129
136
  "sapiVoice": "Microsoft Zira Desktop",
130
137
 
131
138
  // Speech rate: -10 (slowest) to +10 (fastest), 0 is normal
@@ -137,43 +144,35 @@
137
144
  // Volume: 'silent', 'x-soft', 'soft', 'medium', 'loud', 'x-loud'
138
145
  "sapiVolume": "loud",
139
146
 
140
- // ============================================================
141
- // OPENAI-COMPATIBLE TTS SETTINGS (Kokoro, LocalAI, OpenAI, etc.)
142
- // ============================================================
143
- // Any OpenAI-compatible /v1/audio/speech endpoint.
144
- // Examples: Kokoro, OpenAI, LocalAI, Coqui, AllTalk, etc.
145
- //
146
- // To use OpenAI-compatible TTS:
147
- // 1. Set ttsEngine above to "openai"
148
- // 2. Set openaiTtsEndpoint to your server URL (without /v1/audio/speech)
149
- // 3. Configure voice and model for your server
150
-
151
- // Base URL for your TTS server (e.g., "http://192.168.86.43:8880")
152
- "openaiTtsEndpoint": "",
153
-
154
- // API key (leave empty if your server doesn't require auth)
155
- "openaiTtsApiKey": "",
156
-
157
- // Model name (server-dependent, e.g., "tts-1", "kokoro", "xtts")
158
- "openaiTtsModel": "tts-1",
159
-
160
- // Voice name (server-dependent)
161
- // Kokoro voices: "af_heart", "af_bella", "am_adam", etc.
162
- // OpenAI voices: "alloy", "echo", "fable", "onyx", "nova", "shimmer"
163
- "openaiTtsVoice": "alloy",
164
-
165
- // Audio format: "mp3", "opus", "aac", "flac", "wav", "pcm"
166
- "openaiTtsFormat": "mp3",
167
-
168
- // Speech speed: 0.25 to 4.0 (1.0 = normal)
169
- "openaiTtsSpeed": 1.0,
170
-
171
- // ============================================================
172
- // INITIAL TTS MESSAGES (Used immediately or after sound)
173
- // These are randomly selected each time for variety
174
147
  // ============================================================
148
+ // OPENAI-COMPATIBLE TTS SETTINGS (Kokoro, LocalAI, OpenAI, etc.)
149
+ // ============================================================
150
+ // Any OpenAI-compatible /v1/audio/speech endpoint.
151
+ // Examples: Kokoro, OpenAI, LocalAI, Coqui, AllTalk, etc.
152
+
153
+ // Base URL for your TTS server (e.g., "http://192.168.86.43:8880")
154
+ "openaiTtsEndpoint": "",
155
+
156
+ // API key (leave empty if your server doesn't require auth)
157
+ "openaiTtsApiKey": "",
158
+
159
+ // Model name (server-dependent, e.g., "tts-1", "kokoro", "xtts")
160
+ "openaiTtsModel": "tts-1",
161
+
162
+ // Voice name (server-dependent)
163
+ // Kokoro voices: "af_heart", "af_bella", "am_adam", etc.
164
+ // OpenAI voices: "alloy", "echo", "fable", "onyx", "nova", "shimmer"
165
+ "openaiTtsVoice": "alloy",
175
166
 
176
- // Messages when agent finishes work (task completion)
167
+ // Audio format: "mp3", "opus", "aac", "flac", "wav", "pcm"
168
+ "openaiTtsFormat": "mp3",
169
+
170
+ // Speech speed: 0.25 to 4.0 (1.0 = normal)
171
+ "openaiTtsSpeed": 1.0,
172
+
173
+ // ============================================================
174
+ // INITIAL TTS MESSAGES (Used immediately or after sound)
175
+ // ============================================================
177
176
  "idleTTSMessages": [
178
177
  "All done! Your task has been completed successfully.",
179
178
  "Hey there! I finished working on your request.",
@@ -181,8 +180,6 @@
181
180
  "Good news! Everything is done and ready for you.",
182
181
  "Finished! Let me know if you need anything else."
183
182
  ],
184
-
185
- // Messages for permission requests
186
183
  "permissionTTSMessages": [
187
184
  "Attention please! I need your permission to continue.",
188
185
  "Hey! Quick approval needed to proceed with the task.",
@@ -190,9 +187,6 @@
190
187
  "Excuse me! I need your authorization before I can continue.",
191
188
  "Permission required! Please review and approve when ready."
192
189
  ],
193
-
194
- // Messages for MULTIPLE permission requests (use {count} placeholder)
195
- // Used when several permissions arrive simultaneously
196
190
  "permissionTTSMessagesMultiple": [
197
191
  "Attention please! There are {count} permission requests waiting for your approval.",
198
192
  "Hey! {count} permissions need your approval to continue.",
@@ -202,11 +196,8 @@
202
196
  ],
203
197
 
204
198
  // ============================================================
205
- // TTS REMINDER MESSAGES (More urgent - used after delay if no response)
206
- // These are more personalized and urgent to get user attention
199
+ // TTS REMINDER MESSAGES (More urgent)
207
200
  // ============================================================
208
-
209
- // Reminder messages when agent finished but user hasn't responded
210
201
  "idleReminderTTSMessages": [
211
202
  "Hey, are you still there? Your task has been waiting for review.",
212
203
  "Just a gentle reminder - I finished your request a while ago!",
@@ -214,8 +205,6 @@
214
205
  "Still waiting for you! The work is done and ready for review.",
215
206
  "Knock knock! Your completed task is patiently waiting for you."
216
207
  ],
217
-
218
- // Reminder messages when permission still needed
219
208
  "permissionReminderTTSMessages": [
220
209
  "Hey! I still need your permission to continue. Please respond!",
221
210
  "Reminder: There is a pending permission request. I cannot proceed without you.",
@@ -223,8 +212,6 @@
223
212
  "Please check your screen! I really need your permission to move forward.",
224
213
  "Still waiting for authorization! The task is on hold until you respond."
225
214
  ],
226
-
227
- // Reminder messages for MULTIPLE permissions (use {count} placeholder)
228
215
  "permissionReminderTTSMessagesMultiple": [
229
216
  "Hey! I still need your approval for {count} permissions. Please respond!",
230
217
  "Reminder: There are {count} pending permission requests. I cannot proceed without you.",
@@ -232,15 +219,15 @@
232
219
  "Please check your screen! {count} permissions are waiting for your response.",
233
220
  "Still waiting for authorization on {count} requests! The task is on hold."
234
221
  ],
235
-
222
+
236
223
  // ============================================================
237
- // QUESTION TOOL MESSAGES (SDK v1.1.7+ - Agent asking user questions)
224
+ // PERMISSION BATCHING
225
+ // ============================================================
226
+ "permissionBatchWindowMs": 800,
227
+
228
+ // ============================================================
229
+ // QUESTION TOOL MESSAGES (SDK v1.1.7+)
238
230
  // ============================================================
239
- // The "question" tool allows the LLM to ask users questions during execution.
240
- // This is useful for gathering preferences, clarifying instructions, or getting
241
- // decisions on implementation choices.
242
-
243
- // Messages when agent asks user a question
244
231
  "questionTTSMessages": [
245
232
  "Hey! I have a question for you. Please check your screen.",
246
233
  "Attention! I need your input to continue.",
@@ -248,8 +235,6 @@
248
235
  "I need some clarification. Could you please respond?",
249
236
  "Question time! Your input is needed to proceed."
250
237
  ],
251
-
252
- // Messages for MULTIPLE questions (use {count} placeholder)
253
238
  "questionTTSMessagesMultiple": [
254
239
  "Hey! I have {count} questions for you. Please check your screen.",
255
240
  "Attention! I need your input on {count} items to continue.",
@@ -257,8 +242,6 @@
257
242
  "I need some clarifications. There are {count} questions waiting for you.",
258
243
  "Question time! {count} questions need your response to proceed."
259
244
  ],
260
-
261
- // Reminder messages for questions (more urgent - used after delay)
262
245
  "questionReminderTTSMessages": [
263
246
  "Hey! I am still waiting for your answer. Please check the questions!",
264
247
  "Reminder: There is a question waiting for your response.",
@@ -266,8 +249,6 @@
266
249
  "Still waiting for your answer! The task is on hold.",
267
250
  "Your input is needed! Please check the pending question."
268
251
  ],
269
-
270
- // Reminder messages for MULTIPLE questions (use {count} placeholder)
271
252
  "questionReminderTTSMessagesMultiple": [
272
253
  "Hey! I am still waiting for answers to {count} questions. Please respond!",
273
254
  "Reminder: There are {count} questions waiting for your response.",
@@ -275,114 +256,114 @@
275
256
  "Still waiting for your answers on {count} questions! The task is on hold.",
276
257
  "Your input is needed! {count} questions are pending your response."
277
258
  ],
278
-
279
- // Delay (in seconds) before question reminder fires
280
259
  "questionReminderDelaySeconds": 25,
281
-
282
- // Question batch window (ms) - how long to wait for more questions before notifying
283
260
  "questionBatchWindowMs": 800,
284
-
261
+
285
262
  // ============================================================
286
- // AI MESSAGE GENERATION (OpenAI-Compatible Endpoints)
263
+ // ERROR NOTIFICATION SETTINGS
264
+ // ============================================================
265
+ "errorTTSMessages": [
266
+ "Oops! Something went wrong. Please check for errors.",
267
+ "Alert! The agent encountered an error and needs your attention.",
268
+ "Error detected! Please review the issue when you can.",
269
+ "Houston, we have a problem! An error occurred during the task.",
270
+ "Heads up! There was an error that requires your attention."
271
+ ],
272
+ "errorTTSMessagesMultiple": [
273
+ "Oops! There are {count} errors that need your attention.",
274
+ "Alert! The agent encountered {count} errors. Please review.",
275
+ "{count} errors detected! Please check when you can.",
276
+ "Houston, we have {count} problems! Multiple errors occurred.",
277
+ "Heads up! {count} errors require your attention."
278
+ ],
279
+ "errorReminderTTSMessages": [
280
+ "Hey! There's still an error waiting for your attention.",
281
+ "Reminder: An error occurred and hasn't been addressed yet.",
282
+ "The agent is stuck! Please check the error when you can.",
283
+ "Still waiting! That error needs your attention.",
284
+ "Don't forget! There's an unresolved error in your session."
285
+ ],
286
+ "errorReminderTTSMessagesMultiple": [
287
+ "Hey! There are still {count} errors waiting for your attention.",
288
+ "Reminder: {count} errors occurred and haven't been addressed yet.",
289
+ "The agent is stuck! Please check the {count} errors when you can.",
290
+ "Still waiting! {count} errors need your attention.",
291
+ "Don't forget! There are {count} unresolved errors in your session."
292
+ ],
293
+ "errorReminderDelaySeconds": 20,
294
+
295
+ // ============================================================
296
+ // AI MESSAGE GENERATION
287
297
  // ============================================================
288
- // Use a local/self-hosted AI to generate dynamic notification messages
289
- // instead of using preset static messages. The AI generates the text,
290
- // which is then spoken by your configured TTS engine (ElevenLabs, Edge, etc.)
291
- //
292
- // Supports: Ollama, LM Studio, LocalAI, vLLM, llama.cpp, Jan.ai, and any
293
- // OpenAI-compatible endpoint. You provide your own endpoint URL and API key.
294
- //
295
- // HOW IT WORKS:
296
- // 1. When a notification is triggered (task complete, permission needed, etc.)
297
- // 2. If AI is enabled, the plugin sends a prompt to your AI server
298
- // 3. The AI generates a unique, contextual notification message
299
- // 4. That message is spoken by your TTS engine (ElevenLabs, Edge, SAPI)
300
- // 5. If AI fails, it falls back to the static messages defined above
301
-
302
- // Enable AI-generated messages (experimental feature)
303
- // Default: false (uses static messages defined above)
304
298
  "enableAIMessages": false,
305
-
306
- // Your AI server endpoint URL
307
- // Common local AI servers and their default endpoints:
308
- // Ollama: http://localhost:11434/v1
309
- // LM Studio: http://localhost:1234/v1
310
- // LocalAI: http://localhost:8080/v1
311
- // vLLM: http://localhost:8000/v1
312
- // llama.cpp: http://localhost:8080/v1
313
- // Jan.ai: http://localhost:1337/v1
314
- // text-gen-webui: http://localhost:5000/v1
315
299
  "aiEndpoint": "http://localhost:11434/v1",
316
-
317
- // Model name to use (must match a model loaded in your AI server)
318
- // Examples for Ollama: "llama3", "llama3.2", "mistral", "phi3", "gemma2", "qwen2"
319
- // For LM Studio: Use the model name shown in the UI
320
300
  "aiModel": "llama3",
321
-
322
- // API key for your AI server
323
- // Most local servers (Ollama, LM Studio, LocalAI) don't require a key - leave empty
324
- // Only set this if your server requires authentication
325
- // For vLLM with auth disabled, use "EMPTY"
326
301
  "aiApiKey": "",
327
-
328
- // Request timeout in milliseconds
329
- // Local AI can be slow on first request (model loading), so 15 seconds is recommended
330
- // Increase if you have a slower machine or larger models
331
302
  "aiTimeout": 15000,
332
-
333
- // Fall back to static messages (defined above) if AI generation fails
334
- // Recommended: true - ensures notifications always work even if AI is down
335
303
  "aiFallbackToStatic": true,
336
-
337
- // Custom prompts for each notification type
338
- // You can customize these to change the AI's personality/style
339
- // The AI will generate a short message based on these prompts
340
- // TIP: Keep prompts concise - they're sent with each notification
341
304
  "aiPrompts": {
342
305
  "idle": "Generate a single brief, friendly notification sentence (max 15 words) saying a coding task is complete. Be encouraging and warm. Output only the message, no quotes.",
343
306
  "permission": "Generate a single brief, urgent but friendly notification sentence (max 15 words) asking the user to approve a permission request. Output only the message, no quotes.",
344
307
  "question": "Generate a single brief, polite notification sentence (max 15 words) saying the assistant has a question and needs user input. Output only the message, no quotes.",
308
+ "error": "Generate a single brief, concerned but calm notification sentence (max 15 words) saying an error occurred and needs attention. Output only the message, no quotes.",
345
309
  "idleReminder": "Generate a single brief, gentle reminder sentence (max 15 words) that a completed task is waiting for review. Be slightly more insistent. Output only the message, no quotes.",
346
310
  "permissionReminder": "Generate a single brief, urgent reminder sentence (max 15 words) that permission approval is still needed. Convey importance. Output only the message, no quotes.",
347
- "questionReminder": "Generate a single brief, polite but persistent reminder sentence (max 15 words) that a question is still waiting for an answer. Output only the message, no quotes."
311
+ "questionReminder": "Generate a single brief, polite but persistent reminder sentence (max 15 words) that a question is still waiting for an answer. Output only the message, no quotes.",
312
+ "errorReminder": "Generate a single brief, urgent reminder sentence (max 15 words) that an error still needs attention. Convey urgency. Output only the message, no quotes."
348
313
  },
349
-
314
+
350
315
  // ============================================================
351
- // SOUND FILES (For immediate notifications)
352
- // These are played first before TTS reminder kicks in
316
+ // SOUND FILES
353
317
  // ============================================================
354
- // Paths are relative to ~/.config/opencode/ directory
355
- // The plugin automatically copies bundled sounds to assets/ on first run
356
- // You can replace with your own custom MP3/WAV files
357
-
358
318
  "idleSound": "assets/Soft-high-tech-notification-sound-effect.mp3",
359
319
  "permissionSound": "assets/Machine-alert-beep-sound-effect.mp3",
360
320
  "questionSound": "assets/Machine-alert-beep-sound-effect.mp3",
361
-
321
+ "errorSound": "assets/Machine-alert-beep-sound-effect.mp3",
322
+
362
323
  // ============================================================
363
324
  // GENERAL SETTINGS
364
325
  // ============================================================
365
-
366
- // Wake monitor from sleep when notifying (Windows/macOS)
367
326
  "wakeMonitor": true,
368
-
369
- // Force system volume up if below threshold
370
327
  "forceVolume": true,
371
-
372
- // Volume threshold (0-100): force volume if current level is below this
373
328
  "volumeThreshold": 50,
374
-
375
- // Show TUI toast notifications in OpenCode terminal
376
329
  "enableToast": true,
377
-
378
- // Enable audio notifications (sound files and TTS)
379
330
  "enableSound": true,
380
-
381
- // Consider monitor asleep after this many seconds of inactivity (Windows only)
331
+
332
+ // ============================================================
333
+ // DESKTOP NOTIFICATION SETTINGS
334
+ // ============================================================
335
+ "enableDesktopNotification": true,
336
+ "desktopNotificationTimeout": 5,
337
+ "showProjectInNotification": true,
338
+
339
+ // ============================================================
340
+ // FOCUS DETECTION SETTINGS
341
+ // ============================================================
342
+ "suppressWhenFocused": true,
343
+ "alwaysNotify": false,
344
+
345
+ // ============================================================
346
+ // WEBHOOK NOTIFICATION SETTINGS
347
+ // ============================================================
348
+ "enableWebhook": false,
349
+ "webhookUrl": "",
350
+ "webhookUsername": "OpenCode Notify",
351
+ "webhookEvents": ["idle", "permission", "error", "question"],
352
+ "webhookMentionOnPermission": false,
353
+
354
+ // ============================================================
355
+ // SOUND THEME SETTINGS
356
+ // ============================================================
357
+ "soundThemeDir": "",
358
+ "randomizeSoundFromTheme": true,
359
+
360
+ // ============================================================
361
+ // PER-PROJECT SOUND SETTINGS
362
+ // ============================================================
363
+ "perProjectSounds": false,
364
+ "projectSoundSeed": 0,
365
+
366
+ // General options
382
367
  "idleThresholdSeconds": 60,
383
-
384
- // Enable debug logging to ~/.config/opencode/logs/smart-voice-notify-debug.log
385
- // The logs folder is created automatically when debug logging is enabled
386
- // Useful for troubleshooting notification issues
387
368
  "debugLog": false
388
369
  }