agentvibes 5.2.0 → 5.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.
Files changed (52) hide show
  1. package/.claude/config/audio-effects.cfg +1 -1
  2. package/.claude/hooks/audio-cache-utils.sh +246 -246
  3. package/.claude/hooks/background-music-manager.sh +404 -404
  4. package/.claude/hooks/bmad-speak-enhanced.sh +165 -165
  5. package/.claude/hooks/bmad-speak.sh +290 -290
  6. package/.claude/hooks/bmad-tts-injector.sh +568 -568
  7. package/.claude/hooks/bmad-voice-manager.sh +928 -928
  8. package/.claude/hooks/clawdbot-receiver-SECURE.sh +129 -129
  9. package/.claude/hooks/clawdbot-receiver.sh +107 -107
  10. package/.claude/hooks/clean-audio-cache.sh +22 -22
  11. package/.claude/hooks/cleanup-cache.sh +106 -106
  12. package/.claude/hooks/configure-rdp-mode.sh +137 -137
  13. package/.claude/hooks/download-extra-voices.sh +244 -244
  14. package/.claude/hooks/effects-manager.sh +268 -268
  15. package/.claude/hooks/github-star-reminder.sh +154 -154
  16. package/.claude/hooks/language-manager.sh +362 -362
  17. package/.claude/hooks/learn-manager.sh +492 -492
  18. package/.claude/hooks/macos-voice-manager.sh +205 -205
  19. package/.claude/hooks/migrate-background-music.sh +125 -125
  20. package/.claude/hooks/migrate-to-agentvibes.sh +161 -161
  21. package/.claude/hooks/optimize-background-music.sh +87 -87
  22. package/.claude/hooks/path-resolver.sh +60 -60
  23. package/.claude/hooks/personality-manager.sh +448 -448
  24. package/.claude/hooks/piper-installer.sh +292 -292
  25. package/.claude/hooks/piper-multispeaker-registry.sh +171 -171
  26. package/.claude/hooks/play-tts-enhanced.sh +105 -105
  27. package/.claude/hooks/play-tts-ssh-remote.sh +104 -10
  28. package/.claude/hooks/play-tts-termux-ssh.sh +169 -169
  29. package/.claude/hooks/play-tts.sh +31 -11
  30. package/.claude/hooks/prepare-release.sh +54 -54
  31. package/.claude/hooks/provider-commands.sh +617 -617
  32. package/.claude/hooks/provider-manager.sh +399 -399
  33. package/.claude/hooks/replay-target-audio.sh +95 -95
  34. package/.claude/hooks/sentiment-manager.sh +201 -201
  35. package/.claude/hooks/speed-manager.sh +291 -291
  36. package/.claude/hooks/stop-tts.sh +84 -84
  37. package/.claude/hooks/termux-installer.sh +261 -261
  38. package/.claude/hooks/translate-manager.sh +341 -341
  39. package/.claude/hooks/tts-queue-worker.sh +145 -145
  40. package/.claude/hooks/tts-queue.sh +165 -165
  41. package/.claude/hooks/voice-manager.sh +552 -548
  42. package/.claude/hooks-windows/bmad-party-speak.ps1 +5 -1
  43. package/.claude/hooks-windows/play-tts.ps1 +91 -59
  44. package/README.md +21 -2
  45. package/RELEASE_NOTES.md +130 -0
  46. package/bin/mcp-server.sh +206 -206
  47. package/mcp-server/server.py +35 -6
  48. package/package.json +1 -1
  49. package/src/console/tabs/setup-tab.js +68 -29
  50. package/src/console/tabs/voices-tab.js +9 -3
  51. package/src/installer.js +79 -213
  52. package/src/services/llm-provider-service.js +139 -75
