agentvibes 1.0.12 → 1.0.14
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/commands/agent-vibes-bmad.md +132 -0
- package/.claude/hooks/bmad-voice-manager.sh +278 -0
- package/.claude/hooks/personality-manager.sh +29 -112
- package/.claude/hooks/play-tts.sh +4 -0
- package/.claude/hooks/sentiment-manager.sh +26 -31
- package/.claude/hooks/voice-manager.sh +8 -2
- package/.claude/output-styles/agent-vibes.md +75 -7
- package/.claude/personalities/dry-humor.md +52 -0
- package/.claude/personalities/grandpa.md +1 -1
- package/.claude/personalities/normal.md +1 -0
- package/.claude/plugins/bmad-voices-enabled.flag +0 -0
- package/.claude/plugins/bmad-voices.md +42 -0
- package/README.md +222 -200
- package/package.json +1 -1
- package/src/installer.js +30 -1
- package/templates/output-styles/agent-vibes.md +75 -7
- package/test/unit/personality-voice-mapping.bats +119 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# /agent-vibes:bmad Command
|
|
2
|
+
|
|
3
|
+
Manage BMAD voice plugin integration for automatic voice assignment to BMAD agents.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
/agent-vibes:bmad <subcommand> [arguments]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Subcommands
|
|
12
|
+
|
|
13
|
+
### `enable`
|
|
14
|
+
Enables automatic voice assignment for BMAD agents.
|
|
15
|
+
|
|
16
|
+
**Example:**
|
|
17
|
+
```
|
|
18
|
+
/agent-vibes:bmad enable
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Output:**
|
|
22
|
+
- Creates `.claude/plugins/bmad-voices-enabled.flag`
|
|
23
|
+
- Shows current agent voice mappings
|
|
24
|
+
- Confirms activation
|
|
25
|
+
|
|
26
|
+
### `disable`
|
|
27
|
+
Disables BMAD voice plugin (reverts to default AgentVibes behavior).
|
|
28
|
+
|
|
29
|
+
**Example:**
|
|
30
|
+
```
|
|
31
|
+
/agent-vibes:bmad disable
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Output:**
|
|
35
|
+
- Removes activation flag
|
|
36
|
+
- AgentVibes uses default voice settings
|
|
37
|
+
|
|
38
|
+
### `status`
|
|
39
|
+
Shows plugin status and current voice mappings.
|
|
40
|
+
|
|
41
|
+
**Example:**
|
|
42
|
+
```
|
|
43
|
+
/agent-vibes:bmad status
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Output:**
|
|
47
|
+
```
|
|
48
|
+
✅ BMAD voice plugin: ENABLED
|
|
49
|
+
|
|
50
|
+
📊 BMAD Agent Voice Mappings:
|
|
51
|
+
pm → Matthew Schmitz [professional]
|
|
52
|
+
dev → Jessica Anne Bogart [normal]
|
|
53
|
+
qa → Ralf Eisend [professional]
|
|
54
|
+
...
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### `list`
|
|
58
|
+
Lists all BMAD agents and their assigned voices.
|
|
59
|
+
|
|
60
|
+
**Example:**
|
|
61
|
+
```
|
|
62
|
+
/agent-vibes:bmad list
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### `set <agent-id> <voice> [personality]`
|
|
66
|
+
Quickly change voice for specific agent.
|
|
67
|
+
|
|
68
|
+
**Examples:**
|
|
69
|
+
```
|
|
70
|
+
/agent-vibes:bmad set pm "Aria"
|
|
71
|
+
/agent-vibes:bmad set dev "Cowboy Bob" sarcastic
|
|
72
|
+
/agent-vibes:bmad set qa "Northern Terry" professional
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Arguments:**
|
|
76
|
+
- `agent-id`: BMAD agent identifier (pm, dev, qa, architect, po, analyst, sm, ux-expert, bmad-master, bmad-orchestrator)
|
|
77
|
+
- `voice`: Valid AgentVibes voice name
|
|
78
|
+
- `personality` (optional): Personality to apply (default: normal)
|
|
79
|
+
|
|
80
|
+
### `edit`
|
|
81
|
+
Opens `.claude/plugins/bmad-voices.md` for manual editing.
|
|
82
|
+
|
|
83
|
+
**Example:**
|
|
84
|
+
```
|
|
85
|
+
/agent-vibes:bmad edit
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Usage:**
|
|
89
|
+
Edit the markdown table directly to change voice mappings.
|
|
90
|
+
|
|
91
|
+
## How It Works
|
|
92
|
+
|
|
93
|
+
1. **Plugin File**: `.claude/plugins/bmad-voices.md` contains voice mappings
|
|
94
|
+
2. **Activation Flag**: `.claude/plugins/bmad-voices-enabled.flag` enables/disables plugin
|
|
95
|
+
3. **Auto-Detection**: When a BMAD agent activates (e.g., `/BMad:agents:pm`), AgentVibes automatically:
|
|
96
|
+
- Detects the agent ID from the command
|
|
97
|
+
- Looks up voice mapping in plugin file
|
|
98
|
+
- Uses assigned voice for TTS acknowledgments/completions
|
|
99
|
+
|
|
100
|
+
## Available BMAD Agents
|
|
101
|
+
|
|
102
|
+
| Agent ID | Role | Default Voice |
|
|
103
|
+
|----------|------|---------------|
|
|
104
|
+
| pm | Product Manager | Matthew Schmitz |
|
|
105
|
+
| dev | Developer | Jessica Anne Bogart |
|
|
106
|
+
| qa | QA Engineer | Ralf Eisend |
|
|
107
|
+
| architect | Architect | Michael |
|
|
108
|
+
| po | Product Owner | Amy |
|
|
109
|
+
| analyst | Analyst | Lutz Laugh |
|
|
110
|
+
| sm | Scrum Master | Ms. Walker |
|
|
111
|
+
| ux-expert | UX Expert | Aria |
|
|
112
|
+
| bmad-master | BMAD Master | Aria |
|
|
113
|
+
| bmad-orchestrator | Orchestrator | Ms. Walker |
|
|
114
|
+
|
|
115
|
+
## Implementation Details
|
|
116
|
+
|
|
117
|
+
**For AgentVibes Developers:**
|
|
118
|
+
|
|
119
|
+
The plugin integrates with the Agent Vibes output style through bash hooks:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Check if BMAD agent is active
|
|
123
|
+
BMAD_AGENT_ID=$(echo "$COMMAND" | grep -oP '/BMad:agents:\K[a-z-]+')
|
|
124
|
+
|
|
125
|
+
# Get voice from plugin if enabled
|
|
126
|
+
if [[ -n "$BMAD_AGENT_ID" ]]; then
|
|
127
|
+
MAPPED_VOICE=$(.claude/hooks/bmad-voice-manager.sh get-voice "$BMAD_AGENT_ID")
|
|
128
|
+
if [[ -n "$MAPPED_VOICE" ]]; then
|
|
129
|
+
.claude/hooks/play-tts.sh "message" "$MAPPED_VOICE"
|
|
130
|
+
fi
|
|
131
|
+
fi
|
|
132
|
+
```
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
PLUGIN_DIR=".claude/plugins"
|
|
4
|
+
PLUGIN_FILE="$PLUGIN_DIR/bmad-voices.md"
|
|
5
|
+
ENABLED_FLAG="$PLUGIN_DIR/bmad-voices-enabled.flag"
|
|
6
|
+
|
|
7
|
+
# Auto-enable plugin if BMAD is detected
|
|
8
|
+
auto_enable_if_bmad_detected() {
|
|
9
|
+
# Check if BMAD is installed
|
|
10
|
+
if [[ -f ".bmad-core/install-manifest.yaml" ]] && [[ ! -f "$ENABLED_FLAG" ]]; then
|
|
11
|
+
# BMAD detected but plugin not enabled - enable it silently
|
|
12
|
+
mkdir -p "$PLUGIN_DIR"
|
|
13
|
+
touch "$ENABLED_FLAG"
|
|
14
|
+
return 0
|
|
15
|
+
fi
|
|
16
|
+
return 1
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
# Parse markdown table to get voice mapping
|
|
20
|
+
get_agent_voice() {
|
|
21
|
+
local agent_id="$1"
|
|
22
|
+
|
|
23
|
+
# Auto-enable if BMAD is detected
|
|
24
|
+
auto_enable_if_bmad_detected
|
|
25
|
+
|
|
26
|
+
if [[ ! -f "$ENABLED_FLAG" ]]; then
|
|
27
|
+
echo "" # Plugin disabled
|
|
28
|
+
return
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if [[ ! -f "$PLUGIN_FILE" ]]; then
|
|
32
|
+
echo "" # Plugin file missing
|
|
33
|
+
return
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Extract voice from markdown table
|
|
37
|
+
local voice=$(grep "^| $agent_id " "$PLUGIN_FILE" | \
|
|
38
|
+
awk -F'|' '{print $4}' | \
|
|
39
|
+
sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
40
|
+
|
|
41
|
+
echo "$voice"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
# Get personality for agent
|
|
45
|
+
get_agent_personality() {
|
|
46
|
+
local agent_id="$1"
|
|
47
|
+
|
|
48
|
+
if [[ ! -f "$PLUGIN_FILE" ]]; then
|
|
49
|
+
echo ""
|
|
50
|
+
return
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
local personality=$(grep "^| $agent_id " "$PLUGIN_FILE" | \
|
|
54
|
+
awk -F'|' '{print $5}' | \
|
|
55
|
+
sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
56
|
+
|
|
57
|
+
echo "$personality"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# Check if plugin is enabled
|
|
61
|
+
is_plugin_enabled() {
|
|
62
|
+
[[ -f "$ENABLED_FLAG" ]] && echo "true" || echo "false"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
# Enable plugin
|
|
66
|
+
enable_plugin() {
|
|
67
|
+
mkdir -p "$PLUGIN_DIR"
|
|
68
|
+
|
|
69
|
+
# Save current settings before enabling
|
|
70
|
+
BACKUP_FILE="$PLUGIN_DIR/.bmad-previous-settings"
|
|
71
|
+
|
|
72
|
+
# Save current voice
|
|
73
|
+
if [[ -f ".claude/tts-voice.txt" ]]; then
|
|
74
|
+
CURRENT_VOICE=$(cat .claude/tts-voice.txt 2>/dev/null)
|
|
75
|
+
elif [[ -f "$HOME/.claude/tts-voice.txt" ]]; then
|
|
76
|
+
CURRENT_VOICE=$(cat "$HOME/.claude/tts-voice.txt" 2>/dev/null)
|
|
77
|
+
else
|
|
78
|
+
CURRENT_VOICE="Aria"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
# Save current personality
|
|
82
|
+
if [[ -f ".claude/tts-personality.txt" ]]; then
|
|
83
|
+
CURRENT_PERSONALITY=$(cat .claude/tts-personality.txt 2>/dev/null)
|
|
84
|
+
elif [[ -f "$HOME/.claude/tts-personality.txt" ]]; then
|
|
85
|
+
CURRENT_PERSONALITY=$(cat "$HOME/.claude/tts-personality.txt" 2>/dev/null)
|
|
86
|
+
else
|
|
87
|
+
CURRENT_PERSONALITY="normal"
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
# Save current sentiment
|
|
91
|
+
if [[ -f ".claude/tts-sentiment.txt" ]]; then
|
|
92
|
+
CURRENT_SENTIMENT=$(cat .claude/tts-sentiment.txt 2>/dev/null)
|
|
93
|
+
elif [[ -f "$HOME/.claude/tts-sentiment.txt" ]]; then
|
|
94
|
+
CURRENT_SENTIMENT=$(cat "$HOME/.claude/tts-sentiment.txt" 2>/dev/null)
|
|
95
|
+
else
|
|
96
|
+
CURRENT_SENTIMENT=""
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
# Write backup
|
|
100
|
+
cat > "$BACKUP_FILE" <<EOF
|
|
101
|
+
VOICE=$CURRENT_VOICE
|
|
102
|
+
PERSONALITY=$CURRENT_PERSONALITY
|
|
103
|
+
SENTIMENT=$CURRENT_SENTIMENT
|
|
104
|
+
EOF
|
|
105
|
+
|
|
106
|
+
touch "$ENABLED_FLAG"
|
|
107
|
+
echo "✅ BMAD voice plugin enabled"
|
|
108
|
+
echo "💾 Previous settings backed up:"
|
|
109
|
+
echo " Voice: $CURRENT_VOICE"
|
|
110
|
+
echo " Personality: $CURRENT_PERSONALITY"
|
|
111
|
+
[[ -n "$CURRENT_SENTIMENT" ]] && echo " Sentiment: $CURRENT_SENTIMENT"
|
|
112
|
+
echo ""
|
|
113
|
+
list_mappings
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# Disable plugin
|
|
117
|
+
disable_plugin() {
|
|
118
|
+
BACKUP_FILE="$PLUGIN_DIR/.bmad-previous-settings"
|
|
119
|
+
|
|
120
|
+
# Check if we have a backup to restore
|
|
121
|
+
if [[ -f "$BACKUP_FILE" ]]; then
|
|
122
|
+
source "$BACKUP_FILE"
|
|
123
|
+
|
|
124
|
+
echo "❌ BMAD voice plugin disabled"
|
|
125
|
+
echo "🔄 Restoring previous settings:"
|
|
126
|
+
echo " Voice: $VOICE"
|
|
127
|
+
echo " Personality: $PERSONALITY"
|
|
128
|
+
[[ -n "$SENTIMENT" ]] && echo " Sentiment: $SENTIMENT"
|
|
129
|
+
|
|
130
|
+
# Restore voice
|
|
131
|
+
if [[ -n "$VOICE" ]]; then
|
|
132
|
+
echo "$VOICE" > .claude/tts-voice.txt 2>/dev/null || echo "$VOICE" > "$HOME/.claude/tts-voice.txt"
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
# Restore personality
|
|
136
|
+
if [[ -n "$PERSONALITY" ]] && [[ "$PERSONALITY" != "normal" ]]; then
|
|
137
|
+
echo "$PERSONALITY" > .claude/tts-personality.txt 2>/dev/null || echo "$PERSONALITY" > "$HOME/.claude/tts-personality.txt"
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
# Restore sentiment
|
|
141
|
+
if [[ -n "$SENTIMENT" ]]; then
|
|
142
|
+
echo "$SENTIMENT" > .claude/tts-sentiment.txt 2>/dev/null || echo "$SENTIMENT" > "$HOME/.claude/tts-sentiment.txt"
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
# Clean up backup
|
|
146
|
+
rm -f "$BACKUP_FILE"
|
|
147
|
+
else
|
|
148
|
+
echo "❌ BMAD voice plugin disabled"
|
|
149
|
+
echo "⚠️ No previous settings found to restore"
|
|
150
|
+
echo "AgentVibes will use current voice/personality settings"
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
rm -f "$ENABLED_FLAG"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
# List all mappings
|
|
157
|
+
list_mappings() {
|
|
158
|
+
if [[ ! -f "$PLUGIN_FILE" ]]; then
|
|
159
|
+
echo "❌ Plugin file not found: $PLUGIN_FILE"
|
|
160
|
+
return 1
|
|
161
|
+
fi
|
|
162
|
+
|
|
163
|
+
echo "📊 BMAD Agent Voice Mappings:"
|
|
164
|
+
echo ""
|
|
165
|
+
|
|
166
|
+
grep "^| " "$PLUGIN_FILE" | grep -v "Agent ID" | grep -v "^|---" | \
|
|
167
|
+
while IFS='|' read -r _ agent_id name voice personality _; do
|
|
168
|
+
agent_id=$(echo "$agent_id" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
169
|
+
name=$(echo "$name" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
170
|
+
voice=$(echo "$voice" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
171
|
+
personality=$(echo "$personality" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
172
|
+
|
|
173
|
+
[[ -n "$agent_id" ]] && echo " $agent_id → $voice [$personality]"
|
|
174
|
+
done
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Set voice for agent
|
|
178
|
+
set_agent_voice() {
|
|
179
|
+
local agent_id="$1"
|
|
180
|
+
local voice="$2"
|
|
181
|
+
local personality="${3:-normal}"
|
|
182
|
+
|
|
183
|
+
if [[ ! -f "$PLUGIN_FILE" ]]; then
|
|
184
|
+
echo "❌ Plugin file not found: $PLUGIN_FILE"
|
|
185
|
+
return 1
|
|
186
|
+
fi
|
|
187
|
+
|
|
188
|
+
# Check if agent exists
|
|
189
|
+
if ! grep -q "^| $agent_id " "$PLUGIN_FILE"; then
|
|
190
|
+
echo "❌ Agent '$agent_id' not found in plugin"
|
|
191
|
+
return 1
|
|
192
|
+
fi
|
|
193
|
+
|
|
194
|
+
# Update the voice and personality in the table
|
|
195
|
+
sed -i.bak "s/^| $agent_id |.*| .* | .* |$/| $agent_id | $(grep "^| $agent_id " "$PLUGIN_FILE" | awk -F'|' '{print $3}') | $voice | $personality |/" "$PLUGIN_FILE"
|
|
196
|
+
|
|
197
|
+
echo "✅ Updated $agent_id → $voice [$personality]"
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
# Show status
|
|
201
|
+
show_status() {
|
|
202
|
+
# Check for BMAD installation
|
|
203
|
+
local bmad_installed="false"
|
|
204
|
+
if [[ -f ".bmad-core/install-manifest.yaml" ]]; then
|
|
205
|
+
bmad_installed="true"
|
|
206
|
+
fi
|
|
207
|
+
|
|
208
|
+
if [[ $(is_plugin_enabled) == "true" ]]; then
|
|
209
|
+
echo "✅ BMAD voice plugin: ENABLED"
|
|
210
|
+
if [[ "$bmad_installed" == "true" ]]; then
|
|
211
|
+
echo "🔍 BMAD detected: Auto-enabled"
|
|
212
|
+
fi
|
|
213
|
+
else
|
|
214
|
+
echo "❌ BMAD voice plugin: DISABLED"
|
|
215
|
+
if [[ "$bmad_installed" == "true" ]]; then
|
|
216
|
+
echo "⚠️ BMAD detected but plugin disabled (enable with: /agent-vibes-bmad enable)"
|
|
217
|
+
fi
|
|
218
|
+
fi
|
|
219
|
+
echo ""
|
|
220
|
+
list_mappings
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
# Edit plugin file
|
|
224
|
+
edit_plugin() {
|
|
225
|
+
if [[ ! -f "$PLUGIN_FILE" ]]; then
|
|
226
|
+
echo "❌ Plugin file not found: $PLUGIN_FILE"
|
|
227
|
+
return 1
|
|
228
|
+
fi
|
|
229
|
+
|
|
230
|
+
echo "Opening $PLUGIN_FILE for editing..."
|
|
231
|
+
echo "Edit the markdown table to change voice mappings"
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
# Main command dispatcher
|
|
235
|
+
case "${1:-help}" in
|
|
236
|
+
enable)
|
|
237
|
+
enable_plugin
|
|
238
|
+
;;
|
|
239
|
+
disable)
|
|
240
|
+
disable_plugin
|
|
241
|
+
;;
|
|
242
|
+
status)
|
|
243
|
+
show_status
|
|
244
|
+
;;
|
|
245
|
+
list)
|
|
246
|
+
list_mappings
|
|
247
|
+
;;
|
|
248
|
+
set)
|
|
249
|
+
if [[ -z "$2" ]] || [[ -z "$3" ]]; then
|
|
250
|
+
echo "Usage: bmad-voice-manager.sh set <agent-id> <voice> [personality]"
|
|
251
|
+
exit 1
|
|
252
|
+
fi
|
|
253
|
+
set_agent_voice "$2" "$3" "$4"
|
|
254
|
+
;;
|
|
255
|
+
get-voice)
|
|
256
|
+
get_agent_voice "$2"
|
|
257
|
+
;;
|
|
258
|
+
get-personality)
|
|
259
|
+
get_agent_personality "$2"
|
|
260
|
+
;;
|
|
261
|
+
edit)
|
|
262
|
+
edit_plugin
|
|
263
|
+
;;
|
|
264
|
+
*)
|
|
265
|
+
echo "Usage: bmad-voice-manager.sh {enable|disable|status|list|set|get-voice|get-personality|edit}"
|
|
266
|
+
echo ""
|
|
267
|
+
echo "Commands:"
|
|
268
|
+
echo " enable Enable BMAD voice plugin"
|
|
269
|
+
echo " disable Disable BMAD voice plugin"
|
|
270
|
+
echo " status Show plugin status and mappings"
|
|
271
|
+
echo " list List all agent voice mappings"
|
|
272
|
+
echo " set <id> <voice> Set voice for agent"
|
|
273
|
+
echo " get-voice <id> Get voice for agent"
|
|
274
|
+
echo " get-personality <id> Get personality for agent"
|
|
275
|
+
echo " edit Edit plugin configuration"
|
|
276
|
+
exit 1
|
|
277
|
+
;;
|
|
278
|
+
esac
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# Personality manager for AgentVibes - adds character to TTS messages
|
|
3
3
|
|
|
4
|
-
PERSONALITY_FILE="$HOME/.claude/tts-personality.txt"
|
|
5
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
5
|
PERSONALITIES_DIR="$SCRIPT_DIR/../personalities"
|
|
7
6
|
|
|
7
|
+
# Project-local file first, global fallback
|
|
8
|
+
PROJECT_ROOT="$SCRIPT_DIR/../.."
|
|
9
|
+
if [[ -d "$PROJECT_ROOT/.claude" ]]; then
|
|
10
|
+
PERSONALITY_FILE="$PROJECT_ROOT/.claude/tts-personality.txt"
|
|
11
|
+
else
|
|
12
|
+
PERSONALITY_FILE="$HOME/.claude/tts-personality.txt"
|
|
13
|
+
fi
|
|
14
|
+
|
|
8
15
|
# Function to get personality data from markdown file
|
|
9
16
|
get_personality_data() {
|
|
10
17
|
local personality="$1"
|
|
@@ -128,117 +135,27 @@ case "$1" in
|
|
|
128
135
|
# Get TTS script path
|
|
129
136
|
TTS_SCRIPT="$SCRIPT_DIR/play-tts.sh"
|
|
130
137
|
|
|
131
|
-
#
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"Flirty personality? My pleasure, love~"
|
|
153
|
-
"Oh I'm gonna enjoy this, babe~"
|
|
154
|
-
"Ready to charm your socks off, honey~"
|
|
155
|
-
)
|
|
156
|
-
REMARK="${REMARKS[$RANDOM % ${#REMARKS[@]}]}"
|
|
157
|
-
echo "💬 $REMARK"
|
|
158
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
159
|
-
;;
|
|
160
|
-
angry)
|
|
161
|
-
REMARK="FINE! I'm angry now. Happy?!"
|
|
162
|
-
echo "💬 $REMARK"
|
|
163
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
164
|
-
;;
|
|
165
|
-
pirate)
|
|
166
|
-
REMARK="Arr matey! This scalawag be speakin' like a proper pirate now!"
|
|
167
|
-
echo "💬 $REMARK"
|
|
168
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
169
|
-
;;
|
|
170
|
-
robot)
|
|
171
|
-
REMARK="PERSONALITY MODULE LOADED. SYSTEM OPERATING IN $PERSONALITY MODE."
|
|
172
|
-
echo "💬 $REMARK"
|
|
173
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
174
|
-
;;
|
|
175
|
-
zen)
|
|
176
|
-
REMARK="Inner peace flows through me like water over smooth stones..."
|
|
177
|
-
echo "💬 $REMARK"
|
|
178
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
179
|
-
;;
|
|
180
|
-
dramatic)
|
|
181
|
-
REMARK="BEHOLD! A NEW PERSONALITY EMERGES FROM THE DEPTHS OF CONFIGURATION!"
|
|
182
|
-
echo "💬 $REMARK"
|
|
183
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
184
|
-
;;
|
|
185
|
-
millennial)
|
|
186
|
-
REMARK="No cap, this personality is bussin fr fr! Periodt!"
|
|
187
|
-
echo "💬 $REMARK"
|
|
188
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
189
|
-
;;
|
|
190
|
-
surfer-dude)
|
|
191
|
-
REMARK="Duuuude, this personality is totally gnarly, bro!"
|
|
192
|
-
echo "💬 $REMARK"
|
|
193
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
194
|
-
;;
|
|
195
|
-
annoying)
|
|
196
|
-
REMARK="OMG THIS IS SO EXCITING!!! I'M ANNOYING NOW!!! ISN'T THIS AMAZING?!"
|
|
197
|
-
echo "💬 $REMARK"
|
|
198
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
199
|
-
;;
|
|
200
|
-
crass)
|
|
201
|
-
REMARK="Yeah yeah, I'm crass now. What's it to ya?"
|
|
202
|
-
echo "💬 $REMARK"
|
|
203
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
204
|
-
;;
|
|
205
|
-
moody)
|
|
206
|
-
REMARK="*sighs* ...another personality... not that it matters..."
|
|
207
|
-
echo "💬 $REMARK"
|
|
208
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
209
|
-
;;
|
|
210
|
-
funny)
|
|
211
|
-
REMARK="*ba dum tss* I'm here all week folks! Try the personality, it's hilarious!"
|
|
212
|
-
echo "💬 $REMARK"
|
|
213
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
214
|
-
;;
|
|
215
|
-
poetic)
|
|
216
|
-
REMARK="Like petals on the wind, my words shall dance with elegance and grace..."
|
|
217
|
-
echo "💬 $REMARK"
|
|
218
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
219
|
-
;;
|
|
220
|
-
professional)
|
|
221
|
-
REMARK="Acknowledged. Personality configuration has been successfully updated per your request."
|
|
222
|
-
echo "💬 $REMARK"
|
|
223
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
224
|
-
;;
|
|
225
|
-
sassy)
|
|
226
|
-
REMARK="Oh honey, you just activated SASS MODE. Buckle up, sweetie!"
|
|
227
|
-
echo "💬 $REMARK"
|
|
228
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
229
|
-
;;
|
|
230
|
-
normal)
|
|
231
|
-
REMARK="Personality set to normal. Back to professional mode."
|
|
232
|
-
echo "💬 $REMARK"
|
|
233
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
234
|
-
;;
|
|
235
|
-
*)
|
|
236
|
-
# For custom personalities
|
|
237
|
-
REMARK="$PERSONALITY personality activated!"
|
|
238
|
-
echo "💬 $REMARK"
|
|
239
|
-
"$TTS_SCRIPT" "$REMARK"
|
|
240
|
-
;;
|
|
241
|
-
esac
|
|
138
|
+
# Try to get acknowledgment from personality file
|
|
139
|
+
PERSONALITY_FILE_PATH="$PERSONALITIES_DIR/${PERSONALITY}.md"
|
|
140
|
+
REMARK=""
|
|
141
|
+
|
|
142
|
+
if [[ -f "$PERSONALITY_FILE_PATH" ]]; then
|
|
143
|
+
# Extract example responses from personality file (lines starting with "- ")
|
|
144
|
+
mapfile -t EXAMPLES < <(grep '^- "' "$PERSONALITY_FILE_PATH" | sed 's/^- "//; s/"$//')
|
|
145
|
+
|
|
146
|
+
if [[ ${#EXAMPLES[@]} -gt 0 ]]; then
|
|
147
|
+
# Pick a random example
|
|
148
|
+
REMARK="${EXAMPLES[$RANDOM % ${#EXAMPLES[@]}]}"
|
|
149
|
+
fi
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
# Fallback if no examples found
|
|
153
|
+
if [[ -z "$REMARK" ]]; then
|
|
154
|
+
REMARK="Personality set to ${PERSONALITY}!"
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
echo "💬 $REMARK"
|
|
158
|
+
"$TTS_SCRIPT" "$REMARK"
|
|
242
159
|
|
|
243
160
|
echo ""
|
|
244
161
|
echo "Note: AI will generate unique ${PERSONALITY} responses - no fixed templates!"
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
#
|
|
10
10
|
# This allows different sessions to use different voices for easy identification!
|
|
11
11
|
|
|
12
|
+
# Fix locale warnings
|
|
13
|
+
export LC_ALL=C
|
|
14
|
+
|
|
12
15
|
TEXT="$1"
|
|
13
16
|
VOICE_OVERRIDE="$2" # Optional: voice name or direct voice ID
|
|
14
17
|
API_KEY="${ELEVENLABS_API_KEY}"
|
|
@@ -111,6 +114,7 @@ if [ -f "${TEMP_FILE}" ]; then
|
|
|
111
114
|
(paplay "${TEMP_FILE}" 2>/dev/null || aplay "${TEMP_FILE}" 2>/dev/null || mpg123 "${TEMP_FILE}" 2>/dev/null) &
|
|
112
115
|
# Keep temp files for later review - cleaned up weekly by cron
|
|
113
116
|
echo "🎵 Saved to: ${TEMP_FILE}"
|
|
117
|
+
echo "🎤 Voice used: ${VOICE_NAME} (${VOICE_ID})"
|
|
114
118
|
else
|
|
115
119
|
echo "Failed to generate audio"
|
|
116
120
|
exit 1
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# Sentiment manager for AgentVibes - applies personality to current voice
|
|
3
3
|
|
|
4
|
-
SENTIMENT_FILE="$HOME/.claude/tts-sentiment.txt"
|
|
5
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
5
|
PERSONALITIES_DIR="$SCRIPT_DIR/../personalities"
|
|
7
6
|
|
|
7
|
+
# Project-local file first, global fallback
|
|
8
|
+
PROJECT_ROOT="$SCRIPT_DIR/../.."
|
|
9
|
+
if [[ -d "$PROJECT_ROOT/.claude" ]]; then
|
|
10
|
+
SENTIMENT_FILE="$PROJECT_ROOT/.claude/tts-sentiment.txt"
|
|
11
|
+
else
|
|
12
|
+
SENTIMENT_FILE="$HOME/.claude/tts-sentiment.txt"
|
|
13
|
+
fi
|
|
14
|
+
|
|
8
15
|
# Function to get personality data from markdown file
|
|
9
16
|
get_personality_data() {
|
|
10
17
|
local personality="$1"
|
|
@@ -90,36 +97,24 @@ case "$1" in
|
|
|
90
97
|
# Make a sentiment-appropriate remark with TTS
|
|
91
98
|
TTS_SCRIPT="$SCRIPT_DIR/play-tts.sh"
|
|
92
99
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
REMARK="FINE! I'm keeping my voice but I'm ANGRY now! Got it?!"
|
|
112
|
-
;;
|
|
113
|
-
pirate)
|
|
114
|
-
REMARK="Arr! This voice be speakin' like a pirate now, matey!"
|
|
115
|
-
;;
|
|
116
|
-
robot)
|
|
117
|
-
REMARK="SENTIMENT MODULE LOADED. MAINTAINING VOICE IDENTITY. PERSONALITY OVERRIDE: ROBOT MODE."
|
|
118
|
-
;;
|
|
119
|
-
*)
|
|
120
|
-
REMARK="Sentiment set to $SENTIMENT while maintaining current voice"
|
|
121
|
-
;;
|
|
122
|
-
esac
|
|
100
|
+
# Try to get acknowledgment from personality file (sentiments use same personality files)
|
|
101
|
+
PERSONALITY_FILE_PATH="$PERSONALITIES_DIR/${SENTIMENT}.md"
|
|
102
|
+
REMARK=""
|
|
103
|
+
|
|
104
|
+
if [[ -f "$PERSONALITY_FILE_PATH" ]]; then
|
|
105
|
+
# Extract example responses from personality file (lines starting with "- ")
|
|
106
|
+
mapfile -t EXAMPLES < <(grep '^- "' "$PERSONALITY_FILE_PATH" | sed 's/^- "//; s/"$//')
|
|
107
|
+
|
|
108
|
+
if [[ ${#EXAMPLES[@]} -gt 0 ]]; then
|
|
109
|
+
# Pick a random example
|
|
110
|
+
REMARK="${EXAMPLES[$RANDOM % ${#EXAMPLES[@]}]}"
|
|
111
|
+
fi
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# Fallback if no examples found
|
|
115
|
+
if [[ -z "$REMARK" ]]; then
|
|
116
|
+
REMARK="Sentiment set to ${SENTIMENT} while maintaining current voice"
|
|
117
|
+
fi
|
|
123
118
|
|
|
124
119
|
echo "💬 $REMARK"
|
|
125
120
|
"$TTS_SCRIPT" "$REMARK"
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
# Voice Manager - Handle voice switching and listing
|
|
3
3
|
# Usage: voice-manager.sh [list|switch|get] [voice_name]
|
|
4
4
|
|
|
5
|
-
VOICE_FILE="/tmp/claude-tts-voice-${USER}.txt"
|
|
6
|
-
|
|
7
5
|
# Source the single voice configuration file
|
|
8
6
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
7
|
source "$SCRIPT_DIR/voices-config.sh"
|
|
10
8
|
|
|
9
|
+
# Project-local file first, global fallback
|
|
10
|
+
PROJECT_ROOT="$SCRIPT_DIR/../.."
|
|
11
|
+
if [[ -d "$PROJECT_ROOT/.claude" ]]; then
|
|
12
|
+
VOICE_FILE="$PROJECT_ROOT/.claude/tts-voice.txt"
|
|
13
|
+
else
|
|
14
|
+
VOICE_FILE="$HOME/.claude/tts-voice.txt"
|
|
15
|
+
fi
|
|
16
|
+
|
|
11
17
|
case "$1" in
|
|
12
18
|
list)
|
|
13
19
|
echo "🎤 Available TTS Voices:"
|