agentvibes 2.2.0-beta.7 → 2.2.0-beta.8

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.
@@ -1,11 +1,25 @@
1
1
  ---
2
- description: Switch to a different ElevenLabs TTS voice
2
+ description: Switch to a different TTS voice (provider-aware)
3
3
  argument-hint: [voice_name_or_number] [--sentiment personality_name]
4
4
  ---
5
5
 
6
6
  # Voice Selection
7
7
 
8
- If no arguments provided, display this list:
8
+ ## Step 1: Detect Active Provider
9
+
10
+ First, check which TTS provider is active by running:
11
+
12
+ ```bash
13
+ !bash .claude/hooks/voice-manager.sh whoami
14
+ ```
15
+
16
+ This will show the current provider (ElevenLabs or Piper) and current voice.
17
+
18
+ ## Step 2: Display Voice List Based on Provider
19
+
20
+ ### If Provider is ElevenLabs:
21
+
22
+ Show this list:
9
23
 
10
24
  ## 🎤 Available ElevenLabs Voices
11
25
 
@@ -24,11 +38,19 @@ If no arguments provided, display this list:
24
38
  13. **Northern Terry** - Eccentric British
25
39
  14. **Ralf Eisend** - International speaker
26
40
 
27
- Then check current voice with: !bash .claude/hooks/voice-manager.sh get
41
+ ### If Provider is Piper:
42
+
43
+ Run this command to list Piper voices:
28
44
 
29
- And inform user: "To switch voices, use `/agent-vibes:switch <number>` or `/agent-vibes:switch <name>`"
45
+ ```bash
46
+ !bash .claude/hooks/voice-manager.sh list
47
+ ```
48
+
49
+ This will show all downloaded Piper voices including multi-speaker voices.
30
50
 
31
- If arguments ARE provided:
51
+ ## Step 3: Voice Switching
52
+
53
+ If user provides a voice name or number:
32
54
 
33
55
  1. Parse arguments for --sentiment flag
34
56
  2. If --sentiment is present:
@@ -39,15 +61,27 @@ If arguments ARE provided:
39
61
  3. If no --sentiment flag:
40
62
  - Execute: !bash .claude/hooks/voice-manager.sh switch $ARGUMENTS
41
63
 
64
+ If no arguments provided:
65
+ - Show the voice list based on active provider (as described in Step 2)
66
+ - Inform user: "To switch voices, use `/agent-vibes:switch <number>` or `/agent-vibes:switch <name>`"
67
+
42
68
  ## Examples
43
69
 
44
70
  ```bash
45
71
  # Switch voice only
46
- /agent-vibes:switch Jessica Anne Bogart
72
+ /agent-vibes:switch Jessica Anne Bogart # ElevenLabs
73
+ /agent-vibes:switch en_US-lessac-medium # Piper
74
+
75
+ # Switch voice by number
76
+ /agent-vibes:switch 5
47
77
 
48
78
  # Switch voice and set sentiment
49
79
  /agent-vibes:switch Aria --sentiment sarcastic
50
-
51
- # Switch by number with sentiment
52
80
  /agent-vibes:switch 5 --sentiment flirty
53
81
  ```
82
+
83
+ ## Important Notes
84
+
85
+ - The voice list MUST match the active provider (don't show ElevenLabs voices when Piper is active!)
86
+ - Always check whoami first to determine which provider is active
87
+ - For Piper, use `voice-manager.sh list` to get the actual downloaded voices
@@ -63,6 +63,21 @@ fi
63
63
 
64
64
  VOICE_FILE="$CLAUDE_DIR/tts-voice.txt"
65
65
 
66
+ # Helper function to get default voice based on active provider
67
+ get_default_voice() {
68
+ local provider_file="$CLAUDE_DIR/tts-provider.txt"
69
+ [[ ! -f "$provider_file" ]] && provider_file="$HOME/.claude/tts-provider.txt"
70
+
71
+ local active_provider="elevenlabs"
72
+ [[ -f "$provider_file" ]] && active_provider=$(cat "$provider_file")
73
+
74
+ if [[ "$active_provider" == "piper" ]]; then
75
+ echo "en_US-lessac-medium" # Piper default
76
+ else
77
+ echo "Cowboy Bob" # ElevenLabs default
78
+ fi
79
+ }
80
+
66
81
  case "$1" in
67
82
  list)
