agentvibes 5.1.3 → 5.2.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 (34) hide show
  1. package/.agentvibes/config.json +23 -13
  2. package/.claude/commands/agent-vibes/verbosity.md +98 -89
  3. package/.claude/config/audio-effects.cfg +6 -1
  4. package/.claude/hooks/bmad-speak.sh +2 -2
  5. package/.claude/hooks/piper-download-voices.sh +233 -225
  6. package/.claude/hooks/piper-installer.sh +1 -1
  7. package/.claude/hooks/piper-voice-manager.sh +125 -0
  8. package/.claude/hooks/play-tts-agentvibes-receiver-for-voiceless-connections.sh +97 -90
  9. package/.claude/hooks/play-tts-enhanced.sh +1 -1
  10. package/.claude/hooks/play-tts-piper.sh +16 -5
  11. package/.claude/hooks/play-tts-ssh-remote.sh +168 -167
  12. package/.claude/hooks/play-tts.sh +31 -9
  13. package/.claude/hooks/session-start-tts.sh +4 -1
  14. package/.claude/hooks/stop-tts.sh +1 -1
  15. package/.claude/hooks/verbosity-manager.sh +185 -178
  16. package/.claude/hooks-windows/download-extra-voices.ps1 +243 -185
  17. package/.claude/hooks-windows/play-tts-piper.ps1 +7 -2
  18. package/.claude/hooks-windows/play-tts.ps1 +219 -65
  19. package/.claude/hooks-windows/session-start-tts.ps1 +2 -1
  20. package/.claude/hooks-windows/verbosity-manager.ps1 +126 -119
  21. package/README.md +24 -1
  22. package/RELEASE_NOTES.md +113 -0
  23. package/bin/agentvibes-voice-browser.js +1939 -1840
  24. package/mcp-server/server.py +75 -25
  25. package/package.json +1 -1
  26. package/src/console/tabs/receiver-tab.js +1527 -1483
  27. package/src/console/tabs/settings-tab.js +2 -2
  28. package/src/console/tabs/setup-tab.js +122 -20
  29. package/src/console/tabs/voices-tab.js +130 -13
  30. package/src/i18n/en.js +202 -202
  31. package/src/installer.js +29 -25
  32. package/src/services/llm-provider-service.js +114 -11
  33. package/src/services/verbosity-service.js +159 -157
  34. package/templates/agentvibes-receiver.sh +3 -2
