agentvibes 2.9.0 → 2.9.2

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.
@@ -136,7 +136,18 @@ auto_enable_if_bmad_detected() {
136
136
  get_agent_voice() {
137
137
  local agent_id="$1"
138
138
 
139
- # Auto-enable if BMAD is detected
139
+ # Check for BMAD v6 CSV file first (preferred, loose coupling)
140
+ # If this exists, use it directly without requiring plugin enable flag
141
+ local bmad_voice_map=".bmad/_cfg/agent-voice-map.csv"
142
+ if [[ -f "$bmad_voice_map" ]]; then
143
+ # Read from BMAD's standard _cfg directory
144
+ # CSV format: agent_id,voice_name
145
+ local voice=$(grep "^$agent_id," "$bmad_voice_map" | cut -d',' -f2)
146
+ echo "$voice"
147
+ return
148
+ fi
149
+
150
+ # Auto-enable if BMAD is detected (for legacy markdown config)
140
151
  auto_enable_if_bmad_detected
141
152
 
142
153
  if [[ ! -f "$ENABLED_FLAG" ]]; then
@@ -144,6 +155,7 @@ get_agent_voice() {
144
155
  return
145
156
  fi
146
157
 
158
+ # Fallback to legacy markdown config file
147
159
  if [[ ! -f "$VOICE_CONFIG_FILE" ]]; then
148
160
  echo "" # Plugin file missing
149
161
  return
@@ -51,11 +51,12 @@ fi
51
51
 
52
52
  # Common voice models to download
53
53
  COMMON_VOICES=(
54
- "en_US-lessac-medium" # Default, clear male
55
- "en_US-amy-medium" # Warm female
56
- "en_US-joe-medium" # Professional male
57
- "en_US-ryan-high" # Expressive male
58
- "en_US-libritts-high" # Premium quality
54
+ "en_US-lessac-medium" # Default, clear male (13MB)
55
+ "en_US-amy-medium" # Warm female (13MB)
56
+ "en_US-joe-medium" # Professional male (13MB)
57
+ "en_US-ryan-high" # Expressive male (30MB)
58
+ "en_US-libritts-high" # Premium quality (57MB)
59
+ "16Speakers" # Multi-speaker: 12 US + 4 UK voices (77MB) - REQUIRED for BMAD agents
59
60
  )
60
61
 
61
62
  echo "🎙️ Piper Voice Model Downloader"
@@ -163,3 +164,7 @@ if [[ $DOWNLOADED -gt 0 ]]; then
163
164
  echo " /agent-vibes:provider switch piper"
164
165
  echo " /agent-vibes:preview"
165
166
  fi
167
+
168
+ # Always exit successfully even if some downloads failed
169
+ # (individual failures are tracked in FAILED counter)
170
+ exit 0
@@ -223,7 +223,7 @@ download_voice() {
223
223
 
224
224
  # Download ONNX model
225
225
  echo " Downloading model file..."
226
- if ! curl -L --progress-bar -o "$voice_dir/${voice_name}.onnx" "$onnx_url"; then
226
+ if ! curl -L --progress-bar --connect-timeout 30 --max-time 300 -o "$voice_dir/${voice_name}.onnx" "$onnx_url"; then
227
227
  echo "❌ Failed to download voice model"
228
228
  rm -f "$voice_dir/${voice_name}.onnx"
229
229
  return 1
@@ -231,7 +231,7 @@ download_voice() {
231
231
 
232
232
  # Download JSON config
233
233
  echo " Downloading config file..."
234
- if ! curl -L -s -o "$voice_dir/${voice_name}.onnx.json" "$json_url"; then
234
+ if ! curl -L -s --connect-timeout 30 --max-time 60 -o "$voice_dir/${voice_name}.onnx.json" "$json_url"; then
235
235
  echo "❌ Failed to download voice config"
236
236
  rm -f "$voice_dir/${voice_name}.onnx" "$voice_dir/${voice_name}.onnx.json"
237
237
  return 1
@@ -0,0 +1,130 @@
1
+ # 🎙️ Testing Instructions for AgentVibes Party Mode PR
2
+
3
+ ## Prerequisites
4
+ - Node.js and npm installed
5
+ - Git installed
6
+ - Fresh terminal session
7
+
8
+ ## Quick Test (5-10 minutes)
9
+
10
+ ### Step 1: Fork and Clone BMAD
11
+ ```bash
12
+ # Fork the BMAD repo on GitHub first, then:
13
+ git clone https://github.com/YOUR-USERNAME/BMAD-METHOD.git
14
+ cd BMAD-METHOD
15
+ ```
16
+
17
+ ### Step 2: Merge the PR Branch
18
+ ```bash
19
+ # Add the upstream remote
20
+ git remote add upstream https://github.com/bmad-code-org/BMAD-METHOD.git
21
+
22
+ # Fetch and merge the PR
23
+ git fetch upstream pull/934/head:agentvibes-party-mode
24
+ git checkout agentvibes-party-mode
25
+ ```
26
+
27
+ ### Step 3: Install BMAD from Your Fork
28
+ ```bash
29
+ # Navigate to the CLI installer directory
30
+ cd tools/cli
31
+
32
+ # Install dependencies
33
+ npm install
34
+
35
+ # Link it globally so you can run 'bmad' command
36
+ npm link
37
+
38
+ # Navigate to where you want to create your BMAD project
39
+ cd ~
40
+ mkdir my-bmad-test
41
+ cd my-bmad-test
42
+
43
+ # Run the BMAD installer (now using your forked version with the PR)
44
+ bmad install
45
+
46
+ # When prompted about AgentVibes TTS:
47
+ # - Answer "Yes" to enable TTS for agents
48
+ # - Answer "Yes" to assign unique voices for party mode
49
+ ```
50
+
51
+ ### Step 4: Install AgentVibes (if not already installed)
52
+ ```bash
53
+ # If you don't have AgentVibes yet:
54
+ npx agentvibes@latest install
55
+
56
+ # Follow the installer:
57
+ # - Choose a TTS provider (ElevenLabs or Piper)
58
+ # - For Piper (free): it will auto-download voices including 16Speakers
59
+ # - For ElevenLabs: you'll need an API key
60
+ ```
61
+
62
+ ### Step 5: Test Party Mode! 🎉
63
+ ```bash
64
+ # Start a Claude Code session in your BMAD project directory (my-bmad-test)
65
+ # Then run party mode:
66
+ /bmad:core:workflows:party-mode
67
+
68
+ # You should hear each BMAD agent speak with their own unique voice!
69
+ ```
70
+
71
+ ## What to Test
72
+
73
+ ### ✅ Installation Flow
74
+ - [ ] BMAD installer detects AgentVibes
75
+ - [ ] Installer prompts about TTS setup
76
+ - [ ] Voice assignment file `.bmad/agent-voice-assignments.json` is created
77
+ - [ ] All agents have TTS markers injected
78
+
79
+ ### ✅ Party Mode Voices
80
+ - [ ] Each agent speaks with a different voice
81
+ - [ ] Voices match agent personalities (e.g., architect sounds professional)
82
+ - [ ] No voice overlap between agents
83
+ - [ ] TTS works smoothly during multi-agent discussions
84
+
85
+ ### ✅ Fallback Behavior
86
+ - [ ] If you skip TTS setup, agents still work normally (no errors)
87
+ - [ ] Party mode works without TTS (silent mode)
88
+
89
+ ## Troubleshooting
90
+
91
+ **"bmad command not found"**
92
+ - Make sure you ran `npm link` in `BMAD-METHOD/tools/cli`
93
+ - Try running with full path: `node tools/cli/index.js install` from BMAD-METHOD root
94
+
95
+ **"No TTS heard during party mode"**
96
+ - Check `.claude/hooks/play-tts.sh` exists
97
+ - Verify `.bmad/agent-voice-assignments.json` was created
98
+ - Try: `/agent-vibes:whoami` to check active voice
99
+
100
+ **"All agents sound the same"**
101
+ - Check `.bmad/agent-voice-assignments.json` has unique voices per agent
102
+ - For Piper: ensure 16Speakers model downloaded (has 16 voices)
103
+ - Try: `/agent-vibes:list` to see available voices
104
+
105
+ **"Installation fails"**
106
+ - Make sure you're on the PR branch: `git branch` (should show `agentvibes-party-mode`)
107
+ - Try clean install in tools/cli: `rm -rf node_modules package-lock.json && npm install`
108
+
109
+ ## Expected Output
110
+
111
+ When party mode works correctly, you'll see something like:
112
+ ```
113
+ 🎭 architect speaking... (Voice: matthew)
114
+ 🎭 dev speaking... (Voice: ryan)
115
+ 🎭 pm speaking... (Voice: amy)
116
+ ```
117
+
118
+ Each agent's responses will be spoken aloud with their assigned voice!
119
+
120
+ ## Report Issues
121
+
122
+ Please comment on the PR with:
123
+ - ✅ What worked
124
+ - ❌ What didn't work
125
+ - 📋 Your OS (Linux/Mac/Windows)
126
+ - 🎤 TTS provider used (Piper/ElevenLabs)
127
+
128
+ ---
129
+
130
+ **PR Link:** https://github.com/bmad-code-org/BMAD-METHOD/pull/934
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.9.0",
4
+ "version": "2.9.2",
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": [
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env bats
2
+ #
3
+ # File: test/piper-installation.bats
4
+ #
5
+ # Piper TTS Installation Tests
6
+ # Tests the complete Piper installation flow including voice downloads
7
+ #
8
+
9
+ setup() {
10
+ # Test environment setup
11
+ export AGENTVIBES_TEST_MODE="true"
12
+
13
+ # For integration tests, use real HOME to allow Piper installation
14
+ # For unit tests, use temp HOME for isolation
15
+ if [ -z "$PIPER_INTEGRATION_TEST" ]; then
16
+ export HOME="${BATS_TEST_TMPDIR}/home"
17
+ mkdir -p "$HOME"
18
+ fi
19
+ # else: use real $HOME for integration tests
20
+
21
+ # Create temporary project directory
22
+ export TEST_PROJECT_DIR="${BATS_TEST_TMPDIR}/agentvibes-test"
23
+ mkdir -p "$TEST_PROJECT_DIR"
24
+ cd "$TEST_PROJECT_DIR"
25
+
26
+ # Copy necessary files for installation
27
+ cp -r "$BATS_TEST_DIRNAME/../.claude" "$TEST_PROJECT_DIR/"
28
+
29
+ # Expected voice models
30
+ export EXPECTED_VOICES=(
31
+ "en_US-lessac-medium"
32
+ "en_US-amy-medium"
33
+ "en_US-joe-medium"
34
+ "en_US-ryan-high"
35
+ "en_US-libritts-high"
36
+ "16Speakers"
37
+ )
38
+ }
39
+
40
+ teardown() {
41
+ # Cleanup test environment
42
+ cd "$BATS_TEST_DIRNAME"
43
+ rm -rf "$TEST_PROJECT_DIR"
44
+
45
+ # Only remove temp HOME for unit tests, not integration tests
46
+ if [ -z "$PIPER_INTEGRATION_TEST" ]; then
47
+ rm -rf "$HOME"
48
+ fi
49
+ }
50
+
51
+ @test "Piper installer script exists and is executable" {
52
+ [ -f "$TEST_PROJECT_DIR/.claude/hooks/piper-installer.sh" ]
53
+ [ -x "$TEST_PROJECT_DIR/.claude/hooks/piper-installer.sh" ]
54
+ }
55
+
56
+ @test "Piper voice downloader script exists and is executable" {
57
+ [ -f "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh" ]
58
+ [ -x "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh" ]
59
+ }
60
+
61
+ @test "Piper voice manager script exists" {
62
+ [ -f "$TEST_PROJECT_DIR/.claude/hooks/piper-voice-manager.sh" ]
63
+ }
64
+
65
+ @test "Non-interactive flag is supported in piper-installer.sh" {
66
+ run grep -q "NON_INTERACTIVE" "$TEST_PROJECT_DIR/.claude/hooks/piper-installer.sh"
67
+ [ "$status" -eq 0 ]
68
+ }
69
+
70
+ @test "Yes flag is supported in piper-download-voices.sh" {
71
+ run grep -q "AUTO_YES" "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh"
72
+ [ "$status" -eq 0 ]
73
+ }
74
+
75
+ @test "Download script has explicit exit 0" {
76
+ run grep -q "exit 0" "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh"
77
+ [ "$status" -eq 0 ]
78
+ }
79
+
80
+ @test "All expected voices are in COMMON_VOICES array" {
81
+ for voice in "${EXPECTED_VOICES[@]}"; do
82
+ run grep -q "\"$voice\"" "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh"
83
+ [ "$status" -eq 0 ]
84
+ done
85
+ }
86
+
87
+ @test "16Speakers model is included in download list" {
88
+ run grep -q "16Speakers" "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh"
89
+ [ "$status" -eq 0 ]
90
+ }
91
+
92
+ @test "Curl timeouts are configured in voice manager" {
93
+ run grep -q "\-\-connect-timeout" "$TEST_PROJECT_DIR/.claude/hooks/piper-voice-manager.sh"
94
+ [ "$status" -eq 0 ]
95
+
96
+ run grep -q "\-\-max-time" "$TEST_PROJECT_DIR/.claude/hooks/piper-voice-manager.sh"
97
+ [ "$status" -eq 0 ]
98
+ }
99
+
100
+ @test "Piper installer passes --non-interactive flag to voice downloader" {
101
+ run grep -q "piper-download-voices.sh.*--yes" "$TEST_PROJECT_DIR/.claude/hooks/piper-installer.sh"
102
+ [ "$status" -eq 0 ]
103
+ }
104
+
105
+ # Integration test - only runs if PIPER_INTEGRATION_TEST is set
106
+ @test "Full Piper installation with voice downloads (integration)" {
107
+ if [ -z "$PIPER_INTEGRATION_TEST" ]; then
108
+ skip "Set PIPER_INTEGRATION_TEST=1 to run integration tests"
109
+ fi
110
+
111
+ # Run installer in non-interactive mode
112
+ run bash "$TEST_PROJECT_DIR/.claude/hooks/piper-installer.sh" --non-interactive
113
+ echo "Installer output: $output"
114
+ [ "$status" -eq 0 ]
115
+
116
+ # Verify Piper is installed
117
+ command -v piper || skip "Piper not in PATH after installation"
118
+
119
+ # Check voice storage directory
120
+ VOICE_DIR="$HOME/.claude/piper-voices"
121
+ [ -d "$VOICE_DIR" ]
122
+
123
+ # Verify at least some voices downloaded
124
+ voice_count=$(find "$VOICE_DIR" -name "*.onnx" | wc -l)
125
+ [ "$voice_count" -gt 0 ]
126
+
127
+ # Verify 16Speakers model specifically
128
+ [ -f "$VOICE_DIR/16Speakers.onnx" ]
129
+ [ -f "$VOICE_DIR/16Speakers.onnx.json" ]
130
+ }
131
+
132
+ @test "Voice download script handles failures gracefully" {
133
+ # Test that the script returns 0 even with failures
134
+ # This is a mock test - in real scenario we'd simulate network failures
135
+
136
+ run bash -c "source '$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh' 2>&1 | tail -1"
137
+ echo "Output: $output"
138
+
139
+ # Script should exit 0 (checked via exit code or explicit exit statement)
140
+ [ -f "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh" ]
141
+ tail -5 "$TEST_PROJECT_DIR/.claude/hooks/piper-download-voices.sh" | grep -q "exit 0"
142
+ }