agentvibes 5.12.0 → 5.13.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 (72) hide show
  1. package/.claude/commands/agent-vibes/commands.json +0 -20
  2. package/.claude/commands/agent-vibes/unmute.md +6 -2
  3. package/.claude/config/audio-effects.cfg +6 -6
  4. package/.claude/github-star-reminder.txt +1 -1
  5. package/.claude/hooks/agentvibes-session-id.sh +69 -0
  6. package/.claude/hooks/bmad-party-speak.sh +20 -4
  7. package/.claude/hooks/bmad-speak.sh +60 -2
  8. package/.claude/hooks/bmad-tts-injector.sh +20 -1
  9. package/.claude/hooks/bmad-voice-manager.sh +25 -3
  10. package/.claude/hooks/clawdbot-receiver-SECURE.sh +21 -2
  11. package/.claude/hooks/clawdbot-receiver.sh +19 -1
  12. package/.claude/hooks/elevenlabs-voices.sh +62 -0
  13. package/.claude/hooks/kokoro-installer.sh +20 -10
  14. package/.claude/hooks/language-manager.sh +10 -3
  15. package/.claude/hooks/party-set-room.sh +71 -0
  16. package/.claude/hooks/party-stage-roster.py +328 -0
  17. package/.claude/hooks/personality-manager.sh +19 -2
  18. package/.claude/hooks/piper-voice-manager.sh +3 -2
  19. package/.claude/hooks/play-tts-agentvibes-receiver-for-voiceless-connections.sh +24 -5
  20. package/.claude/hooks/play-tts-elevenlabs.sh +38 -118
  21. package/.claude/hooks/play-tts-kokoro.sh +33 -6
  22. package/.claude/hooks/play-tts-soprano.sh +3 -2
  23. package/.claude/hooks/play-tts-ssh-remote.sh +37 -29
  24. package/.claude/hooks/play-tts-termux-ssh.sh +5 -4
  25. package/.claude/hooks/play-tts.sh +66 -61
  26. package/.claude/hooks/provider-catalog.json +352 -0
  27. package/.claude/hooks/provider-catalog.sh +161 -0
  28. package/.claude/hooks/provider-commands.sh +2 -1
  29. package/.claude/hooks/provider-manager.sh +47 -9
  30. package/.claude/hooks/python-resolver.sh +117 -0
  31. package/.claude/hooks/session-id.sh +56 -0
  32. package/.claude/hooks/session-start-tts.sh +39 -0
  33. package/.claude/hooks/speed-manager.sh +1 -1
  34. package/.claude/hooks/translate-manager.sh +3 -2
  35. package/.claude/hooks/translator.py +1 -1
  36. package/.claude/hooks/voice-manager.sh +242 -10
  37. package/.claude/hooks-windows/language-manager.ps1 +7 -1
  38. package/.claude/hooks-windows/personality-manager.ps1 +16 -1
  39. package/.claude/hooks-windows/play-tts-kokoro.ps1 +20 -4
  40. package/.claude/hooks-windows/play-tts.ps1 +32 -3
  41. package/.claude/hooks-windows/provider-catalog.ps1 +140 -0
  42. package/.claude/hooks-windows/provider-manager.ps1 +63 -8
  43. package/.claude/hooks-windows/tts-watcher.ps1 +33 -12
  44. package/.claude/hooks-windows/voice-manager-windows.ps1 +49 -0
  45. package/.mcp.json +0 -7
  46. package/README.md +12 -3
  47. package/RELEASE_NOTES.md +43 -0
  48. package/mcp-server/server.py +146 -49
  49. package/mcp-server/test_mcp_correctness.py +20 -2
  50. package/mcp-server/test_windows_script_parity.py +0 -2
  51. package/package.json +1 -1
  52. package/src/cli/list-voices.js +218 -114
  53. package/src/console/bling.js +71 -0
  54. package/src/console/music-preview.js +79 -0
  55. package/src/console/tabs/music-tab.js +16 -39
  56. package/src/console/tabs/settings-tab.js +195 -13
  57. package/src/console/tabs/setup-tab.js +9 -34
  58. package/src/console/tabs/voices-tab.js +83 -14
  59. package/src/console/widgets/track-picker.js +82 -0
  60. package/src/installer.js +124 -10
  61. package/src/services/provider-catalog.js +412 -0
  62. package/src/services/provider-voice-catalog.js +52 -73
  63. package/src/services/tts-engine-service.js +29 -0
  64. package/src/utils/provider-validator.js +62 -12
  65. package/.claude/commands/agent-vibes/language.md +0 -23
  66. package/.claude/commands/agent-vibes/learn.md +0 -67
  67. package/.claude/commands/agent-vibes/replay-target.md +0 -14
  68. package/.claude/commands/agent-vibes/target-voice.md +0 -26
  69. package/.claude/commands/agent-vibes/target.md +0 -30
  70. package/.claude/hooks/learn-manager.sh +0 -492
  71. package/.claude/hooks/replay-target-audio.sh +0 -95
  72. package/.claude/hooks-windows/learn-manager.ps1 +0 -241