68
83
  # Get active provider
@@ -76,7 +91,7 @@ case "$1" in
76
91
  ACTIVE_PROVIDER=$(cat "$PROVIDER_FILE")
77
92
  fi
78
93
 
79
- CURRENT_VOICE=$(cat "$VOICE_FILE" 2>/dev/null || echo "Cowboy Bob")
94
+ CURRENT_VOICE=$(cat "$VOICE_FILE" 2>/dev/null || get_default_voice)
80
95
 
81
96
  if [[ "$ACTIVE_PROVIDER" == "piper" ]]; then
82
97
  echo "🎤 Available Piper TTS Voices:"
@@ -86,24 +101,28 @@ case "$1" in
86
101
  if [[ -f "$SCRIPT_DIR/piper-voice-manager.sh" ]]; then
87
102
  source "$SCRIPT_DIR/piper-voice-manager.sh"
88
103
  VOICE_DIR=$(get_voice_storage_dir)
89
- VOICE_COUNT=0
104
+
105
+ # Collect voices first to count them properly
106
+ VOICE_LIST=()
90
107
  for onnx_file in "$VOICE_DIR"/*.onnx; do
91
108
  if [[ -f "$onnx_file" ]]; then
92
109
  voice=$(basename "$onnx_file" .onnx)
93
110
  if [ "$voice" = "$CURRENT_VOICE" ]; then
94
- echo " ▶ $voice (current)"
111
+ VOICE_LIST+=(" ▶ $voice (current)")
95
112
  else
96
- echo " $voice"
113
+ VOICE_LIST+=(" $voice")
97
114
  fi
98
- ((VOICE_COUNT++))
99
115
  fi
100
- done | sort
116
+ done
101
117
 
102
- if [[ $VOICE_COUNT -eq 0 ]]; then
118
+ if [[ ${#VOICE_LIST[@]} -eq 0 ]]; then
103
119
  echo " (No Piper voices downloaded yet)"
104
120
  echo ""
105
121
  echo "Download voices with: /agent-vibes:provider download <voice-name>"
106
122
  echo "Examples: en_US-lessac-medium, en_GB-alba-medium"
123
+ else
124
+ # Sort and display voices
125
+ printf "%s\n" "${VOICE_LIST[@]}" | sort
107
126
  fi
108
127
  fi
109
128
  else
@@ -197,10 +216,7 @@ case "$1" in
197
216
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
198
217
 
199
218
  # Get current voice
200
- CURRENT="Cowboy Bob"
201
- if [ -f "$VOICE_FILE" ]; then
202
- CURRENT=$(cat "$VOICE_FILE")
203
- fi
219
+ CURRENT=$(cat "$VOICE_FILE" 2>/dev/null || get_default_voice)
204
220
 
205
221
  # Create array of voice names
206
222
  VOICE_ARRAY=()
@@ -424,7 +440,7 @@ case "$1" in
424
440
  if [ -f "$VOICE_FILE" ]; then
425
441
  cat "$VOICE_FILE"
426
442
  else
427
- echo "Cowboy Bob"
443
+ get_default_voice
428
444
  fi
429
445
  ;;
430
446
 
@@ -453,11 +469,7 @@ case "$1" in
453
469
  fi
454
470
 
455
471
  # Get current voice
456
- if [ -f "$VOICE_FILE" ]; then
457
- CURRENT_VOICE=$(cat "$VOICE_FILE")
458
- else
459
- CURRENT_VOICE="Cowboy Bob"
460
- fi
472
+ CURRENT_VOICE=$(cat "$VOICE_FILE" 2>/dev/null || get_default_voice)
461
473
  echo "Voice: $CURRENT_VOICE"
462
474
 
463
475
  # Get current sentiment (priority)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "agentvibes",
4
- "version": "2.2.0-beta.7",
4
+ "version": "2.2.0-beta.8",
5
5
  "description": "Now your AI Agents can finally talk back! Professional TTS voice for Claude Code and Claude Desktop (via MCP) with multi-provider support.",
6
6
  "homepage": "https://agentvibes.org",
7
7
  "keywords": [