agentvibes 5.2.0 → 5.2.1
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.
- package/.claude/config/audio-effects.cfg +1 -1
- package/.claude/hooks/audio-cache-utils.sh +246 -246
- package/.claude/hooks/background-music-manager.sh +404 -404
- package/.claude/hooks/bmad-speak-enhanced.sh +165 -165
- package/.claude/hooks/bmad-speak.sh +290 -290
- package/.claude/hooks/bmad-tts-injector.sh +568 -568
- package/.claude/hooks/bmad-voice-manager.sh +928 -928
- package/.claude/hooks/clawdbot-receiver-SECURE.sh +129 -129
- package/.claude/hooks/clawdbot-receiver.sh +107 -107
- package/.claude/hooks/clean-audio-cache.sh +22 -22
- package/.claude/hooks/cleanup-cache.sh +106 -106
- package/.claude/hooks/configure-rdp-mode.sh +137 -137
- package/.claude/hooks/download-extra-voices.sh +244 -244
- package/.claude/hooks/effects-manager.sh +268 -268
- package/.claude/hooks/github-star-reminder.sh +154 -154
- package/.claude/hooks/language-manager.sh +362 -362
- package/.claude/hooks/learn-manager.sh +492 -492
- package/.claude/hooks/macos-voice-manager.sh +205 -205
- package/.claude/hooks/migrate-background-music.sh +125 -125
- package/.claude/hooks/migrate-to-agentvibes.sh +161 -161
- package/.claude/hooks/optimize-background-music.sh +87 -87
- package/.claude/hooks/path-resolver.sh +60 -60
- package/.claude/hooks/personality-manager.sh +448 -448
- package/.claude/hooks/piper-installer.sh +292 -292
- package/.claude/hooks/piper-multispeaker-registry.sh +171 -171
- package/.claude/hooks/play-tts-enhanced.sh +105 -105
- package/.claude/hooks/play-tts-termux-ssh.sh +169 -169
- package/.claude/hooks/play-tts.sh +14 -5
- package/.claude/hooks/prepare-release.sh +54 -54
- package/.claude/hooks/provider-commands.sh +617 -617
- package/.claude/hooks/provider-manager.sh +399 -399
- package/.claude/hooks/replay-target-audio.sh +95 -95
- package/.claude/hooks/sentiment-manager.sh +201 -201
- package/.claude/hooks/speed-manager.sh +291 -291
- package/.claude/hooks/stop-tts.sh +84 -84
- package/.claude/hooks/termux-installer.sh +261 -261
- package/.claude/hooks/translate-manager.sh +341 -341
- package/.claude/hooks/tts-queue-worker.sh +145 -145
- package/.claude/hooks/tts-queue.sh +165 -165
- package/.claude/hooks/voice-manager.sh +552 -548
- package/.claude/hooks-windows/play-tts.ps1 +2 -2
- package/README.md +11 -2
- package/RELEASE_NOTES.md +38 -0
- package/bin/mcp-server.sh +206 -206
- package/mcp-server/server.py +35 -6
- package/package.json +1 -1
- package/src/console/tabs/setup-tab.js +59 -23
- package/src/installer.js +79 -213
- package/src/services/llm-provider-service.js +126 -75
|
@@ -22,8 +22,8 @@ param(
|
|
|
22
22
|
# we export to child scripts. An invalid value is treated as unset rather
|
|
23
23
|
# than aborting, so the script falls back to the default config and the
|
|
24
24
|
# rest of TTS still works.
|
|
25
|
-
if ($llm -and $llm -notmatch '^[a-zA-Z0-9_-]
|
|
26
|
-
Write-Error ("Invalid LLM provider name: '{0}' - must match {1}. Falling back to default config." -f $llm, '^[a-zA-Z0-9_-]
|
|
25
|
+
if ($llm -and $llm -notmatch '^[a-zA-Z0-9][a-zA-Z0-9_-]*$') {
|
|
26
|
+
Write-Error ("Invalid LLM provider name: '{0}' - must match {1}. Falling back to default config." -f $llm, '^[a-zA-Z0-9][a-zA-Z0-9_-]*$')
|
|
27
27
|
$llm = ""
|
|
28
28
|
}
|
|
29
29
|
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://github.com/paulpreibisch/AgentVibes/actions/workflows/publish.yml)
|
|
12
12
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
13
13
|
|
|
14
|
-
**Author**: Paul Preibisch ([@997Fire](https://x.com/997Fire)) | **Version**: v5.2.
|
|
14
|
+
**Author**: Paul Preibisch ([@997Fire](https://x.com/997Fire)) | **Version**: v5.2.1
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -43,7 +43,16 @@ Whether you're using Claude Code, GitHub Copilot, OpenAI Codex, Claude Desktop,
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
-
## 🎯 NEW IN v5.2.
|
|
46
|
+
## 🎯 NEW IN v5.2.1 — Multi-LLM Identity & Install Polish
|
|
47
|
+
|
|
48
|
+
- **Copilot gets its own voice + pretext + music** — "Copilot here" with bossa nova, fully distinct from Claude Code and Codex.
|
|
49
|
+
- **Per-tool MCP configs with explicit identity** — `.vscode/mcp.json`, `.codex/config.toml`, `~/.copilot/mcp-config.json` each set their own `AGENTVIBES_LLM`.
|
|
50
|
+
- **`get_config` MCP tool returns detected LLM** — calling assistants can confirm their routing and respond with the right voice.
|
|
51
|
+
- **Setup nav: Install → Install → Install → Configure → Configure → Configure** — keyboard flow walks all three providers' Configures before landing on Default.
|
|
52
|
+
- **Claude Code default background music** set to Chillwave.
|
|
53
|
+
- **Linux compatibility refinements** — CRLF, permissions, transport provider override.
|
|
54
|
+
|
|
55
|
+
## 🎯 v5.2.0 — Remote Voice Preview + Caveman Mode + Voice Ratings
|
|
47
56
|
|
|
48
57
|
- **Caveman verbosity mode** — Ultra-terse TTS fragments. Set via `/agent-vibes:verbosity caveman`.
|
|
49
58
|
- **👍/👎 voice ratings** — Press `+` to thumbs up, `-` to thumbs down in any voice list. Replaces star favorites.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# AgentVibes Release Notes
|
|
2
2
|
|
|
3
|
+
## 🎯 v5.2.1 — Multi-LLM Identity & Install Polish
|
|
4
|
+
|
|
5
|
+
**Release Date:** April 2026
|
|
6
|
+
|
|
7
|
+
Polished LLM routing for Copilot/Codex and refined the setup experience.
|
|
8
|
+
|
|
9
|
+
### ✨ What's New
|
|
10
|
+
|
|
11
|
+
#### Multi-LLM Identity Routing
|
|
12
|
+
|
|
13
|
+
- **GitHub Copilot now gets its own voice, pretext, and background music** — fully distinct from Claude Code and Codex. Say hello to "Copilot here" with bossa nova on the way in.
|
|
14
|
+
|
|
15
|
+
- **Per-tool MCP configs with explicit identity** — each AI tool (`.vscode/mcp.json`, `.codex/config.toml`, `~/.copilot/mcp-config.json`) sets its own `AGENTVIBES_LLM` so routing is deterministic.
|
|
16
|
+
|
|
17
|
+
- **`get_config` MCP tool now returns the detected LLM** — so the calling assistant can confirm its routing and respond with the right voice out of the gate.
|
|
18
|
+
|
|
19
|
+
- **Linux compatibility refinements** — CRLF line endings, permissions, and transport provider override handling.
|
|
20
|
+
|
|
21
|
+
#### Setup Flow Improvements
|
|
22
|
+
|
|
23
|
+
- **Keyboard navigation flow** — pressing Enter through the Install buttons (Claude → Copilot → Codex) now jumps to **Claude Configure** next, letting you walk all three Configures in order before landing on Default.
|
|
24
|
+
|
|
25
|
+
- **Down-arrow skips the Default row** from Install/Remove columns (consistent with info-box dismiss nav).
|
|
26
|
+
|
|
27
|
+
- **Partial install success messaging** — if file copies succeed but MCP config needs a nudge, you'll see a clear warning instead of a generic failure.
|
|
28
|
+
|
|
29
|
+
#### Defaults
|
|
30
|
+
|
|
31
|
+
- **Claude Code default background music** set to Chillwave (`agent_vibes_chillwave_v2_loop.mp3`).
|
|
32
|
+
|
|
33
|
+
#### Under the Hood
|
|
34
|
+
|
|
35
|
+
- LLM key validation tightened for safer env var handling.
|
|
36
|
+
- Improved error logging for edge cases in Copilot CLI config writes.
|
|
37
|
+
- Known limitation documented: if you launch VS Code from a Claude-Code-started terminal, `CLAUDECODE=1` can leak — workaround is to `unset CLAUDECODE` first.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
3
41
|
## 🎯 v5.2.0 — Remote Voice Preview + Caveman Mode + Voice Ratings
|
|
4
42
|
|
|
5
43
|
**Release Date:** April 2026
|
package/bin/mcp-server.sh
CHANGED
|
@@ -1,206 +1,206 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# AgentVibes MCP Server Wrapper with Auto-Install
|
|
4
|
-
#
|
|
5
|
-
# This script is called by Claude Desktop via npx:
|
|
6
|
-
# npx -y agentvibes mcp-server
|
|
7
|
-
#
|
|
8
|
-
# It auto-installs dependencies when possible and provides helpful errors when not.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
set -e
|
|
12
|
-
|
|
13
|
-
# Find the directory where this script lives
|
|
14
|
-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
15
|
-
|
|
16
|
-
# Package root is one level up from bin/
|
|
17
|
-
PACKAGE_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
|
|
18
|
-
|
|
19
|
-
# Path to the Python MCP server
|
|
20
|
-
MCP_SERVER="$PACKAGE_ROOT/mcp-server/server.py"
|
|
21
|
-
|
|
22
|
-
# Detect OS for platform-specific instructions
|
|
23
|
-
OS="$(uname -s)"
|
|
24
|
-
|
|
25
|
-
# Ensure the server file exists
|
|
26
|
-
if [ ! -f "$MCP_SERVER" ]; then
|
|
27
|
-
echo "❌ Error: MCP server not found at $MCP_SERVER" >&2
|
|
28
|
-
exit 1
|
|
29
|
-
fi
|
|
30
|
-
|
|
31
|
-
# Function to print section headers
|
|
32
|
-
print_section() {
|
|
33
|
-
echo "" >&2
|
|
34
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" >&2
|
|
35
|
-
echo "$1" >&2
|
|
36
|
-
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" >&2
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
# Check Python
|
|
40
|
-
if ! command -v python3 &> /dev/null; then
|
|
41
|
-
print_section "❌ Python 3 Not Found"
|
|
42
|
-
echo "AgentVibes MCP server requires Python 3.10 or newer." >&2
|
|
43
|
-
echo "" >&2
|
|
44
|
-
echo "📖 Install Python:" >&2
|
|
45
|
-
|
|
46
|
-
case "$OS" in
|
|
47
|
-
Linux*)
|
|
48
|
-
echo " sudo apt install python3 # Ubuntu/Debian" >&2
|
|
49
|
-
echo " sudo yum install python3 # RedHat/CentOS" >&2
|
|
50
|
-
;;
|
|
51
|
-
Darwin*)
|
|
52
|
-
echo " brew install python3 # macOS (requires Homebrew)" >&2
|
|
53
|
-
echo " Or download from: https://python.org" >&2
|
|
54
|
-
;;
|
|
55
|
-
*)
|
|
56
|
-
echo " Download from: https://python.org" >&2
|
|
57
|
-
;;
|
|
58
|
-
esac
|
|
59
|
-
|
|
60
|
-
echo "" >&2
|
|
61
|
-
echo "💡 After installing Python, restart Claude Desktop" >&2
|
|
62
|
-
echo "" >&2
|
|
63
|
-
exit 1
|
|
64
|
-
fi
|
|
65
|
-
|
|
66
|
-
# Check Python version
|
|
67
|
-
PYTHON_VERSION=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
68
|
-
echo "🐍 Python $PYTHON_VERSION detected" >&2
|
|
69
|
-
|
|
70
|
-
# Auto-install Python mcp package
|
|
71
|
-
if ! python3 -c "import mcp" 2>/dev/null; then
|
|
72
|
-
print_section "📦 Installing Python MCP Package"
|
|
73
|
-
echo "Installing 'mcp' package to enable Claude Desktop integration..." >&2
|
|
74
|
-
|
|
75
|
-
if python3 -m pip install --user mcp --quiet 2>&1; then
|
|
76
|
-
echo "✅ Python MCP package installed successfully!" >&2
|
|
77
|
-
else
|
|
78
|
-
echo "❌ Failed to auto-install MCP package" >&2
|
|
79
|
-
echo "" >&2
|
|
80
|
-
echo "💡 Try manually:" >&2
|
|
81
|
-
echo " python3 -m pip install --user mcp" >&2
|
|
82
|
-
echo "" >&2
|
|
83
|
-
exit 1
|
|
84
|
-
fi
|
|
85
|
-
else
|
|
86
|
-
echo "✅ Python MCP package already installed" >&2
|
|
87
|
-
fi
|
|
88
|
-
|
|
89
|
-
# Check provider (Piper vs ElevenLabs)
|
|
90
|
-
PROVIDER_FILE="$PACKAGE_ROOT/.claude/tts-provider.txt"
|
|
91
|
-
PROVIDER="elevenlabs" # Default
|
|
92
|
-
|
|
93
|
-
if [ -f "$PROVIDER_FILE" ]; then
|
|
94
|
-
PROVIDER=$(cat "$PROVIDER_FILE" | tr -d '[:space:]')
|
|
95
|
-
fi
|
|
96
|
-
|
|
97
|
-
# If using Piper, ensure it's installed
|
|
98
|
-
if [ "$PROVIDER" = "piper" ]; then
|
|
99
|
-
if ! command -v piper &> /dev/null; then
|
|
100
|
-
# Piper not found, try to auto-install
|
|
101
|
-
|
|
102
|
-
# First check if pipx is available
|
|
103
|
-
if ! command -v pipx &> /dev/null; then
|
|
104
|
-
print_section "📦 Installing pipx"
|
|
105
|
-
echo "pipx is needed to install Piper TTS..." >&2
|
|
106
|
-
|
|
107
|
-
if python3 -m pip install --user pipx --quiet 2>&1; then
|
|
108
|
-
# Add pipx to PATH for this session
|
|
109
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
110
|
-
|
|
111
|
-
# Ensure pipx is set up
|
|
112
|
-
python3 -m pipx ensurepath >/dev/null 2>&1 || true
|
|
113
|
-
|
|
114
|
-
echo "✅ pipx installed successfully!" >&2
|
|
115
|
-
else
|
|
116
|
-
echo "⚠️ Could not auto-install pipx" >&2
|
|
117
|
-
echo "" >&2
|
|
118
|
-
echo "📖 Install pipx manually:" >&2
|
|
119
|
-
case "$OS" in
|
|
120
|
-
Linux*)
|
|
121
|
-
echo " sudo apt install pipx # Ubuntu/Debian" >&2
|
|
122
|
-
;;
|
|
123
|
-
Darwin*)
|
|
124
|
-
echo " brew install pipx # macOS" >&2
|
|
125
|
-
;;
|
|
126
|
-
*)
|
|
127
|
-
echo " python3 -m pip install --user pipx" >&2
|
|
128
|
-
;;
|
|
129
|
-
esac
|
|
130
|
-
echo "" >&2
|
|
131
|
-
echo "⚠️ Continuing without Piper (TTS will not work)" >&2
|
|
132
|
-
fi
|
|
133
|
-
fi
|
|
134
|
-
|
|
135
|
-
# Now try to install Piper with pipx
|
|
136
|
-
if command -v pipx &> /dev/null; then
|
|
137
|
-
print_section "📦 Installing Piper TTS"
|
|
138
|
-
echo "Installing Piper TTS (free, offline voice synthesis)..." >&2
|
|
139
|
-
|
|
140
|
-
if pipx install piper-tts --quiet 2>&1; then
|
|
141
|
-
echo "✅ Piper TTS installed successfully!" >&2
|
|
142
|
-
|
|
143
|
-
# Add pipx bin to PATH
|
|
144
|
-
export PATH="$HOME/.local/bin:$PATH"
|
|
145
|
-
else
|
|
146
|
-
echo "⚠️ Could not auto-install Piper TTS" >&2
|
|
147
|
-
echo "" >&2
|
|
148
|
-
echo "💡 Try manually:" >&2
|
|
149
|
-
echo " pipx install piper-tts" >&2
|
|
150
|
-
echo "" >&2
|
|
151
|
-
echo "⚠️ Continuing without Piper (TTS will not work)" >&2
|
|
152
|
-
fi
|
|
153
|
-
fi
|
|
154
|
-
else
|
|
155
|
-
echo "✅ Piper TTS already installed" >&2
|
|
156
|
-
fi
|
|
157
|
-
|
|
158
|
-
# Auto-download default voice if needed
|
|
159
|
-
if command -v piper &> /dev/null; then
|
|
160
|
-
# Source the voice manager for download functions
|
|
161
|
-
if [ -f "$PACKAGE_ROOT/.claude/hooks/piper-voice-manager.sh" ]; then
|
|
162
|
-
source "$PACKAGE_ROOT/.claude/hooks/piper-voice-manager.sh"
|
|
163
|
-
|
|
164
|
-
# Default voice for Piper
|
|
165
|
-
DEFAULT_VOICE="en_US-lessac-medium"
|
|
166
|
-
|
|
167
|
-
# Check if default voice is downloaded
|
|
168
|
-
if ! verify_voice "$DEFAULT_VOICE" 2>/dev/null; then
|
|
169
|
-
print_section "📥 Downloading Default Voice"
|
|
170
|
-
echo "Downloading voice model: $DEFAULT_VOICE (~25MB)..." >&2
|
|
171
|
-
echo "Source: HuggingFace (rhasspy/piper-voices)" >&2
|
|
172
|
-
|
|
173
|
-
if download_voice "$DEFAULT_VOICE" 2>&1 | grep -v "^📥" | grep -v "Source:" | grep -v "Size:" >&2; then
|
|
174
|
-
echo "✅ Default voice downloaded successfully!" >&2
|
|
175
|
-
else
|
|
176
|
-
echo "⚠️ Could not download default voice" >&2
|
|
177
|
-
echo " Voice will download on first TTS request" >&2
|
|
178
|
-
fi
|
|
179
|
-
else
|
|
180
|
-
echo "✅ Default Piper voice ready" >&2
|
|
181
|
-
fi
|
|
182
|
-
fi
|
|
183
|
-
fi
|
|
184
|
-
elif [ "$PROVIDER" = "elevenlabs" ]; then
|
|
185
|
-
# Check for ElevenLabs API key
|
|
186
|
-
if [ -z "$ELEVENLABS_API_KEY" ]; then
|
|
187
|
-
echo "⚠️ ElevenLabs selected but ELEVENLABS_API_KEY not set" >&2
|
|
188
|
-
echo "" >&2
|
|
189
|
-
echo "📖 Set your API key:" >&2
|
|
190
|
-
echo " export ELEVENLABS_API_KEY='your-key-here'" >&2
|
|
191
|
-
echo "" >&2
|
|
192
|
-
echo "💡 Or switch to Piper TTS (free):" >&2
|
|
193
|
-
echo " echo 'piper' > $PACKAGE_ROOT/.claude/tts-provider.txt" >&2
|
|
194
|
-
echo "" >&2
|
|
195
|
-
else
|
|
196
|
-
echo "✅ ElevenLabs API key configured" >&2
|
|
197
|
-
fi
|
|
198
|
-
fi
|
|
199
|
-
|
|
200
|
-
# All checks passed, run the MCP server
|
|
201
|
-
echo "" >&2
|
|
202
|
-
echo "🚀 Starting AgentVibes MCP Server..." >&2
|
|
203
|
-
echo "" >&2
|
|
204
|
-
|
|
205
|
-
# Run the Python MCP server
|
|
206
|
-
exec python3 "$MCP_SERVER"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# AgentVibes MCP Server Wrapper with Auto-Install
|
|
4
|
+
#
|
|
5
|
+
# This script is called by Claude Desktop via npx:
|
|
6
|
+
# npx -y agentvibes mcp-server
|
|
7
|
+
#
|
|
8
|
+
# It auto-installs dependencies when possible and provides helpful errors when not.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
# Find the directory where this script lives
|
|
14
|
+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
15
|
+
|
|
16
|
+
# Package root is one level up from bin/
|
|
17
|
+
PACKAGE_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
|
|
18
|
+
|
|
19
|
+
# Path to the Python MCP server
|
|
20
|
+
MCP_SERVER="$PACKAGE_ROOT/mcp-server/server.py"
|
|
21
|
+
|
|
22
|
+
# Detect OS for platform-specific instructions
|
|
23
|
+
OS="$(uname -s)"
|
|
24
|
+
|
|
25
|
+
# Ensure the server file exists
|
|
26
|
+
if [ ! -f "$MCP_SERVER" ]; then
|
|
27
|
+
echo "❌ Error: MCP server not found at $MCP_SERVER" >&2
|
|
28
|
+
exit 1
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
# Function to print section headers
|
|
32
|
+
print_section() {
|
|
33
|
+
echo "" >&2
|
|
34
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" >&2
|
|
35
|
+
echo "$1" >&2
|
|
36
|
+
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" >&2
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Check Python
|
|
40
|
+
if ! command -v python3 &> /dev/null; then
|
|
41
|
+
print_section "❌ Python 3 Not Found"
|
|
42
|
+
echo "AgentVibes MCP server requires Python 3.10 or newer." >&2
|
|
43
|
+
echo "" >&2
|
|
44
|
+
echo "📖 Install Python:" >&2
|
|
45
|
+
|
|
46
|
+
case "$OS" in
|
|
47
|
+
Linux*)
|
|
48
|
+
echo " sudo apt install python3 # Ubuntu/Debian" >&2
|
|
49
|
+
echo " sudo yum install python3 # RedHat/CentOS" >&2
|
|
50
|
+
;;
|
|
51
|
+
Darwin*)
|
|
52
|
+
echo " brew install python3 # macOS (requires Homebrew)" >&2
|
|
53
|
+
echo " Or download from: https://python.org" >&2
|
|
54
|
+
;;
|
|
55
|
+
*)
|
|
56
|
+
echo " Download from: https://python.org" >&2
|
|
57
|
+
;;
|
|
58
|
+
esac
|
|
59
|
+
|
|
60
|
+
echo "" >&2
|
|
61
|
+
echo "💡 After installing Python, restart Claude Desktop" >&2
|
|
62
|
+
echo "" >&2
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
# Check Python version
|
|
67
|
+
PYTHON_VERSION=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
|
|
68
|
+
echo "🐍 Python $PYTHON_VERSION detected" >&2
|
|
69
|
+
|
|
70
|
+
# Auto-install Python mcp package
|
|
71
|
+
if ! python3 -c "import mcp" 2>/dev/null; then
|
|
72
|
+
print_section "📦 Installing Python MCP Package"
|
|
73
|
+
echo "Installing 'mcp' package to enable Claude Desktop integration..." >&2
|
|
74
|
+
|
|
75
|
+
if python3 -m pip install --user mcp --quiet 2>&1; then
|
|
76
|
+
echo "✅ Python MCP package installed successfully!" >&2
|
|
77
|
+
else
|
|
78
|
+
echo "❌ Failed to auto-install MCP package" >&2
|
|
79
|
+
echo "" >&2
|
|
80
|
+
echo "💡 Try manually:" >&2
|
|
81
|
+
echo " python3 -m pip install --user mcp" >&2
|
|
82
|
+
echo "" >&2
|
|
83
|
+
exit 1
|
|
84
|
+
fi
|
|
85
|
+
else
|
|
86
|
+
echo "✅ Python MCP package already installed" >&2
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
# Check provider (Piper vs ElevenLabs)
|
|
90
|
+
PROVIDER_FILE="$PACKAGE_ROOT/.claude/tts-provider.txt"
|
|
91
|
+
PROVIDER="elevenlabs" # Default
|
|
92
|
+
|
|
93
|
+
if [ -f "$PROVIDER_FILE" ]; then
|
|
94
|
+
PROVIDER=$(cat "$PROVIDER_FILE" | tr -d '[:space:]')
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
# If using Piper, ensure it's installed
|
|
98
|
+
if [ "$PROVIDER" = "piper" ]; then
|
|
99
|
+
if ! command -v piper &> /dev/null; then
|
|
100
|
+
# Piper not found, try to auto-install
|
|
101
|
+
|
|
102
|
+
# First check if pipx is available
|
|
103
|
+
if ! command -v pipx &> /dev/null; then
|
|
104
|
+
print_section "📦 Installing pipx"
|
|
105
|
+
echo "pipx is needed to install Piper TTS..." >&2
|
|
106
|
+
|
|
107
|
+
if python3 -m pip install --user pipx --quiet 2>&1; then
|
|
108
|
+
# Add pipx to PATH for this session
|
|
109
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
110
|
+
|
|
111
|
+
# Ensure pipx is set up
|
|
112
|
+
python3 -m pipx ensurepath >/dev/null 2>&1 || true
|
|
113
|
+
|
|
114
|
+
echo "✅ pipx installed successfully!" >&2
|
|
115
|
+
else
|
|
116
|
+
echo "⚠️ Could not auto-install pipx" >&2
|
|
117
|
+
echo "" >&2
|
|
118
|
+
echo "📖 Install pipx manually:" >&2
|
|
119
|
+
case "$OS" in
|
|
120
|
+
Linux*)
|
|
121
|
+
echo " sudo apt install pipx # Ubuntu/Debian" >&2
|
|
122
|
+
;;
|
|
123
|
+
Darwin*)
|
|
124
|
+
echo " brew install pipx # macOS" >&2
|
|
125
|
+
;;
|
|
126
|
+
*)
|
|
127
|
+
echo " python3 -m pip install --user pipx" >&2
|
|
128
|
+
;;
|
|
129
|
+
esac
|
|
130
|
+
echo "" >&2
|
|
131
|
+
echo "⚠️ Continuing without Piper (TTS will not work)" >&2
|
|
132
|
+
fi
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
# Now try to install Piper with pipx
|
|
136
|
+
if command -v pipx &> /dev/null; then
|
|
137
|
+
print_section "📦 Installing Piper TTS"
|
|
138
|
+
echo "Installing Piper TTS (free, offline voice synthesis)..." >&2
|
|
139
|
+
|
|
140
|
+
if pipx install piper-tts --quiet 2>&1; then
|
|
141
|
+
echo "✅ Piper TTS installed successfully!" >&2
|
|
142
|
+
|
|
143
|
+
# Add pipx bin to PATH
|
|
144
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
145
|
+
else
|
|
146
|
+
echo "⚠️ Could not auto-install Piper TTS" >&2
|
|
147
|
+
echo "" >&2
|
|
148
|
+
echo "💡 Try manually:" >&2
|
|
149
|
+
echo " pipx install piper-tts" >&2
|
|
150
|
+
echo "" >&2
|
|
151
|
+
echo "⚠️ Continuing without Piper (TTS will not work)" >&2
|
|
152
|
+
fi
|
|
153
|
+
fi
|
|
154
|
+
else
|
|
155
|
+
echo "✅ Piper TTS already installed" >&2
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Auto-download default voice if needed
|
|
159
|
+
if command -v piper &> /dev/null; then
|
|
160
|
+
# Source the voice manager for download functions
|
|
161
|
+
if [ -f "$PACKAGE_ROOT/.claude/hooks/piper-voice-manager.sh" ]; then
|
|
162
|
+
source "$PACKAGE_ROOT/.claude/hooks/piper-voice-manager.sh"
|
|
163
|
+
|
|
164
|
+
# Default voice for Piper
|
|
165
|
+
DEFAULT_VOICE="en_US-lessac-medium"
|
|
166
|
+
|
|
167
|
+
# Check if default voice is downloaded
|
|
168
|
+
if ! verify_voice "$DEFAULT_VOICE" 2>/dev/null; then
|
|
169
|
+
print_section "📥 Downloading Default Voice"
|
|
170
|
+
echo "Downloading voice model: $DEFAULT_VOICE (~25MB)..." >&2
|
|
171
|
+
echo "Source: HuggingFace (rhasspy/piper-voices)" >&2
|
|
172
|
+
|
|
173
|
+
if download_voice "$DEFAULT_VOICE" 2>&1 | grep -v "^📥" | grep -v "Source:" | grep -v "Size:" >&2; then
|
|
174
|
+
echo "✅ Default voice downloaded successfully!" >&2
|
|
175
|
+
else
|
|
176
|
+
echo "⚠️ Could not download default voice" >&2
|
|
177
|
+
echo " Voice will download on first TTS request" >&2
|
|
178
|
+
fi
|
|
179
|
+
else
|
|
180
|
+
echo "✅ Default Piper voice ready" >&2
|
|
181
|
+
fi
|
|
182
|
+
fi
|
|
183
|
+
fi
|
|
184
|
+
elif [ "$PROVIDER" = "elevenlabs" ]; then
|
|
185
|
+
# Check for ElevenLabs API key
|
|
186
|
+
if [ -z "$ELEVENLABS_API_KEY" ]; then
|
|
187
|
+
echo "⚠️ ElevenLabs selected but ELEVENLABS_API_KEY not set" >&2
|
|
188
|
+
echo "" >&2
|
|
189
|
+
echo "📖 Set your API key:" >&2
|
|
190
|
+
echo " export ELEVENLABS_API_KEY='your-key-here'" >&2
|
|
191
|
+
echo "" >&2
|
|
192
|
+
echo "💡 Or switch to Piper TTS (free):" >&2
|
|
193
|
+
echo " echo 'piper' > $PACKAGE_ROOT/.claude/tts-provider.txt" >&2
|
|
194
|
+
echo "" >&2
|
|
195
|
+
else
|
|
196
|
+
echo "✅ ElevenLabs API key configured" >&2
|
|
197
|
+
fi
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
# All checks passed, run the MCP server
|
|
201
|
+
echo "" >&2
|
|
202
|
+
echo "🚀 Starting AgentVibes MCP Server..." >&2
|
|
203
|
+
echo "" >&2
|
|
204
|
+
|
|
205
|
+
# Run the Python MCP server
|
|
206
|
+
exec python3 "$MCP_SERVER"
|
package/mcp-server/server.py
CHANGED
|
@@ -148,7 +148,7 @@ class AgentVibesServer:
|
|
|
148
148
|
break
|
|
149
149
|
|
|
150
150
|
# SECURITY: Validate resolved ID matches safe pattern
|
|
151
|
-
if resolved_id and re.match(r'^[a-zA-Z0-9_-]
|
|
151
|
+
if resolved_id and re.match(r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$', resolved_id):
|
|
152
152
|
return resolved_id
|
|
153
153
|
|
|
154
154
|
except (json.JSONDecodeError, KeyError, IOError, TypeError):
|
|
@@ -214,18 +214,31 @@ class AgentVibesServer:
|
|
|
214
214
|
# poisoning the audio-effects.cfg lookup or child-shell args.
|
|
215
215
|
import re as _re
|
|
216
216
|
llm_key = os.environ.get("AGENTVIBES_LLM", "").strip()
|
|
217
|
-
if llm_key and not _re.match(r"^[a-zA-Z0-9_-]
|
|
217
|
+
if llm_key and not _re.match(r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", llm_key):
|
|
218
218
|
print(
|
|
219
219
|
f"[AgentVibes] WARN: Ignoring invalid AGENTVIBES_LLM='{llm_key}' "
|
|
220
|
-
"(must match ^[a-zA-Z0-9_-]
|
|
220
|
+
"(must match ^[a-zA-Z0-9][a-zA-Z0-9_-]*$); falling back to auto-detect",
|
|
221
221
|
file=__import__('sys').stderr,
|
|
222
222
|
)
|
|
223
223
|
llm_key = ""
|
|
224
224
|
# Claude Code sets CLAUDECODE=1 when it spawns subprocesses.
|
|
225
|
-
#
|
|
226
|
-
#
|
|
225
|
+
#
|
|
226
|
+
# KNOWN LIMITATION: CLAUDECODE=1 can leak from a parent terminal.
|
|
227
|
+
# If the user launches VS Code from a Claude-Code-started shell,
|
|
228
|
+
# Copilot inherits CLAUDECODE=1 and its MCP server will be
|
|
229
|
+
# identified as "claude-code" instead of "copilot". Workaround:
|
|
230
|
+
# `unset CLAUDECODE` before launching VS Code.
|
|
227
231
|
if not llm_key and os.environ.get("CLAUDECODE", "").strip() == "1":
|
|
228
232
|
llm_key = "claude-code"
|
|
233
|
+
# AGENTVIBES_MCP_FALLBACK is set in .mcp.json. It's the fallback
|
|
234
|
+
# identity for non-Claude-Code tools that read .mcp.json (e.g.
|
|
235
|
+
# VS Code Copilot, which reads .mcp.json with precedence over
|
|
236
|
+
# its own .vscode/mcp.json). Claude Code hits the CLAUDECODE
|
|
237
|
+
# check above first so it's not affected.
|
|
238
|
+
if not llm_key:
|
|
239
|
+
fallback = os.environ.get("AGENTVIBES_MCP_FALLBACK", "").strip()
|
|
240
|
+
if fallback and _re.match(r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", fallback):
|
|
241
|
+
llm_key = fallback
|
|
229
242
|
tts_script = "play-tts.ps1" if self.is_windows else "play-tts.sh"
|
|
230
243
|
play_tts = self.hooks_dir / tts_script
|
|
231
244
|
if self.is_windows:
|
|
@@ -401,15 +414,31 @@ class AgentVibesServer:
|
|
|
401
414
|
Get current AgentVibes configuration.
|
|
402
415
|
|
|
403
416
|
Returns:
|
|
404
|
-
Current voice, personality, language, and
|
|
417
|
+
Current voice, personality, language, provider, and LLM settings
|
|
405
418
|
"""
|
|
419
|
+
import re as _re
|
|
406
420
|
voice = await self._get_current_voice()
|
|
407
421
|
personality = await self._get_personality()
|
|
408
422
|
language = await self._get_language()
|
|
409
423
|
provider = await self._get_provider()
|
|
410
424
|
|
|
425
|
+
# Resolve the LLM key using the same priority as text_to_speech:
|
|
426
|
+
# 1. AGENTVIBES_LLM 2. CLAUDECODE=1 3. AGENTVIBES_MCP_FALLBACK 4. "default"
|
|
427
|
+
llm_key = os.environ.get("AGENTVIBES_LLM", "").strip()
|
|
428
|
+
if llm_key and not _re.match(r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", llm_key):
|
|
429
|
+
llm_key = ""
|
|
430
|
+
if not llm_key and os.environ.get("CLAUDECODE", "").strip() == "1":
|
|
431
|
+
llm_key = "claude-code"
|
|
432
|
+
if not llm_key:
|
|
433
|
+
fallback = os.environ.get("AGENTVIBES_MCP_FALLBACK", "").strip()
|
|
434
|
+
if fallback and _re.match(r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", fallback):
|
|
435
|
+
llm_key = fallback
|
|
436
|
+
if not llm_key:
|
|
437
|
+
llm_key = "default"
|
|
438
|
+
|
|
411
439
|
output = "🎤 Current AgentVibes Configuration\n"
|
|
412
440
|
output += f"{self.SEPARATOR}\n"
|
|
441
|
+
output += f"LLM: {llm_key}\n"
|
|
413
442
|
output += f"Provider: {provider}\n"
|
|
414
443
|
output += f"Voice: {voice}\n"
|
|
415
444
|
output += f"Personality: {personality}\n"
|
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": "5.2.
|
|
4
|
+
"version": "5.2.1",
|
|
5
5
|
"description": "Now your AI Agents can finally talk back! Professional TTS voice for Claude Code, Claude Desktop (via MCP), and Clawdbot with multi-provider support.",
|
|
6
6
|
"homepage": "https://agentvibes.org",
|
|
7
7
|
"keywords": [
|