@@ -1,492 +1,492 @@
1
- #!/usr/bin/env bash
2
- #
3
- # File: .claude/hooks/learn-manager.sh
4
- #
5
- # AgentVibes - Finally, your AI Agents can Talk Back! Text-to-Speech WITH personality for AI Assistants!
6
- # Website: https://agentvibes.org
7
- # Repository: https://github.com/paulpreibisch/AgentVibes
8
- #
9
- # Co-created by Paul Preibisch with Claude AI
10
- # Copyright (c) 2025 Paul Preibisch
11
- #
12
- # Licensed under the Apache License, Version 2.0 (the "License");
13
- # you may not use this file except in compliance with the License.
14
- # You may obtain a copy of the License at
15
- #
16
- # http://www.apache.org/licenses/LICENSE-2.0
17
- #
18
- # Unless required by applicable law or agreed to in writing, software
19
- # distributed under the License is distributed on an "AS IS" BASIS,
20
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- # See the License for the specific language governing permissions and
22
- # limitations under the License.
23
- #
24
- # DISCLAIMER: This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
- # express or implied. Use at your own risk. See the Apache License for details.
26
- #
27
- # ---
28
- #
29
- # @fileoverview Language Learning Mode Manager - Enables dual-language TTS for immersive learning
30
- # @context Speaks responses in both main language (English) and target language (Spanish, French, etc.) for language practice
31
- # @architecture Manages main/target language pairs with voice mappings, auto-configures recommended voices per language
32
- # @dependencies play-tts.sh (dual invocation), language-manager.sh (voice recommendations), .claude/tts-*.txt state files
33
- # @entrypoints Called by /agent-vibes:learn commands to enable/disable learning mode
34
- # @patterns Dual-voice orchestration, auto-configuration, greeting on activation, provider-aware voice selection
35
- # @related language-manager.sh, play-tts.sh, .claude/tts-learn-mode.txt, .claude/tts-target-language.txt
36
-
37
- # Only set strict mode when executed directly, not when sourced
38
- if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
39
- set -e
40
- fi
41
-
42
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
43
-
44
- # Bash 3.2 compatible lowercase function (macOS ships with bash 3.2)
45
- # ${var,,} syntax requires bash 4.0+
46
- _to_lower() {
47
- echo "$1" | tr '[:upper:]' '[:lower:]'
48
- }
49
-
50
- # Use PWD for project dir when called from project context, fall back to script-relative
51
- if [[ -d "$PWD/.claude" ]]; then
52
- PROJECT_DIR="$PWD"
53
- else
54
- PROJECT_DIR="$SCRIPT_DIR/../.."
55
- fi
56
-
57
- # Configuration files (project-local first, then global fallback)
58
- MAIN_LANG_FILE="$PROJECT_DIR/.claude/tts-main-language.txt"
59
- TARGET_LANG_FILE="$PROJECT_DIR/.claude/tts-target-language.txt"
60
- TARGET_VOICE_FILE="$PROJECT_DIR/.claude/tts-target-voice.txt"
61
- LEARN_MODE_FILE="$PROJECT_DIR/.claude/tts-learn-mode.txt"
62
-
63
- GLOBAL_MAIN_LANG_FILE="$HOME/.claude/tts-main-language.txt"
64
- GLOBAL_TARGET_LANG_FILE="$HOME/.claude/tts-target-language.txt"
65
- GLOBAL_TARGET_VOICE_FILE="$HOME/.claude/tts-target-voice.txt"
66
- GLOBAL_LEARN_MODE_FILE="$HOME/.claude/tts-learn-mode.txt"
67
-
68
- # Colors
69
- GREEN='\033[0;32m'
70
- YELLOW='\033[1;33m'
71
- BLUE='\033[0;34m'
72
- NC='\033[0m'
73
-
74
- # Get main language
75
- get_main_language() {
76
- if [[ -f "$MAIN_LANG_FILE" ]]; then
77
- cat "$MAIN_LANG_FILE"
78
- elif [[ -f "$GLOBAL_MAIN_LANG_FILE" ]]; then
79
- cat "$GLOBAL_MAIN_LANG_FILE"
80
- else
81
- echo "english"
82
- fi
83
- }
84
-
85
- # Set main language
86
- set_main_language() {
87
- local language="$1"
88
- if [[ -z "$language" ]]; then
89
- echo -e "${YELLOW}Usage: learn-manager.sh set-main-language <language>${NC}"
90
- exit 1
91
- fi
92
-
93
- mkdir -p "$PROJECT_DIR/.claude"
94
- echo "$language" > "$MAIN_LANG_FILE"
95
- echo -e "${GREEN}✓${NC} Main language set to: $language"
96
- }
97
-
98
- # Get target language
99
- get_target_language() {
100
- if [[ -f "$TARGET_LANG_FILE" ]]; then
101
- cat "$TARGET_LANG_FILE"
102
- elif [[ -f "$GLOBAL_TARGET_LANG_FILE" ]]; then
103
- cat "$GLOBAL_TARGET_LANG_FILE"
104
- else
105
- echo ""
106
- fi
107
- }
108
-
109
- # Get greeting message for a language
110
- get_greeting_for_language() {
111
- local language="$1"
112
-
113
- case "$(_to_lower "$language")" in
114
- spanish|español)
115
- echo "¡Hola! Soy tu profesor de español. ¡Vamos a aprender juntos!"
116
- ;;
117
- french|français)
118
- echo "Bonjour! Je suis votre professeur de français. Apprenons ensemble!"
119
- ;;
120
- german|deutsch)
121
- echo "Hallo! Ich bin dein Deutschlehrer. Lass uns zusammen lernen!"
122
- ;;
123
- italian|italiano)
124
- echo "Ciao! Sono il tuo insegnante di italiano. Impariamo insieme!"
125
- ;;
126
- portuguese|português)
127
- echo "Olá! Sou seu professor de português. Vamos aprender juntos!"
128
- ;;
129
- chinese|中文|mandarin)
130
- echo "你好!我是你的中文老师。让我们一起学习吧!"
131
- ;;
132
- japanese|日本語)
133
- echo "こんにちは!私はあなたの日本語の先生です。一緒に勉強しましょう!"
134
- ;;
135
- korean|한국어)
136
- echo "안녕하세요! 저는 당신의 한국어 선생님입니다. 함께 배워봅시다!"
137
- ;;
138
- russian|русский)
139
- echo "Здравствуйте! Я ваш учитель русского языка. Давайте учиться вместе!"
140
- ;;
141
- arabic|العربية)
142
- echo "مرحبا! أنا معلمك للغة العربية. دعونا نتعلم معا!"
143
- ;;
144
- hindi|हिन्दी)
145
- echo "नमस्ते! मैं आपका हिंदी शिक्षक हूं। आइए साथ में सीखें!"
146
- ;;
147
- dutch|nederlands)
148
- echo "Hallo! Ik ben je Nederlandse leraar. Laten we samen leren!"
149
- ;;
150
- polish|polski)
151
- echo "Cześć! Jestem twoim nauczycielem polskiego. Uczmy się razem!"
152
- ;;
153
- turkish|türkçe)
154
- echo "Merhaba! Ben Türkçe öğretmeninizim. Birlikte öğrenelim!"
155
- ;;
156
- swedish|svenska)
157
- echo "Hej! Jag är din svenskalärare. Låt oss lära tillsammans!"
158
- ;;
159
- *)
160
- echo "Hello! I am your language teacher. Let's learn together!"
161
- ;;
162
- esac
163
- }
164
-
165
- # Set target language
166
- set_target_language() {
167
- local language="$1"
168
- if [[ -z "$language" ]]; then
169
- echo -e "${YELLOW}Usage: learn-manager.sh set-target-language <language>${NC}"
170
- exit 1
171
- fi
172
-
173
- mkdir -p "$PROJECT_DIR/.claude"
174
- echo "$language" > "$TARGET_LANG_FILE"
175
- echo -e "${GREEN}✓${NC} Target language set to: $language"
176
-
177
- # Automatically set the recommended voice for this language
178
- local recommended_voice=$(get_recommended_voice_for_language "$language")
179
- if [[ -n "$recommended_voice" ]]; then
180
- echo "$recommended_voice" > "$TARGET_VOICE_FILE"
181
- echo -e "${GREEN}✓${NC} Target voice automatically set to: ${YELLOW}$recommended_voice${NC}"
182
-
183
- # Detect provider for display
184
- local provider=""
185
- if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
186
- provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
187
- elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
188
- provider=$(cat "$HOME/.claude/tts-provider.txt")
189
- else
190
- provider="piper"
191
- fi
192
- echo -e " (for ${GREEN}$provider${NC} TTS)"
193
- echo ""
194
-
195
- # Greet user in the target language with the target voice
196
- local greeting=$(get_greeting_for_language "$language")
197
- echo -e "${BLUE}🎓${NC} Your language teacher says:"
198
-
199
- # Check if we're using Piper and if the voice is available
200
- if [[ "$provider" == "piper" ]]; then
201
- # Quick check: does the voice file exist?
202
- local voice_dir="${HOME}/.claude/piper-voices"
203
- if [[ -f "${voice_dir}/${recommended_voice}.onnx" ]]; then
204
- # Voice exists, play greeting in background
205
- nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$recommended_voice" >/dev/null 2>&1 &
206
- else
207
- echo -e "${YELLOW} (Voice not yet downloaded - greeting will play after first download)${NC}"
208
- fi
209
- else
210
- # macOS or other provider - just play it in background
211
- nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$recommended_voice" >/dev/null 2>&1 &
212
- fi
213
- else
214
- # Fallback to suggestion if auto-set failed
215
- suggest_voice_for_language "$language"
216
- fi
217
- }
218
-
219
- # Get recommended voice for a language (returns voice string, no output)
220
- get_recommended_voice_for_language() {
221
- local language="$1"
222
- local recommended_voice=""
223
- local provider=""
224
-
225
- # Detect active provider
226
- if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
227
- provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
228
- elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
229
- provider=$(cat "$HOME/.claude/tts-provider.txt")
230
- else
231
- provider="piper" # Default
232
- fi
233
-
234
- # Source language manager and get provider-specific voice
235
- if [[ -f "$SCRIPT_DIR/language-manager.sh" ]]; then
236
- source "$SCRIPT_DIR/language-manager.sh" 2>/dev/null
237
- recommended_voice=$(get_voice_for_language "$language" "$provider" 2>/dev/null)
238
- fi
239
-
240
- # Fallback to hardcoded suggestions if function failed
241
- if [[ -z "$recommended_voice" ]]; then
242
- case "$(_to_lower "$language")" in
243
- spanish|español)
244
- recommended_voice=$([ "$provider" = "piper" ] && echo "es_ES-davefx-medium" || echo "Antoni")
245
- ;;
246
- french|français)
247
- recommended_voice=$([ "$provider" = "piper" ] && echo "fr_FR-siwis-medium" || echo "Rachel")
248
- ;;
249
- german|deutsch)
250
- recommended_voice=$([ "$provider" = "piper" ] && echo "de_DE-thorsten-medium" || echo "Domi")
251
- ;;
252
- italian|italiano)
253
- recommended_voice=$([ "$provider" = "piper" ] && echo "it_IT-riccardo-x_low" || echo "Bella")
254
- ;;
255
- portuguese|português)
256
- recommended_voice=$([ "$provider" = "piper" ] && echo "pt_BR-faber-medium" || echo "Matilda")
257
- ;;
258
- chinese|中文|mandarin)
259
- recommended_voice=$([ "$provider" = "piper" ] && echo "zh_CN-huayan-medium" || echo "Amy")
260
- ;;
261
- *)
262
- recommended_voice=$([ "$provider" = "piper" ] && echo "en_US-lessac-medium" || echo "Antoni")
263
- ;;
264
- esac
265
- fi
266
-
267
- echo "$recommended_voice"
268
- }
269
-
270
- # Suggest voice based on target language (displays suggestion message)
271
- suggest_voice_for_language() {
272
- local language="$1"
273
- local suggested_voice=$(get_recommended_voice_for_language "$language")
274
-
275
- # Detect provider for display
276
- local provider=""
277
- if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
278
- provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
279
- elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
280
- provider=$(cat "$HOME/.claude/tts-provider.txt")
281
- else
282
- provider="piper"
283
- fi
284
-
285
- echo ""
286
- echo -e "${BLUE}💡 Tip:${NC} For $language (using ${GREEN}$provider${NC} TTS), we recommend: ${YELLOW}$suggested_voice${NC}"
287
- echo -e " Set it with: ${YELLOW}/agent-vibes:target-voice $suggested_voice${NC}"
288
- }
289
-
290
- # Get target voice
291
- get_target_voice() {
292
- if [[ -f "$TARGET_VOICE_FILE" ]]; then
293
- cat "$TARGET_VOICE_FILE"
294
- elif [[ -f "$GLOBAL_TARGET_VOICE_FILE" ]]; then
295
- cat "$GLOBAL_TARGET_VOICE_FILE"
296
- else
297
- echo ""
298
- fi
299
- }
300
-
301
- # Set target voice
302
- set_target_voice() {
303
- local voice="$1"
304
- if [[ -z "$voice" ]]; then
305
- echo -e "${YELLOW}Usage: learn-manager.sh set-target-voice <voice>${NC}"
306
- exit 1
307
- fi
308
-
309
- mkdir -p "$PROJECT_DIR/.claude"
310
- echo "$voice" > "$TARGET_VOICE_FILE"
311
- echo -e "${GREEN}✓${NC} Target voice set to: $voice"
312
- }
313
-
314
- # Check if learning mode is enabled
315
- is_learn_mode_enabled() {
316
- if [[ -f "$LEARN_MODE_FILE" ]]; then
317
- local mode=$(cat "$LEARN_MODE_FILE")
318
- [[ "$mode" == "ON" ]]
319
- elif [[ -f "$GLOBAL_LEARN_MODE_FILE" ]]; then
320
- local mode=$(cat "$GLOBAL_LEARN_MODE_FILE")
321
- [[ "$mode" == "ON" ]]
322
- else
323
- return 1
324
- fi
325
- }
326
-
327
- # Enable learning mode
328
- enable_learn_mode() {
329
- mkdir -p "$PROJECT_DIR/.claude"
330
- echo "ON" > "$LEARN_MODE_FILE"
331
- echo -e "${GREEN}✓${NC} Language learning mode: ${GREEN}ENABLED${NC}"
332
- echo ""
333
-
334
- # Auto-set target voice if target language is set but voice is not
335
- local target_lang=$(get_target_language)
336
- local target_voice=$(get_target_voice)
337
- local voice_was_set=false
338
-
339
- if [[ -n "$target_lang" ]] && [[ -z "$target_voice" ]]; then
340
- echo -e "${BLUE}ℹ${NC} Auto-configuring voice for $target_lang..."
341
- local recommended_voice=$(get_recommended_voice_for_language "$target_lang")
342
- if [[ -n "$recommended_voice" ]]; then
343
- echo "$recommended_voice" > "$TARGET_VOICE_FILE"
344
- target_voice="$recommended_voice"
345
- echo -e "${GREEN}✓${NC} Target voice automatically set to: ${YELLOW}$recommended_voice${NC}"
346
-
347
- # Detect provider for display
348
- local provider=""
349
- if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
350
- provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
351
- elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
352
- provider=$(cat "$HOME/.claude/tts-provider.txt")
353
- else
354
- provider="piper"
355
- fi
356
- echo -e " (for ${GREEN}$provider${NC} TTS)"
357
- echo ""
358
- voice_was_set=true
359
- fi
360
- fi
361
-
362
- show_status
363
-
364
- # Greet user with language teacher if everything is configured
365
- if [[ -n "$target_lang" ]] && [[ -n "$target_voice" ]]; then
366
- echo ""
367
- local greeting=$(get_greeting_for_language "$target_lang")
368
- echo -e "${BLUE}🎓${NC} Your language teacher says:"
369
-
370
- # Detect provider
371
- local provider=""
372
- if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
373
- provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
374
- elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
375
- provider=$(cat "$HOME/.claude/tts-provider.txt")
376
- else
377
- provider="piper"
378
- fi
379
-
380
- # Check if we're using Piper and if the voice is available
381
- if [[ "$provider" == "piper" ]]; then
382
- # Quick check: does the voice file exist?
383
- local voice_dir="${HOME}/.claude/piper-voices"
384
- if [[ -f "${voice_dir}/${target_voice}.onnx" ]]; then
385
- # Voice exists, play greeting in background
386
- nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$target_voice" >/dev/null 2>&1 &
387
- else
388
- echo -e "${YELLOW} (Voice not yet downloaded - greeting will play after first download)${NC}"
389
- fi
390
- else
391
- # macOS or other provider - just play it in background
392
- nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$target_voice" >/dev/null 2>&1 &
393
- fi
394
- fi
395
- }
396
-
397
- # Disable learning mode
398
- disable_learn_mode() {
399
- mkdir -p "$PROJECT_DIR/.claude"
400
- echo "OFF" > "$LEARN_MODE_FILE"
401
- echo -e "${GREEN}✓${NC} Language learning mode: ${YELLOW}DISABLED${NC}"
402
- }
403
-
404
- # Show learning mode status
405
- show_status() {
406
- local main_lang=$(get_main_language)
407
- local target_lang=$(get_target_language)
408
- local target_voice=$(get_target_voice)
409
- local learn_mode="OFF"
410
-
411
- if is_learn_mode_enabled; then
412
- learn_mode="ON"
413
- fi
414
-
415
- echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
416
- echo -e "${BLUE} Language Learning Mode Status${NC}"
417
- echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
418
- echo ""
419
- echo -e " ${BLUE}Learning Mode:${NC} $(if [[ "$learn_mode" == "ON" ]]; then echo -e "${GREEN}ENABLED${NC}"; else echo -e "${YELLOW}DISABLED${NC}"; fi)"
420
- echo -e " ${BLUE}Main Language:${NC} $main_lang"
421
- echo -e " ${BLUE}Target Language:${NC} ${target_lang:-"(not set)"}"
422
- echo -e " ${BLUE}Target Voice:${NC} ${target_voice:-"(not set)"}"
423
- echo ""
424
-
425
- if [[ "$learn_mode" == "ON" ]]; then
426
- if [[ -z "$target_lang" ]]; then
427
- echo -e " ${YELLOW}⚠${NC} Please set a target language: ${YELLOW}/agent-vibes:target <language>${NC}"
428
- fi
429
- if [[ -z "$target_voice" ]]; then
430
- echo -e " ${YELLOW}⚠${NC} Please set a target voice: ${YELLOW}/agent-vibes:target-voice <voice>${NC}"
431
- fi
432
-
433
- if [[ -n "$target_lang" ]] && [[ -n "$target_voice" ]]; then
434
- echo -e " ${GREEN}✓${NC} All set! TTS will speak in both languages."
435
- echo ""
436
- echo -e " ${BLUE}How it works:${NC}"
437
- echo -e " 1. First: Speak in ${BLUE}$main_lang${NC} (your current voice)"
438
- echo -e " 2. Then: Speak in ${BLUE}$target_lang${NC} ($target_voice voice)"
439
- fi
440
- else
441
- echo -e " ${BLUE}💡 Tip:${NC} Enable learning mode with: ${YELLOW}/agent-vibes:learn${NC}"
442
- fi
443
-
444
- echo ""
445
- echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
446
- }
447
-
448
- # Main command handler - only run if script is executed directly, not sourced
449
- if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
450
- case "${1:-}" in
451
- get-main-language)
452
- get_main_language
453
- ;;
454
- set-main-language)
455
- set_main_language "$2"
456
- ;;
457
- get-target-language)
458
- get_target_language
459
- ;;
460
- set-target-language)
461
- set_target_language "$2"
462
- ;;
463
- get-target-voice)
464
- get_target_voice
465
- ;;
466
- set-target-voice)
467
- set_target_voice "$2"
468
- ;;
469
- is-enabled)
470
- if is_learn_mode_enabled; then
471
- echo "ON"
472
- exit 0
473
- else
474
- echo "OFF"
475
- exit 1
476
- fi
477
- ;;
478
- enable)
479
- enable_learn_mode
480
- ;;
481
- disable)
482
- disable_learn_mode
483
- ;;
484
- status)
485
- show_status
486
- ;;
487
- *)
488
- echo "Usage: learn-manager.sh {get-main-language|set-main-language|get-target-language|set-target-language|get-target-voice|set-target-voice|is-enabled|enable|disable|status}"
489
- exit 1
490
- ;;
491
- esac
492
- fi
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .claude/hooks/learn-manager.sh
4
+ #
5
+ # AgentVibes - Finally, your AI Agents can Talk Back! Text-to-Speech WITH personality for AI Assistants!
6
+ # Website: https://agentvibes.org
7
+ # Repository: https://github.com/paulpreibisch/AgentVibes
8
+ #
9
+ # Co-created by Paul Preibisch with Claude AI
10
+ # Copyright (c) 2025 Paul Preibisch
11
+ #
12
+ # Licensed under the Apache License, Version 2.0 (the "License");
13
+ # you may not use this file except in compliance with the License.
14
+ # You may obtain a copy of the License at
15
+ #
16
+ # http://www.apache.org/licenses/LICENSE-2.0
17
+ #
18
+ # Unless required by applicable law or agreed to in writing, software
19
+ # distributed under the License is distributed on an "AS IS" BASIS,
20
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ # See the License for the specific language governing permissions and
22
+ # limitations under the License.
23
+ #
24
+ # DISCLAIMER: This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
+ # express or implied. Use at your own risk. See the Apache License for details.
26
+ #
27
+ # ---
28
+ #
29
+ # @fileoverview Language Learning Mode Manager - Enables dual-language TTS for immersive learning
30
+ # @context Speaks responses in both main language (English) and target language (Spanish, French, etc.) for language practice
31
+ # @architecture Manages main/target language pairs with voice mappings, auto-configures recommended voices per language
32
+ # @dependencies play-tts.sh (dual invocation), language-manager.sh (voice recommendations), .claude/tts-*.txt state files
33
+ # @entrypoints Called by /agent-vibes:learn commands to enable/disable learning mode
34
+ # @patterns Dual-voice orchestration, auto-configuration, greeting on activation, provider-aware voice selection
35
+ # @related language-manager.sh, play-tts.sh, .claude/tts-learn-mode.txt, .claude/tts-target-language.txt
36
+
37
+ # Only set strict mode when executed directly, not when sourced
38
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
39
+ set -e
40
+ fi
41
+
42
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
43
+
44
+ # Bash 3.2 compatible lowercase function (macOS ships with bash 3.2)
45
+ # ${var,,} syntax requires bash 4.0+
46
+ _to_lower() {
47
+ echo "$1" | tr '[:upper:]' '[:lower:]'
48
+ }
49
+
50
+ # Use PWD for project dir when called from project context, fall back to script-relative
51
+ if [[ -d "$PWD/.claude" ]]; then
52
+ PROJECT_DIR="$PWD"
53
+ else
54
+ PROJECT_DIR="$SCRIPT_DIR/../.."
55
+ fi
56
+
57
+ # Configuration files (project-local first, then global fallback)
58
+ MAIN_LANG_FILE="$PROJECT_DIR/.claude/tts-main-language.txt"
59
+ TARGET_LANG_FILE="$PROJECT_DIR/.claude/tts-target-language.txt"
60
+ TARGET_VOICE_FILE="$PROJECT_DIR/.claude/tts-target-voice.txt"
61
+ LEARN_MODE_FILE="$PROJECT_DIR/.claude/tts-learn-mode.txt"
62
+
63
+ GLOBAL_MAIN_LANG_FILE="$HOME/.claude/tts-main-language.txt"
64
+ GLOBAL_TARGET_LANG_FILE="$HOME/.claude/tts-target-language.txt"
65
+ GLOBAL_TARGET_VOICE_FILE="$HOME/.claude/tts-target-voice.txt"
66
+ GLOBAL_LEARN_MODE_FILE="$HOME/.claude/tts-learn-mode.txt"
67
+
68
+ # Colors
69
+ GREEN='\033[0;32m'
70
+ YELLOW='\033[1;33m'
71
+ BLUE='\033[0;34m'
72
+ NC='\033[0m'
73
+
74
+ # Get main language
75
+ get_main_language() {
76
+ if [[ -f "$MAIN_LANG_FILE" ]]; then
77
+ cat "$MAIN_LANG_FILE"
78
+ elif [[ -f "$GLOBAL_MAIN_LANG_FILE" ]]; then
79
+ cat "$GLOBAL_MAIN_LANG_FILE"
80
+ else
81
+ echo "english"
82
+ fi
83
+ }
84
+
85
+ # Set main language
86
+ set_main_language() {
87
+ local language="$1"
88
+ if [[ -z "$language" ]]; then
89
+ echo -e "${YELLOW}Usage: learn-manager.sh set-main-language <language>${NC}"
90
+ exit 1
91
+ fi
92
+
93
+ mkdir -p "$PROJECT_DIR/.claude"
94
+ echo "$language" > "$MAIN_LANG_FILE"
95
+ echo -e "${GREEN}✓${NC} Main language set to: $language"
96
+ }
97
+
98
+ # Get target language
99
+ get_target_language() {
100
+ if [[ -f "$TARGET_LANG_FILE" ]]; then
101
+ cat "$TARGET_LANG_FILE"
102
+ elif [[ -f "$GLOBAL_TARGET_LANG_FILE" ]]; then
103
+ cat "$GLOBAL_TARGET_LANG_FILE"
104
+ else
105
+ echo ""
106
+ fi
107
+ }
108
+
109
+ # Get greeting message for a language
110
+ get_greeting_for_language() {
111
+ local language="$1"
112
+
113
+ case "$(_to_lower "$language")" in
114
+ spanish|español)
115
+ echo "¡Hola! Soy tu profesor de español. ¡Vamos a aprender juntos!"
116
+ ;;
117
+ french|français)
118
+ echo "Bonjour! Je suis votre professeur de français. Apprenons ensemble!"
119
+ ;;
120
+ german|deutsch)
121
+ echo "Hallo! Ich bin dein Deutschlehrer. Lass uns zusammen lernen!"
122
+ ;;
123
+ italian|italiano)
124
+ echo "Ciao! Sono il tuo insegnante di italiano. Impariamo insieme!"
125
+ ;;
126
+ portuguese|português)
127
+ echo "Olá! Sou seu professor de português. Vamos aprender juntos!"
128
+ ;;
129
+ chinese|中文|mandarin)
130
+ echo "你好!我是你的中文老师。让我们一起学习吧!"
131
+ ;;
132
+ japanese|日本語)
133
+ echo "こんにちは!私はあなたの日本語の先生です。一緒に勉強しましょう!"
134
+ ;;
135
+ korean|한국어)
136
+ echo "안녕하세요! 저는 당신의 한국어 선생님입니다. 함께 배워봅시다!"
137
+ ;;
138
+ russian|русский)
139
+ echo "Здравствуйте! Я ваш учитель русского языка. Давайте учиться вместе!"
140
+ ;;
141
+ arabic|العربية)
142
+ echo "مرحبا! أنا معلمك للغة العربية. دعونا نتعلم معا!"
143
+ ;;
144
+ hindi|हिन्दी)
145
+ echo "नमस्ते! मैं आपका हिंदी शिक्षक हूं। आइए साथ में सीखें!"
146
+ ;;
147
+ dutch|nederlands)
148
+ echo "Hallo! Ik ben je Nederlandse leraar. Laten we samen leren!"
149
+ ;;
150
+ polish|polski)
151
+ echo "Cześć! Jestem twoim nauczycielem polskiego. Uczmy się razem!"
152
+ ;;
153
+ turkish|türkçe)
154
+ echo "Merhaba! Ben Türkçe öğretmeninizim. Birlikte öğrenelim!"
155
+ ;;
156
+ swedish|svenska)
157
+ echo "Hej! Jag är din svenskalärare. Låt oss lära tillsammans!"
158
+ ;;
159
+ *)
160
+ echo "Hello! I am your language teacher. Let's learn together!"
161
+ ;;
162
+ esac
163
+ }
164
+
165
+ # Set target language
166
+ set_target_language() {
167
+ local language="$1"
168
+ if [[ -z "$language" ]]; then
169
+ echo -e "${YELLOW}Usage: learn-manager.sh set-target-language <language>${NC}"
170
+ exit 1
171
+ fi
172
+
173
+ mkdir -p "$PROJECT_DIR/.claude"
174
+ echo "$language" > "$TARGET_LANG_FILE"
175
+ echo -e "${GREEN}✓${NC} Target language set to: $language"
176
+
177
+ # Automatically set the recommended voice for this language
178
+ local recommended_voice=$(get_recommended_voice_for_language "$language")
179
+ if [[ -n "$recommended_voice" ]]; then
180
+ echo "$recommended_voice" > "$TARGET_VOICE_FILE"
181
+ echo -e "${GREEN}✓${NC} Target voice automatically set to: ${YELLOW}$recommended_voice${NC}"
182
+
183
+ # Detect provider for display
184
+ local provider=""
185
+ if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
186
+ provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
187
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
188
+ provider=$(cat "$HOME/.claude/tts-provider.txt")
189
+ else
190
+ provider="piper"
191
+ fi
192
+ echo -e " (for ${GREEN}$provider${NC} TTS)"
193
+ echo ""
194
+
195
+ # Greet user in the target language with the target voice
196
+ local greeting=$(get_greeting_for_language "$language")
197
+ echo -e "${BLUE}🎓${NC} Your language teacher says:"
198
+
199
+ # Check if we're using Piper and if the voice is available
200
+ if [[ "$provider" == "piper" ]]; then
201
+ # Quick check: does the voice file exist?
202
+ local voice_dir="${HOME}/.claude/piper-voices"
203
+ if [[ -f "${voice_dir}/${recommended_voice}.onnx" ]]; then
204
+ # Voice exists, play greeting in background
205
+ nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$recommended_voice" >/dev/null 2>&1 &
206
+ else
207
+ echo -e "${YELLOW} (Voice not yet downloaded - greeting will play after first download)${NC}"
208
+ fi
209
+ else
210
+ # macOS or other provider - just play it in background
211
+ nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$recommended_voice" >/dev/null 2>&1 &
212
+ fi
213
+ else
214
+ # Fallback to suggestion if auto-set failed
215
+ suggest_voice_for_language "$language"
216
+ fi
217
+ }
218
+
219
+ # Get recommended voice for a language (returns voice string, no output)
220
+ get_recommended_voice_for_language() {
221
+ local language="$1"
222
+ local recommended_voice=""
223
+ local provider=""
224
+
225
+ # Detect active provider
226
+ if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
227
+ provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
228
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
229
+ provider=$(cat "$HOME/.claude/tts-provider.txt")
230
+ else
231
+ provider="piper" # Default
232
+ fi
233
+
234
+ # Source language manager and get provider-specific voice
235
+ if [[ -f "$SCRIPT_DIR/language-manager.sh" ]]; then
236
+ source "$SCRIPT_DIR/language-manager.sh" 2>/dev/null
237
+ recommended_voice=$(get_voice_for_language "$language" "$provider" 2>/dev/null)
238
+ fi
239
+
240
+ # Fallback to hardcoded suggestions if function failed
241
+ if [[ -z "$recommended_voice" ]]; then
242
+ case "$(_to_lower "$language")" in
243
+ spanish|español)
244
+ recommended_voice=$([ "$provider" = "piper" ] && echo "es_ES-davefx-medium" || echo "Antoni")
245
+ ;;
246
+ french|français)
247
+ recommended_voice=$([ "$provider" = "piper" ] && echo "fr_FR-siwis-medium" || echo "Rachel")
248
+ ;;
249
+ german|deutsch)
250
+ recommended_voice=$([ "$provider" = "piper" ] && echo "de_DE-thorsten-medium" || echo "Domi")
251
+ ;;
252
+ italian|italiano)
253
+ recommended_voice=$([ "$provider" = "piper" ] && echo "it_IT-riccardo-x_low" || echo "Bella")
254
+ ;;
255
+ portuguese|português)
256
+ recommended_voice=$([ "$provider" = "piper" ] && echo "pt_BR-faber-medium" || echo "Matilda")
257
+ ;;
258
+ chinese|中文|mandarin)
259
+ recommended_voice=$([ "$provider" = "piper" ] && echo "zh_CN-huayan-medium" || echo "Amy")
260
+ ;;
261
+ *)
262
+ recommended_voice=$([ "$provider" = "piper" ] && echo "en_US-lessac-medium" || echo "Antoni")
263
+ ;;
264
+ esac
265
+ fi
266
+
267
+ echo "$recommended_voice"
268
+ }
269
+
270
+ # Suggest voice based on target language (displays suggestion message)
271
+ suggest_voice_for_language() {
272
+ local language="$1"
273
+ local suggested_voice=$(get_recommended_voice_for_language "$language")
274
+
275
+ # Detect provider for display
276
+ local provider=""
277
+ if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
278
+ provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
279
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
280
+ provider=$(cat "$HOME/.claude/tts-provider.txt")
281
+ else
282
+ provider="piper"
283
+ fi
284
+
285
+ echo ""
286
+ echo -e "${BLUE}💡 Tip:${NC} For $language (using ${GREEN}$provider${NC} TTS), we recommend: ${YELLOW}$suggested_voice${NC}"
287
+ echo -e " Set it with: ${YELLOW}/agent-vibes:target-voice $suggested_voice${NC}"
288
+ }
289
+
290
+ # Get target voice
291
+ get_target_voice() {
292
+ if [[ -f "$TARGET_VOICE_FILE" ]]; then
293
+ cat "$TARGET_VOICE_FILE"
294
+ elif [[ -f "$GLOBAL_TARGET_VOICE_FILE" ]]; then
295
+ cat "$GLOBAL_TARGET_VOICE_FILE"
296
+ else
297
+ echo ""
298
+ fi
299
+ }
300
+
301
+ # Set target voice
302
+ set_target_voice() {
303
+ local voice="$1"
304
+ if [[ -z "$voice" ]]; then
305
+ echo -e "${YELLOW}Usage: learn-manager.sh set-target-voice <voice>${NC}"
306
+ exit 1
307
+ fi
308
+
309
+ mkdir -p "$PROJECT_DIR/.claude"
310
+ echo "$voice" > "$TARGET_VOICE_FILE"
311
+ echo -e "${GREEN}✓${NC} Target voice set to: $voice"
312
+ }
313
+
314
+ # Check if learning mode is enabled
315
+ is_learn_mode_enabled() {
316
+ if [[ -f "$LEARN_MODE_FILE" ]]; then
317
+ local mode=$(cat "$LEARN_MODE_FILE")
318
+ [[ "$mode" == "ON" ]]
319
+ elif [[ -f "$GLOBAL_LEARN_MODE_FILE" ]]; then
320
+ local mode=$(cat "$GLOBAL_LEARN_MODE_FILE")
321
+ [[ "$mode" == "ON" ]]
322
+ else
323
+ return 1
324
+ fi
325
+ }
326
+
327
+ # Enable learning mode
328
+ enable_learn_mode() {
329
+ mkdir -p "$PROJECT_DIR/.claude"
330
+ echo "ON" > "$LEARN_MODE_FILE"
331
+ echo -e "${GREEN}✓${NC} Language learning mode: ${GREEN}ENABLED${NC}"
332
+ echo ""
333
+
334
+ # Auto-set target voice if target language is set but voice is not
335
+ local target_lang=$(get_target_language)
336
+ local target_voice=$(get_target_voice)
337
+ local voice_was_set=false
338
+
339
+ if [[ -n "$target_lang" ]] && [[ -z "$target_voice" ]]; then
340
+ echo -e "${BLUE}ℹ${NC} Auto-configuring voice for $target_lang..."
341
+ local recommended_voice=$(get_recommended_voice_for_language "$target_lang")
342
+ if [[ -n "$recommended_voice" ]]; then
343
+ echo "$recommended_voice" > "$TARGET_VOICE_FILE"
344
+ target_voice="$recommended_voice"
345
+ echo -e "${GREEN}✓${NC} Target voice automatically set to: ${YELLOW}$recommended_voice${NC}"
346
+
347
+ # Detect provider for display
348
+ local provider=""
349
+ if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
350
+ provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
351
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
352
+ provider=$(cat "$HOME/.claude/tts-provider.txt")
353
+ else
354
+ provider="piper"
355
+ fi
356
+ echo -e " (for ${GREEN}$provider${NC} TTS)"
357
+ echo ""
358
+ voice_was_set=true
359
+ fi
360
+ fi
361
+
362
+ show_status
363
+
364
+ # Greet user with language teacher if everything is configured
365
+ if [[ -n "$target_lang" ]] && [[ -n "$target_voice" ]]; then
366
+ echo ""
367
+ local greeting=$(get_greeting_for_language "$target_lang")
368
+ echo -e "${BLUE}🎓${NC} Your language teacher says:"
369
+
370
+ # Detect provider
371
+ local provider=""
372
+ if [[ -f "$PROJECT_DIR/.claude/tts-provider.txt" ]]; then
373
+ provider=$(cat "$PROJECT_DIR/.claude/tts-provider.txt")
374
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
375
+ provider=$(cat "$HOME/.claude/tts-provider.txt")
376
+ else
377
+ provider="piper"
378
+ fi
379
+
380
+ # Check if we're using Piper and if the voice is available
381
+ if [[ "$provider" == "piper" ]]; then
382
+ # Quick check: does the voice file exist?
383
+ local voice_dir="${HOME}/.claude/piper-voices"
384
+ if [[ -f "${voice_dir}/${target_voice}.onnx" ]]; then
385
+ # Voice exists, play greeting in background
386
+ nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$target_voice" >/dev/null 2>&1 &
387
+ else
388
+ echo -e "${YELLOW} (Voice not yet downloaded - greeting will play after first download)${NC}"
389
+ fi
390
+ else
391
+ # macOS or other provider - just play it in background
392
+ nohup "$SCRIPT_DIR/play-tts.sh" "$greeting" "$target_voice" >/dev/null 2>&1 &
393
+ fi
394
+ fi
395
+ }
396
+
397
+ # Disable learning mode
398
+ disable_learn_mode() {
399
+ mkdir -p "$PROJECT_DIR/.claude"
400
+ echo "OFF" > "$LEARN_MODE_FILE"
401
+ echo -e "${GREEN}✓${NC} Language learning mode: ${YELLOW}DISABLED${NC}"
402
+ }
403
+
404
+ # Show learning mode status
405
+ show_status() {
406
+ local main_lang=$(get_main_language)
407
+ local target_lang=$(get_target_language)
408
+ local target_voice=$(get_target_voice)
409
+ local learn_mode="OFF"
410
+
411
+ if is_learn_mode_enabled; then
412
+ learn_mode="ON"
413
+ fi
414
+
415
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
416
+ echo -e "${BLUE} Language Learning Mode Status${NC}"
417
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
418
+ echo ""
419
+ echo -e " ${BLUE}Learning Mode:${NC} $(if [[ "$learn_mode" == "ON" ]]; then echo -e "${GREEN}ENABLED${NC}"; else echo -e "${YELLOW}DISABLED${NC}"; fi)"
420
+ echo -e " ${BLUE}Main Language:${NC} $main_lang"
421
+ echo -e " ${BLUE}Target Language:${NC} ${target_lang:-"(not set)"}"
422
+ echo -e " ${BLUE}Target Voice:${NC} ${target_voice:-"(not set)"}"
423
+ echo ""
424
+
425
+ if [[ "$learn_mode" == "ON" ]]; then
426
+ if [[ -z "$target_lang" ]]; then
427
+ echo -e " ${YELLOW}⚠${NC} Please set a target language: ${YELLOW}/agent-vibes:target <language>${NC}"
428
+ fi
429
+ if [[ -z "$target_voice" ]]; then
430
+ echo -e " ${YELLOW}⚠${NC} Please set a target voice: ${YELLOW}/agent-vibes:target-voice <voice>${NC}"
431
+ fi
432
+
433
+ if [[ -n "$target_lang" ]] && [[ -n "$target_voice" ]]; then
434
+ echo -e " ${GREEN}✓${NC} All set! TTS will speak in both languages."
435
+ echo ""
436
+ echo -e " ${BLUE}How it works:${NC}"
437
+ echo -e " 1. First: Speak in ${BLUE}$main_lang${NC} (your current voice)"
438
+ echo -e " 2. Then: Speak in ${BLUE}$target_lang${NC} ($target_voice voice)"
439
+ fi
440
+ else
441
+ echo -e " ${BLUE}💡 Tip:${NC} Enable learning mode with: ${YELLOW}/agent-vibes:learn${NC}"
442
+ fi
443
+
444
+ echo ""
445
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
446
+ }
447
+
448
+ # Main command handler - only run if script is executed directly, not sourced
449
+ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
450
+ case "${1:-}" in
451
+ get-main-language)
452
+ get_main_language
453
+ ;;
454
+ set-main-language)
455
+ set_main_language "$2"
456
+ ;;
457
+ get-target-language)
458
+ get_target_language
459
+ ;;
460
+ set-target-language)
461
+ set_target_language "$2"
462
+ ;;
463
+ get-target-voice)
464
+ get_target_voice
465
+ ;;
466
+ set-target-voice)
467
+ set_target_voice "$2"
468
+ ;;
469
+ is-enabled)
470
+ if is_learn_mode_enabled; then
471
+ echo "ON"
472
+ exit 0
473
+ else
474
+ echo "OFF"
475
+ exit 1
476
+ fi
477
+ ;;
478
+ enable)
479
+ enable_learn_mode
480
+ ;;
481
+ disable)
482
+ disable_learn_mode
483
+ ;;
484
+ status)
485
+ show_status
486
+ ;;
487
+ *)
488
+ echo "Usage: learn-manager.sh {get-main-language|set-main-language|get-target-language|set-target-language|get-target-voice|set-target-voice|is-enabled|enable|disable|status}"
489
+ exit 1
490
+ ;;
491
+ esac
492
+ fi