@@ -1,492 +0,0 @@
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,95 +0,0 @@
1
- #!/usr/bin/env bash
2
- #
3
- # File: .claude/hooks/replay-target-audio.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, including but not limited to the warranties of
26
- # merchantability, fitness for a particular purpose and noninfringement.
27
- # In no event shall the authors or copyright holders be liable for any claim,
28
- # damages or other liability, whether in an action of contract, tort or
29
- # otherwise, arising from, out of or in connection with the software or the
30
- # use or other dealings in the software.
31
- #
32
- # ---
33
- #
34
- # @fileoverview Replay Last Target Language Audio
35
- # @context Replays the most recent target language TTS for language learning
36
- # @architecture Simple audio replay with lock mechanism for sequential playback
37
- # @dependencies ffprobe, paplay/aplay/mpg123/mpv, .claude/last-target-audio.txt
38
- # @entrypoints Called by /agent-vibes:replay-target slash command
39
- # @patterns Sequential audio playback with lock file, duration-based lock release
40
- # @related play-tts-piper.sh, play-tts-macos.sh, learn-manager.sh
41
- #
42
-
43
- # Fix locale warnings
44
- export LC_ALL=C
45
-
46
- TARGET_AUDIO_FILE="${CLAUDE_PROJECT_DIR:-.}/.claude/last-target-audio.txt"
47
-
48
- # Check if target audio tracking file exists
49
- if [ ! -f "$TARGET_AUDIO_FILE" ]; then
50
- echo "❌ No target language audio found."
51
- echo " Language learning mode may not be active."
52
- echo " Activate with: /agent-vibes:learn"
53
- exit 1
54
- fi
55
-
56
- # Read last target audio file path
57
- LAST_AUDIO=$(cat "$TARGET_AUDIO_FILE")
58
-
59
- # Verify audio file exists
60
- if [ ! -f "$LAST_AUDIO" ]; then
61
- echo "❌ Audio file not found: $LAST_AUDIO"
62
- echo " The file may have been deleted or moved."
63
- exit 1
64
- fi
65
-
66
- echo "🔁 Replaying target language audio..."
67
-
68
- # Use lock file for sequential playback
69
- LOCK_FILE="/tmp/agentvibes-audio.lock"
70
-
71
- # Wait for any current audio to finish (max 30 seconds)
72
- for i in {1..60}; do
73
- if [ ! -f "$LOCK_FILE" ]; then
74
- break
75
- fi
76
- sleep 0.5
77
- done
78
-
79
- # Create lock
80
- touch "$LOCK_FILE"
81
-
82
- # Get audio duration for proper lock timing
83
- DURATION=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$LAST_AUDIO" 2>/dev/null)
84
- DURATION=${DURATION%.*} # Round to integer
85
- DURATION=${DURATION:-1} # Default to 1 second if detection fails
86
-
87
- # Play audio
88
- (paplay "$LAST_AUDIO" || aplay "$LAST_AUDIO" || mpg123 "$LAST_AUDIO" || mpv "$LAST_AUDIO") >/dev/null 2>&1 &
89
- PLAYER_PID=$!
90
-
91
- # Wait for audio to finish, then release lock
92
- (sleep $DURATION; rm -f "$LOCK_FILE") &
93
- disown
94
-
95
- echo "✅ Replay complete: $(basename "$LAST_AUDIO")"