-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexample.config.jsonc
More file actions
481 lines (413 loc) · 24 KB
/
example.config.jsonc
File metadata and controls
481 lines (413 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
{
// ============================================================
// OpenCode Smart Voice Notify - Full Configuration Reference
// ============================================================
//
// IMPORTANT: This is a REFERENCE file showing ALL available options.
//
// To use this plugin:
// 1. Copy this file to: ~/.config/opencode/smart-voice-notify.jsonc
// (On Windows: C:\Users\<YourUser>\.config\opencode\smart-voice-notify.jsonc)
// 2. Customize the settings below to your preference
// 3. The plugin auto-creates a minimal config if none exists
//
// Sound files are automatically copied to ~/.config/opencode/assets/
// on first run. You can also use your own custom sound files.
//
// ============================================================
// Internal version tracking - DO NOT REMOVE
"_configVersion": "1.3.3",
// ============================================================
// PLUGIN ENABLE/DISABLE
// ============================================================
// Master switch to enable or disable the entire plugin.
// Set to false to disable all notifications without uninstalling.
"enabled": true,
// ============================================================
// GRANULAR NOTIFICATION CONTROL
// ============================================================
// Enable or disable notifications for specific event types.
// If disabled, no sound, TTS, desktop, or webhook notifications
// will be sent for that specific category.
"enableIdleNotification": true, // Agent finished work
"enablePermissionNotification": true, // Agent needs permission
"enableQuestionNotification": true, // Agent asks a question
"enableErrorNotification": false, // Agent encountered an error
// Enable or disable reminders for specific event types.
// If disabled, the initial notification will still fire, but no
// follow-up TTS reminders will be scheduled.
"enableIdleReminder": true,
"enablePermissionReminder": true,
"enableQuestionReminder": true,
"enableErrorReminder": false,
// ============================================================
// NOTIFICATION MODE SETTINGS (Smart Notification System)
// ============================================================
// Controls how notifications are delivered:
// 'sound-first' - Play sound immediately, TTS reminder after delay (RECOMMENDED)
// 'tts-first' - Speak TTS immediately, no sound
// 'both' - Play sound AND speak TTS immediately
// 'sound-only' - Only play sound, no TTS at all
"notificationMode": "sound-first",
// ============================================================
// TTS REMINDER SETTINGS (When user doesn't respond to sound)
// ============================================================
// Enable TTS reminder if user doesn't respond after sound notification
"enableTTSReminder": true,
// Delay (in seconds) before TTS reminder fires
// Set globally or per-notification type
"ttsReminderDelaySeconds": 30, // Global default
"idleReminderDelaySeconds": 30, // For task completion notifications
"permissionReminderDelaySeconds": 20, // For permission requests (more urgent)
// Follow-up reminders if user STILL doesn't respond after first TTS
"enableFollowUpReminders": true,
"maxFollowUpReminders": 3, // Max number of follow-up TTS reminders
"reminderBackoffMultiplier": 1.5, // Each follow-up waits longer (30s, 45s, 67s...)
// ============================================================
// TTS ENGINE SELECTION
// ============================================================
// 'openai' - OpenAI-compatible TTS (Self-hosted/Cloud, e.g. Kokoro, LocalAI)
// 'elevenlabs' - Best quality, anime-like voices (requires API key, free tier: 10k chars/month)
// 'edge' - Good quality neural voices (Python edge-tts CLI RECOMMENDED, with msedge-tts npm fallback)
// 'sapi' - Windows built-in voices (free, offline, robotic)
"ttsEngine": "elevenlabs",
// Enable TTS for notifications (falls back to sound files if TTS fails)
"enableTTS": true,
// ============================================================
// ELEVENLABS SETTINGS (Best Quality - Anime-like Voices)
// ============================================================
// Get your API key from: https://elevenlabs.io/app/settings/api-keys
// Free tier: 10,000 characters/month
"elevenLabsApiKey": "YOUR_API_KEY_HERE",
// Voice ID - Recommended cute/anime-like voices:
// 'cgSgspJ2msm6clMCkdW9' - Jessica (Playful, Bright, Warm) - RECOMMENDED
// 'FGY2WhTYpPnrIDTdsKH5' - Laura (Enthusiast, Quirky)
// 'jsCqWAovK2LkecY7zXl4' - Freya (Expressive, Confident)
// 'EXAVITQu4vr4xnSDxMaL' - Sarah (Soft, Warm)
// Browse more at: https://elevenlabs.io/voice-library
"elevenLabsVoiceId": "cgSgspJ2msm6clMCkdW9",
// Model: 'eleven_turbo_v2_5' (fast, good), 'eleven_multilingual_v2' (highest quality)
"elevenLabsModel": "eleven_turbo_v2_5",
// Voice tuning (0.0 to 1.0)
"elevenLabsStability": 0.5, // Lower = more expressive, Higher = more consistent
"elevenLabsSimilarity": 0.75, // How closely to match the original voice
"elevenLabsStyle": 0.5, // Style exaggeration (higher = more expressive)
// ============================================================
// EDGE TTS SETTINGS (Free Neural Voices)
// ============================================================
// Uses Python edge-tts CLI (RECOMMENDED, pip install edge-tts) with automatic
// fallback to msedge-tts npm package if Python is not available.
// Voice options (run 'edge-tts --list-voices' to see all):
// 'en-US-AnaNeural' - Young, cute, cartoon-like (RECOMMENDED)
// 'en-US-JennyNeural' - Friendly, warm
// 'en-US-AriaNeural' - Confident, clear
// 'en-GB-SoniaNeural' - British, friendly
// 'en-AU-NatashaNeural' - Australian, warm
"edgeVoice": "en-US-AnaNeural",
// Pitch adjustment: +0Hz to +100Hz (higher = more anime-like)
"edgePitch": "+50Hz",
// Speech rate: -50% to +100%
"edgeRate": "+10%",
// ============================================================
// SAPI SETTINGS (Windows Built-in - Last Resort Fallback)
// ============================================================
// Voice (run PowerShell to list all installed voices):
// Add-Type -AssemblyName System.Speech; (New-Object System.Speech.Synthesis.SpeechSynthesizer).GetInstalledVoices() | % { $_.VoiceInfo.Name }
//
// Common Windows voices:
// 'Microsoft Zira Desktop' - Female, US English
// 'Microsoft David Desktop' - Male, US English
// 'Microsoft Hazel Desktop' - Female, UK English
"sapiVoice": "Microsoft Zira Desktop",
// Speech rate: -10 (slowest) to +10 (fastest), 0 is normal
"sapiRate": -1,
// Pitch: 'x-low', 'low', 'medium', 'high', 'x-high'
"sapiPitch": "medium",
// Volume: 'silent', 'x-soft', 'soft', 'medium', 'loud', 'x-loud'
"sapiVolume": "loud",
// ============================================================
// OPENAI-COMPATIBLE TTS SETTINGS (Kokoro, LocalAI, OpenAI, etc.)
// ============================================================
// Any OpenAI-compatible /v1/audio/speech endpoint.
// Examples: Kokoro, OpenAI, LocalAI, Coqui, AllTalk, etc.
// Base URL for your TTS server (e.g., "http://192.168.86.43:8880")
"openaiTtsEndpoint": "",
// API key (leave empty if your server doesn't require auth)
"openaiTtsApiKey": "",
// Model name (server-dependent, e.g., "tts-1", "kokoro", "xtts")
"openaiTtsModel": "tts-1",
// Voice name (server-dependent)
// Kokoro voices: "af_heart", "af_bella", "am_adam", etc.
// OpenAI voices: "alloy", "echo", "fable", "onyx", "nova", "shimmer"
"openaiTtsVoice": "alloy",
// Audio format: "mp3", "opus", "aac", "flac", "wav", "pcm"
"openaiTtsFormat": "mp3",
// Speech speed: 0.25 to 4.0 (1.0 = normal)
"openaiTtsSpeed": 1.0,
// ============================================================
// INITIAL TTS MESSAGES (Used immediately or after sound)
// ============================================================
"idleTTSMessages": [
"All done! Your task has been completed successfully.",
"Hey there! I finished working on your request.",
"Task complete! Ready for your review whenever you are.",
"Good news! Everything is done and ready for you.",
"Finished! Let me know if you need anything else."
],
"permissionTTSMessages": [
"Attention please! I need your permission to continue.",
"Hey! Quick approval needed to proceed with the task.",
"Heads up! There is a permission request waiting for you.",
"Excuse me! I need your authorization before I can continue.",
"Permission required! Please review and approve when ready."
],
"permissionTTSMessagesMultiple": [
"Attention please! There are {count} permission requests waiting for your approval.",
"Hey! {count} permissions need your approval to continue.",
"Heads up! You have {count} pending permission requests.",
"Excuse me! I need your authorization for {count} different actions.",
"{count} permissions required! Please review and approve when ready."
],
// ============================================================
// TTS REMINDER MESSAGES (More urgent)
// ============================================================
"idleReminderTTSMessages": [
"Hey, are you still there? Your task has been waiting for review.",
"Just a gentle reminder - I finished your request a while ago!",
"Hello? I completed your task. Please take a look when you can.",
"Still waiting for you! The work is done and ready for review.",
"Knock knock! Your completed task is patiently waiting for you."
],
"permissionReminderTTSMessages": [
"Hey! I still need your permission to continue. Please respond!",
"Reminder: There is a pending permission request. I cannot proceed without you.",
"Hello? I am waiting for your approval. This is getting urgent!",
"Please check your screen! I really need your permission to move forward.",
"Still waiting for authorization! The task is on hold until you respond."
],
"permissionReminderTTSMessagesMultiple": [
"Hey! I still need your approval for {count} permissions. Please respond!",
"Reminder: There are {count} pending permission requests. I cannot proceed without you.",
"Hello? I am waiting for your approval on {count} items. This is getting urgent!",
"Please check your screen! {count} permissions are waiting for your response.",
"Still waiting for authorization on {count} requests! The task is on hold."
],
// ============================================================
// PERMISSION BATCHING (Multiple permissions at once)
// ============================================================
// When multiple permissions arrive simultaneously, batch them into one notification
// This prevents overlapping sounds when 5+ permissions come at once
// Batch window (ms) - how long to wait for more permissions before notifying
"permissionBatchWindowMs": 800,
// ============================================================
// QUESTION TOOL SETTINGS (SDK v1.1.7+ - Agent asking user questions)
// ============================================================
// The "question" tool allows the LLM to ask users questions during execution.
// This is useful for gathering preferences, clarifying instructions, or getting
// decisions on implementation choices.
// Messages when agent asks user a question
"questionTTSMessages": [
"Hey! I have a question for you. Please check your screen.",
"Attention! I need your input to continue.",
"Quick question! Please take a look when you have a moment.",
"I need some clarification. Could you please respond?",
"Question time! Your input is needed to proceed."
],
"questionTTSMessagesMultiple": [
"Hey! I have {count} questions for you. Please check your screen.",
"Attention! I need your input on {count} items to continue.",
"{count} questions need your attention. Please take a look!",
"I need some clarifications. There are {count} questions waiting for you.",
"Question time! {count} questions need your response to proceed."
],
"questionReminderTTSMessages": [
"Hey! I am still waiting for your answer. Please check the questions!",
"Reminder: There is a question waiting for your response.",
"Hello? I need your input to continue. Please respond when you can.",
"Still waiting for your answer! The task is on hold.",
"Your input is needed! Please check the pending question."
],
"questionReminderTTSMessagesMultiple": [
"Hey! I am still waiting for answers to {count} questions. Please respond!",
"Reminder: There are {count} questions waiting for your response.",
"Hello? I need your input on {count} items. Please respond when you can.",
"Still waiting for your answers on {count} questions! The task is on hold.",
"Your input is needed! {count} questions are pending your response."
],
// Delay (in seconds) before question reminder fires
"questionReminderDelaySeconds": 25,
// Question batch window (ms) - how long to wait for more questions before notifying
"questionBatchWindowMs": 800,
// ============================================================
// ERROR NOTIFICATION SETTINGS (Session Errors)
// ============================================================
// Notify users when the agent encounters an error during execution.
// Error notifications use more urgent messaging to get user attention.
// Messages when agent encounters an error
"errorTTSMessages": [
"Oops! Something went wrong. Please check for errors.",
"Alert! The agent encountered an error and needs your attention.",
"Error detected! Please review the issue when you can.",
"Houston, we have a problem! An error occurred during the task.",
"Heads up! There was an error that requires your attention."
],
"errorTTSMessagesMultiple": [
"Oops! There are {count} errors that need your attention.",
"Alert! The agent encountered {count} errors. Please review.",
"{count} errors detected! Please check when you can.",
"Houston, we have {count} problems! Multiple errors occurred.",
"Heads up! {count} errors require your attention."
],
"errorReminderTTSMessages": [
"Hey! There's still an error waiting for your attention.",
"Reminder: An error occurred and hasn't been addressed yet.",
"The agent is stuck! Please check the error when you can.",
"Still waiting! That error needs your attention.",
"Don't forget! There's an unresolved error in your session."
],
"errorReminderTTSMessagesMultiple": [
"Hey! There are still {count} errors waiting for your attention.",
"Reminder: {count} errors occurred and haven't been addressed yet.",
"The agent is stuck! Please check the {count} errors when you can.",
"Still waiting! {count} errors need your attention.",
"Don't forget! There are {count} unresolved errors in your session."
],
// Delay (in seconds) before error reminder fires (shorter than idle for urgency)
"errorReminderDelaySeconds": 20,
// ============================================================
// AI MESSAGE GENERATION (OpenAI-Compatible Endpoints)
// ============================================================
// Use a local/self-hosted AI to generate dynamic notification messages
// instead of using preset static messages. The AI generates the text,
// which is then spoken by your configured TTS engine (ElevenLabs, Edge, etc.)
//
// Supports: Ollama, LM Studio, LocalAI, vLLM, llama.cpp, Jan.ai, and any
// OpenAI-compatible endpoint. You provide your own endpoint URL and API key.
"enableAIMessages": false,
// Your AI server endpoint URL (e.g., Ollama: http://localhost:11434/v1)
// Common endpoints:
// Ollama: http://localhost:11434/v1
// LM Studio: http://localhost:1234/v1
// LocalAI: http://localhost:8080/v1
// vLLM: http://localhost:8000/v1
// Jan.ai: http://localhost:1337/v1
"aiEndpoint": "http://localhost:11434/v1",
// Model name to use (depends on what's loaded in your AI server)
// Examples: "llama3", "mistral", "phi3", "gemma2", "qwen2"
"aiModel": "llama3",
// API key for your AI server (leave empty for Ollama/LM Studio/LocalAI)
// Only needed if your server requires authentication
"aiApiKey": "",
// Request timeout in milliseconds (local AI can be slow on first request)
"aiTimeout": 15000,
// Fallback to static preset messages if AI generation fails
"aiFallbackToStatic": true,
// Enable context-aware AI messages (includes project name, task title, and change summary)
// When enabled, AI-generated notifications will include relevant context like:
// - Project name (e.g., "Your work on MyProject is complete!")
// - Task/session title if available
// - Change summary (files modified, lines added/deleted)
// Disabled by default - enable this for more personalized notifications
"enableContextAwareAI": false,
"aiPrompts": {
"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.",
"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.",
"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.",
"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.",
"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.",
"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.",
"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.",
"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."
},
// ============================================================
// SOUND FILES
// ============================================================
"idleSound": "assets/Soft-high-tech-notification-sound-effect.mp3",
"permissionSound": "assets/Machine-alert-beep-sound-effect.mp3",
"questionSound": "assets/Machine-alert-beep-sound-effect.mp3",
"errorSound": "assets/Machine-alert-beep-sound-effect.mp3",
// ============================================================
// GENERAL SETTINGS
// ============================================================
"wakeMonitor": true,
"forceVolume": true,
"volumeThreshold": 50,
"enableToast": true,
"enableSound": true,
// ============================================================
// DESKTOP NOTIFICATION SETTINGS
// ============================================================
// Native desktop notifications (Windows Toast, macOS Notification Center, Linux notify-send)
// These appear as system notifications alongside sound and TTS.
//
// Note: On Linux, you may need to install libnotify-bin:
// Ubuntu/Debian: sudo apt install libnotify-bin
// Fedora: sudo dnf install libnotify
// Arch: sudo pacman -S libnotify
// Enable native desktop notifications
"enableDesktopNotification": true,
// How long the notification stays on screen (in seconds)
// Note: Some platforms may ignore this (especially Windows 10+)
"desktopNotificationTimeout": 5,
// Include the project name in notification titles for easier identification
// Example: "OpenCode - MyProject" instead of just "OpenCode"
"showProjectInNotification": true,
// ============================================================
// FOCUS DETECTION SETTINGS
// ============================================================
// Suppress sound/desktop notifications when terminal window is focused.
// Cross-platform: Windows, macOS, and Linux (X11 via xdotool/xprop, Wayland via gdbus).
// Default: false (notifications always play regardless of focus)
// Set to true to avoid notification spam when actively working in terminal
"suppressWhenFocused": false,
"alwaysNotify": false,
// ============================================================
// WEBHOOK NOTIFICATION SETTINGS (Discord/Generic)
// ============================================================
// Send notifications to a Discord webhook or any compatible endpoint.
// This allows you to receive notifications on your phone or other devices.
// Enable webhook notifications
"enableWebhook": false,
// Webhook URL (e.g., https://discord.com/api/webhooks/...)
"webhookUrl": "",
// Username to show in the webhook message
"webhookUsername": "OpenCode Notify",
// Events that should trigger a webhook notification
// Options: "idle", "permission", "error", "question"
"webhookEvents": ["idle", "permission", "error", "question"],
// Mention @everyone on permission requests (Discord only)
"webhookMentionOnPermission": false,
// ============================================================
// SOUND THEME SETTINGS (Themed Sound Packs)
// ============================================================
// Configure a directory containing custom sound files for notifications.
// This allows you to use themed sound packs (e.g., Warcraft, StarCraft, etc.)
//
// Directory structure should contain:
// /path/to/theme/idle/ - Sounds for task completion
// /path/to/theme/permission/ - Sounds for permission requests
// /path/to/theme/error/ - Sounds for agent errors
// /path/to/theme/question/ - Sounds for agent questions
//
// If a specific event folder is missing, it falls back to default sounds.
// Path to your custom sound theme directory (absolute path recommended)
"soundThemeDir": "",
// Pick a random sound from the appropriate theme folder for each notification
"randomizeSoundFromTheme": true,
// ============================================================
// PER-PROJECT SOUND SETTINGS
// ============================================================
// Assign a unique notification sound to each project based on its path.
// This helps you distinguish which project is notifying you when working
// on multiple tasks simultaneously.
//
// Note: Requires sounds named 'ding1.mp3' through 'ding6.mp3' in your
// assets/ folder. If disabled, default sound files are used.
// Enable unique sounds per project
"perProjectSounds": false,
// Seed value to change sound assignments (0-999)
"projectSoundSeed": 0,
// General options
"idleThresholdSeconds": 60,
"debugLog": false
}