@@ -1,185 +1,243 @@
1
- #
2
- # File: .claude/hooks-windows/download-extra-voices.ps1
3
- #
4
- # AgentVibes - Download Extra Piper Voice Models (Windows)
5
- # Downloads custom high-quality voices from HuggingFace
6
- #
7
-
8
- param(
9
- [switch]$yes
10
- )
11
-
12
- $AUTO_YES = $yes -or ($args -contains "--yes") -or ($args -contains "-y")
13
-
14
- # Configuration
15
- $VoiceDir = "$env:USERPROFILE\.claude\piper-voices"
16
- $PiperExe = "$env:LOCALAPPDATA\Programs\Piper\piper.exe"
17
-
18
- # HuggingFace repository for custom voices
19
- $HuggingFaceRepo = "agentvibes/piper-custom-voices"
20
- $HuggingFaceBaseUrl = "https://huggingface.co/$HuggingFaceRepo/resolve/main"
21
-
22
- # Extra custom voices to download
23
- $ExtraVoices = @(
24
- @{
25
- name = "kristin"
26
- description = "Kristin (US English female, Public Domain, 64MB)"
27
- sizeMB = 64
28
- },
29
- @{
30
- name = "jenny"
31
- description = "Jenny (UK English female with Irish accent, CC BY, 64MB)"
32
- sizeMB = 64
33
- },
34
- @{
35
- name = "16Speakers"
36
- description = "Tracy/16Speakers (Multi-speaker: 12 US + 4 UK voices, Public Domain, 77MB)"
37
- sizeMB = 77
38
- }
39
- )
40
-
41
- Write-Host ""
42
- Write-Host "AgentVibes Extra Voice Downloader" -ForegroundColor Cyan
43
- Write-Host ("=" * 40) -ForegroundColor Cyan
44
- Write-Host ""
45
- Write-Host "This will download high-quality custom Piper voices from HuggingFace."
46
- Write-Host ""
47
-
48
- # Check if Piper is installed
49
- if (-not (Test-Path $PiperExe)) {
50
- Write-Host "[ERROR] Piper not found at: $PiperExe" -ForegroundColor Red
51
- Write-Host "Run: .\setup-windows.ps1 to install Piper" -ForegroundColor Yellow
52
- exit 1
53
- }
54
-
55
- # Create voice directory
56
- if (-not (Test-Path $VoiceDir)) {
57
- New-Item -ItemType Directory -Path $VoiceDir -Force | Out-Null
58
- }
59
-
60
- Write-Host "Voice directory: $VoiceDir" -ForegroundColor Gray
61
- Write-Host ""
62
-
63
- # Check status of each voice
64
- $alreadyDownloaded = @()
65
- $needDownload = @()
66
-
67
- foreach ($voice in $ExtraVoices) {
68
- $modelFile = "$VoiceDir\$($voice.name).onnx"
69
- $configFile = "$VoiceDir\$($voice.name).onnx.json"
70
-
71
- if ((Test-Path $modelFile) -and (Test-Path $configFile)) {
72
- $alreadyDownloaded += $voice
73
- } else {
74
- $needDownload += $voice
75
- }
76
- }
77
-
78
- Write-Host "Status:" -ForegroundColor Cyan
79
- Write-Host " Already downloaded: $($alreadyDownloaded.Count) voice(s)"
80
- Write-Host " Need to download: $($needDownload.Count) voice(s)"
81
- Write-Host ""
82
-
83
- if ($alreadyDownloaded.Count -gt 0) {
84
- Write-Host "Already downloaded (skipped):" -ForegroundColor Green
85
- foreach ($voice in $alreadyDownloaded) {
86
- Write-Host " [OK] $($voice.description)" -ForegroundColor Green
87
- }
88
- Write-Host ""
89
- }
90
-
91
- if ($needDownload.Count -eq 0) {
92
- Write-Host "All extra voices already downloaded!" -ForegroundColor Green
93
- exit 0
94
- }
95
-
96
- # Calculate total size
97
- $totalSizeMB = ($needDownload | Measure-Object -Property sizeMB -Sum).Sum
98
-
99
- Write-Host "Voices to download:" -ForegroundColor Yellow
100
- foreach ($voice in $needDownload) {
101
- Write-Host " - $($voice.description)"
102
- }
103
- Write-Host ""
104
- Write-Host "Total download size: ~${totalSizeMB}MB" -ForegroundColor Yellow
105
- Write-Host ""
106
-
107
- # Confirm download
108
- if (-not $AUTO_YES) {
109
- $reply = Read-Host "Download $($needDownload.Count) extra voice(s)? [Y/n]"
110
- if ($reply -and $reply -notmatch '^[Yy]') {
111
- Write-Host "Download cancelled" -ForegroundColor Red
112
- exit 0
113
- }
114
- } else {
115
- Write-Host "Auto-downloading $($needDownload.Count) extra voice(s)..." -ForegroundColor Cyan
116
- Write-Host ""
117
- }
118
-
119
- # Download each voice
120
- $downloaded = 0
121
- $failed = 0
122
-
123
- foreach ($voice in $needDownload) {
124
- $voiceName = $voice.name
125
- Write-Host ""
126
- Write-Host "Downloading: $($voice.description)..." -ForegroundColor Cyan
127
-
128
- $modelUrl = "$HuggingFaceBaseUrl/$voiceName.onnx"
129
- $jsonUrl = "$HuggingFaceBaseUrl/$voiceName.onnx.json"
130
- $modelFile = "$VoiceDir\$voiceName.onnx"
131
- $jsonFile = "$VoiceDir\$voiceName.onnx.json"
132
-
133
- $success = $true
134
-
135
- try {
136
- Write-Host " Downloading model file..." -ForegroundColor Yellow
137
- Invoke-WebRequest -Uri $modelUrl -OutFile $modelFile -ErrorAction Stop
138
-
139
- Write-Host " Downloading config file..." -ForegroundColor Yellow
140
- Invoke-WebRequest -Uri $jsonUrl -OutFile $jsonFile -ErrorAction Stop
141
-
142
- $modelSize = [math]::Round((Get-Item $modelFile).Length / 1MB, 2)
143
- Write-Host " [OK] Downloaded ($modelSize MB)" -ForegroundColor Green
144
- }
145
- catch {
146
- Write-Host " [ERROR] Failed to download: $_" -ForegroundColor Red
147
- $success = $false
148
- # Clean up partial downloads
149
- Remove-Item -Path $modelFile -ErrorAction SilentlyContinue
150
- Remove-Item -Path $jsonFile -ErrorAction SilentlyContinue
151
- }
152
-
153
- if ($success) {
154
- $downloaded++
155
- Write-Host " Successfully downloaded: $voiceName" -ForegroundColor Green
156
- } else {
157
- $failed++
158
- }
159
- }
160
-
161
- Write-Host ""
162
- Write-Host ("=" * 40) -ForegroundColor Cyan
163
- Write-Host "Download Summary:" -ForegroundColor Cyan
164
- Write-Host " Successfully downloaded: $downloaded" -ForegroundColor Green
165
- if ($failed -gt 0) {
166
- Write-Host " Failed: $failed" -ForegroundColor Red
167
- }
168
- Write-Host " Total extra voices available: $($alreadyDownloaded.Count + $downloaded)"
169
- Write-Host ""
170
-
171
- if ($downloaded -gt 0) {
172
- Write-Host "Extra voices ready to use!" -ForegroundColor Green
173
- Write-Host ""
174
- Write-Host "Try them:"
175
- Write-Host " /agent-vibes:provider switch piper"
176
- Write-Host " /agent-vibes:switch kristin"
177
- Write-Host " /agent-vibes:switch jenny"
178
- Write-Host " /agent-vibes:switch 16Speakers"
179
- }
180
-
181
- if ($downloaded -gt 0 -or $alreadyDownloaded.Count -gt 0) {
182
- exit 0
183
- } else {
184
- exit 1
185
- }
1
+ #
2
+ # File: .claude/hooks-windows/download-extra-voices.ps1
3
+ #
4
+ # AgentVibes - Download Extra Piper Voice Models (Windows)
5
+ # Downloads custom high-quality voices from HuggingFace
6
+ #
7
+
8
+ param(
9
+ [switch]$yes
10
+ )
11
+
12
+ $AUTO_YES = $yes -or ($args -contains "--yes") -or ($args -contains "-y")
13
+
14
+ # Configuration
15
+ $VoiceDir = "$env:USERPROFILE\.claude\piper-voices"
16
+ $PiperExe = "$env:LOCALAPPDATA\Programs\Piper\piper.exe"
17
+
18
+ # HuggingFace repository for custom voices
19
+ $HuggingFaceRepo = "agentvibes/piper-custom-voices"
20
+ $HuggingFaceBaseUrl = "https://huggingface.co/$HuggingFaceRepo/resolve/main"
21
+
22
+ # Extra custom voices to download
23
+ $ExtraVoices = @(
24
+ @{
25
+ name = "kristin"
26
+ description = "Kristin (US English female, Public Domain, 64MB)"
27
+ sizeMB = 64
28
+ },
29
+ @{
30
+ name = "jenny"
31
+ description = "Jenny (UK English female with Irish accent, CC BY, 64MB)"
32
+ sizeMB = 64
33
+ },
34
+ @{
35
+ name = "16Speakers"
36
+ description = "Tracy/16Speakers (Multi-speaker: 12 US + 4 UK voices, Public Domain, 77MB)"
37
+ sizeMB = 77
38
+ }
39
+ )
40
+
41
+ Write-Host ""
42
+ Write-Host "AgentVibes Extra Voice Downloader" -ForegroundColor Cyan
43
+ Write-Host ("=" * 40) -ForegroundColor Cyan
44
+ Write-Host ""
45
+ Write-Host "This will download high-quality custom Piper voices from HuggingFace."
46
+ Write-Host ""
47
+
48
+ # Check if Piper is installed
49
+ if (-not (Test-Path $PiperExe)) {
50
+ Write-Host "[ERROR] Piper not found at: $PiperExe" -ForegroundColor Red
51
+ Write-Host "Run: .\setup-windows.ps1 to install Piper" -ForegroundColor Yellow
52
+ exit 1
53
+ }
54
+
55
+ # Create voice directory
56
+ if (-not (Test-Path $VoiceDir)) {
57
+ New-Item -ItemType Directory -Path $VoiceDir -Force | Out-Null
58
+ }
59
+
60
+ Write-Host "Voice directory: $VoiceDir" -ForegroundColor Gray
61
+ Write-Host ""
62
+
63
+ # Check status of each voice
64
+ $alreadyDownloaded = @()
65
+ $needDownload = @()
66
+
67
+ foreach ($voice in $ExtraVoices) {
68
+ $modelFile = "$VoiceDir\$($voice.name).onnx"
69
+ $configFile = "$VoiceDir\$($voice.name).onnx.json"
70
+
71
+ if ((Test-Path $modelFile) -and (Test-Path $configFile)) {
72
+ $alreadyDownloaded += $voice
73
+ } else {
74
+ $needDownload += $voice
75
+ }
76
+ }
77
+
78
+ Write-Host "Status:" -ForegroundColor Cyan
79
+ Write-Host " Already downloaded: $($alreadyDownloaded.Count) voice(s)"
80
+ Write-Host " Need to download: $($needDownload.Count) voice(s)"
81
+ Write-Host ""
82
+
83
+ if ($alreadyDownloaded.Count -gt 0) {
84
+ Write-Host "Already downloaded (skipped):" -ForegroundColor Green
85
+ foreach ($voice in $alreadyDownloaded) {
86
+ Write-Host " [OK] $($voice.description)" -ForegroundColor Green
87
+ }
88
+ Write-Host ""
89
+ }
90
+
91
+ if ($needDownload.Count -eq 0) {
92
+ Write-Host "All extra voices already downloaded!" -ForegroundColor Green
93
+ exit 0
94
+ }
95
+
96
+ # Calculate total size
97
+ $totalSizeMB = ($needDownload | Measure-Object -Property sizeMB -Sum).Sum
98
+
99
+ Write-Host "Voices to download:" -ForegroundColor Yellow
100
+ foreach ($voice in $needDownload) {
101
+ Write-Host " - $($voice.description)"
102
+ }
103
+ Write-Host ""
104
+ Write-Host "Total download size: ~${totalSizeMB}MB" -ForegroundColor Yellow
105
+ Write-Host ""
106
+
107
+ # Confirm download
108
+ if (-not $AUTO_YES) {
109
+ $reply = Read-Host "Download $($needDownload.Count) extra voice(s)? [Y/n]"
110
+ if ($reply -and $reply -notmatch '^[Yy]') {
111
+ Write-Host "Download cancelled" -ForegroundColor Red
112
+ exit 0
113
+ }
114
+ } else {
115
+ Write-Host "Auto-downloading $($needDownload.Count) extra voice(s)..." -ForegroundColor Cyan
116
+ Write-Host ""
117
+ }
118
+
119
+ # Download each voice
120
+ $downloaded = 0
121
+ $failed = 0
122
+
123
+ foreach ($voice in $needDownload) {
124
+ $voiceName = $voice.name
125
+ Write-Host ""
126
+ Write-Host "Downloading: $($voice.description)..." -ForegroundColor Cyan
127
+
128
+ $modelUrl = "$HuggingFaceBaseUrl/$voiceName.onnx"
129
+ $jsonUrl = "$HuggingFaceBaseUrl/$voiceName.onnx.json"
130
+ $modelFile = "$VoiceDir\$voiceName.onnx"
131
+ $jsonFile = "$VoiceDir\$voiceName.onnx.json"
132
+
133
+ $success = $true
134
+
135
+ try {
136
+ Write-Host " Downloading model file..." -ForegroundColor Yellow
137
+ Invoke-WebRequest -Uri $modelUrl -OutFile $modelFile -ErrorAction Stop
138
+
139
+ Write-Host " Downloading config file..." -ForegroundColor Yellow
140
+ Invoke-WebRequest -Uri $jsonUrl -OutFile $jsonFile -ErrorAction Stop
141
+
142
+ $modelSize = [math]::Round((Get-Item $modelFile).Length / 1MB, 2)
143
+ Write-Host " [OK] Downloaded ($modelSize MB)" -ForegroundColor Green
144
+ }
145
+ catch {
146
+ Write-Host " [ERROR] Failed to download: $_" -ForegroundColor Red
147
+ $success = $false
148
+ # Clean up partial downloads
149
+ Remove-Item -Path $modelFile -ErrorAction SilentlyContinue
150
+ Remove-Item -Path $jsonFile -ErrorAction SilentlyContinue
151
+ }
152
+
153
+ if ($success) {
154
+ $downloaded++
155
+ Write-Host " Successfully downloaded: $voiceName" -ForegroundColor Green
156
+ } else {
157
+ $failed++
158
+ }
159
+ }
160
+
161
+ # Patch LibriTTS speaker names for any libritts models (existing or just downloaded)
162
+ foreach ($voice in $ExtraVoices) {
163
+ $voiceName = $voice.name
164
+ $jsonFile = "$VoiceDir\$voiceName.onnx.json"
165
+ if ((Test-Path $jsonFile)) {
166
+ try {
167
+ $data = Get-Content $jsonFile -Raw | ConvertFrom-Json
168
+ $sidMap = $data.speaker_id_map
169
+ if ($sidMap -and ($data.num_speakers -gt 1)) {
170
+ # Check if already patched (first key doesn't start with 'p' + digits)
171
+ $firstKey = ($sidMap.PSObject.Properties | Select-Object -First 1).Name
172
+ if ($firstKey -match '^p\d+$') {
173
+ # Find voice-assignments.json
174
+ $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
175
+ $ProjectRoot = Split-Path -Parent (Split-Path -Parent $ScriptDir)
176
+ $CatalogPath = Join-Path $ProjectRoot "voice-assignments.json"
177
+ if (-not (Test-Path $CatalogPath)) {
178
+ # Try npm global install location
179
+ $npmRoot = & npm root -g 2>$null
180
+ if ($npmRoot) {
181
+ $CatalogPath = Join-Path $npmRoot "agentvibes\voice-assignments.json"
182
+ }
183
+ }
184
+ if (Test-Path $CatalogPath) {
185
+ $catalog = Get-Content $CatalogPath -Raw | ConvertFrom-Json
186
+ $speakers = $catalog.libritts_speakers
187
+
188
+ # Build reverse map: index -> p-name
189
+ $indexToP = @{}
190
+ foreach ($prop in $sidMap.PSObject.Properties) {
191
+ $indexToP[$prop.Value] = $prop.Name
192
+ }
193
+
194
+ # Rebuild with friendly names
195
+ $newMap = [ordered]@{}
196
+ foreach ($entry in $indexToP.GetEnumerator() | Sort-Object Key) {
197
+ $idx = [string]$entry.Key
198
+ $pname = $entry.Value
199
+ $friendly = $speakers.$idx.voice_name
200
+ if ($friendly) {
201
+ $newMap[$friendly] = [int]$idx
202
+ } else {
203
+ $newMap[$pname] = [int]$idx
204
+ }
205
+ }
206
+
207
+ $data.speaker_id_map = $newMap
208
+ $data | ConvertTo-Json -Depth 10 | Set-Content $jsonFile -Encoding UTF8
209
+ Write-Host " Patched LibriTTS speaker names to friendly names: $voiceName" -ForegroundColor Green
210
+ }
211
+ }
212
+ }
213
+ } catch {
214
+ # Non-fatal — patching is best-effort
215
+ }
216
+ }
217
+ }
218
+
219
+ Write-Host ""
220
+ Write-Host ("=" * 40) -ForegroundColor Cyan
221
+ Write-Host "Download Summary:" -ForegroundColor Cyan
222
+ Write-Host " Successfully downloaded: $downloaded" -ForegroundColor Green
223
+ if ($failed -gt 0) {
224
+ Write-Host " Failed: $failed" -ForegroundColor Red
225
+ }
226
+ Write-Host " Total extra voices available: $($alreadyDownloaded.Count + $downloaded)"
227
+ Write-Host ""
228
+
229
+ if ($downloaded -gt 0) {
230
+ Write-Host "Extra voices ready to use!" -ForegroundColor Green
231
+ Write-Host ""
232
+ Write-Host "Try them:"
233
+ Write-Host " /agent-vibes:provider switch piper"
234
+ Write-Host " /agent-vibes:switch kristin"
235
+ Write-Host " /agent-vibes:switch jenny"
236
+ Write-Host " /agent-vibes:switch 16Speakers"
237
+ }
238
+
239
+ if ($downloaded -gt 0 -or $alreadyDownloaded.Count -gt 0) {
240
+ exit 0
241
+ } else {
242
+ exit 1
243
+ }
@@ -229,10 +229,15 @@ try {
229
229
  Write-Host "[OK] Saved to: $AudioFile" -ForegroundColor Green
230
230
  Write-Host "[VOICE] Voice used: $VoiceName (Piper)" -ForegroundColor Green
231
231
 
232
- # Apply audio effects (reverb, background music) if processor script exists
232
+ # Apply audio effects (reverb, background music) if processor script exists.
233
+ # SKIP when AGENTVIBES_NO_PLAY is set — that means the parent play-tts.ps1
234
+ # will handle reverb/bg-music post-processing itself. Running audio-processor
235
+ # here AND letting the parent do its own effects causes double-processing:
236
+ # this creates .effected.wav which the parent ignores, then the parent applies
237
+ # effects to the original wav again.
233
238
  $ProcessorScript = Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) "audio-processor.ps1"
234
239
  $ProcessedFile = $AudioFile
235
- if (Test-Path $ProcessorScript) {
240
+ if (-not $env:AGENTVIBES_NO_PLAY -and (Test-Path $ProcessorScript)) {
236
241
  # Lookup order: agent name → LLM key (from --llm) → default
237
242
  $AgentName = if ($env:AGENTVIBES_AGENT_NAME) { $env:AGENTVIBES_AGENT_NAME } elseif ($env:AGENTVIBES_LLM_KEY) { $env:AGENTVIBES_LLM_KEY } else { "default" }
238
243
  $EffectedFile = "$AudioFile.effected.wav"