agentvibes 2.0.10 → 2.0.12

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 (141) hide show
  1. package/.claude/commands/agent-vibes/bmad.md +203 -0
  2. package/.claude/github-star-reminder.txt +1 -1
  3. package/.claude/hooks/bmad-tts-injector.sh +333 -0
  4. package/.claude/hooks/bmad-voice-manager.sh +34 -0
  5. package/.claude/hooks/piper-installer.sh +57 -7
  6. package/.claude/hooks/play-tts-local-wrapper.sh +44 -0
  7. package/.claude/hooks/play-tts-piper.sh +10 -2
  8. package/.claude/hooks/play-tts-remote.sh +81 -0
  9. package/.claude/hooks/play-tts.sh +31 -0
  10. package/.claude/output-styles/agent-vibes.md +52 -36
  11. package/RELEASE_NOTES.md +199 -0
  12. package/agentvibes.org/.claude/commands/agent-vibes/add.md +21 -0
  13. package/agentvibes.org/.claude/commands/agent-vibes/agent-vibes.md +68 -0
  14. package/agentvibes.org/.claude/commands/agent-vibes/commands.json +53 -0
  15. package/agentvibes.org/.claude/commands/agent-vibes/get.md +9 -0
  16. package/agentvibes.org/.claude/commands/agent-vibes/list.md +13 -0
  17. package/agentvibes.org/.claude/commands/agent-vibes/personality.md +79 -0
  18. package/agentvibes.org/.claude/commands/agent-vibes/preview.md +16 -0
  19. package/agentvibes.org/.claude/commands/agent-vibes/provider.md +54 -0
  20. package/agentvibes.org/.claude/commands/agent-vibes/replay.md +19 -0
  21. package/agentvibes.org/.claude/commands/agent-vibes/sample.md +12 -0
  22. package/agentvibes.org/.claude/commands/agent-vibes/sentiment.md +52 -0
  23. package/agentvibes.org/.claude/commands/agent-vibes/set-language.md +47 -0
  24. package/agentvibes.org/.claude/commands/agent-vibes/set-pretext.md +65 -0
  25. package/agentvibes.org/.claude/commands/agent-vibes/switch.md +53 -0
  26. package/agentvibes.org/.claude/commands/agent-vibes/update.md +20 -0
  27. package/agentvibes.org/.claude/commands/agent-vibes/version.md +10 -0
  28. package/agentvibes.org/.claude/commands/agent-vibes/whoami.md +7 -0
  29. package/agentvibes.org/.claude/hooks/bmad-voice-manager.sh +278 -0
  30. package/agentvibes.org/.claude/hooks/language-manager.sh +190 -0
  31. package/agentvibes.org/.claude/hooks/personality-manager.sh +279 -0
  32. package/agentvibes.org/.claude/hooks/piper-download-voices.sh +133 -0
  33. package/agentvibes.org/.claude/hooks/piper-voice-manager.sh +227 -0
  34. package/agentvibes.org/.claude/hooks/play-tts-elevenlabs.sh +201 -0
  35. package/agentvibes.org/.claude/hooks/play-tts-piper.sh +175 -0
  36. package/agentvibes.org/.claude/hooks/play-tts.sh +138 -0
  37. package/agentvibes.org/.claude/hooks/provider-commands.sh +374 -0
  38. package/agentvibes.org/.claude/hooks/provider-manager.sh +196 -0
  39. package/agentvibes.org/.claude/hooks/sentiment-manager.sh +163 -0
  40. package/agentvibes.org/.claude/hooks/voice-manager.sh +349 -0
  41. package/agentvibes.org/.claude/hooks/voices-config.sh +33 -0
  42. package/agentvibes.org/.claude/journal/2025-10-07.html +373 -0
  43. package/agentvibes.org/.claude/journal/index.html +91 -0
  44. package/agentvibes.org/.claude/output-styles/agent-vibes.md +203 -0
  45. package/agentvibes.org/.claude/personalities/angry.md +16 -0
  46. package/agentvibes.org/.claude/personalities/annoying.md +16 -0
  47. package/agentvibes.org/.claude/personalities/crass.md +16 -0
  48. package/agentvibes.org/.claude/personalities/dramatic.md +16 -0
  49. package/agentvibes.org/.claude/personalities/dry-humor.md +52 -0
  50. package/agentvibes.org/.claude/personalities/flirty.md +22 -0
  51. package/agentvibes.org/.claude/personalities/funny.md +16 -0
  52. package/agentvibes.org/.claude/personalities/grandpa.md +34 -0
  53. package/agentvibes.org/.claude/personalities/millennial.md +16 -0
  54. package/agentvibes.org/.claude/personalities/moody.md +16 -0
  55. package/agentvibes.org/.claude/personalities/normal.md +18 -0
  56. package/agentvibes.org/.claude/personalities/pirate.md +16 -0
  57. package/agentvibes.org/.claude/personalities/poetic.md +16 -0
  58. package/agentvibes.org/.claude/personalities/professional.md +16 -0
  59. package/agentvibes.org/.claude/personalities/robot.md +16 -0
  60. package/agentvibes.org/.claude/personalities/sarcastic.md +40 -0
  61. package/agentvibes.org/.claude/personalities/sassy.md +16 -0
  62. package/agentvibes.org/.claude/personalities/surfer-dude.md +16 -0
  63. package/agentvibes.org/.claude/personalities/zen.md +16 -0
  64. package/agentvibes.org/.mcp-minimal.json +60 -0
  65. package/agentvibes.org/CHANGELOG.md +56 -0
  66. package/agentvibes.org/README.md +93 -0
  67. package/agentvibes.org/app/(auth)/layout.tsx +15 -0
  68. package/agentvibes.org/app/(auth)/reset-password/page.tsx +45 -0
  69. package/agentvibes.org/app/(auth)/signin/page.tsx +82 -0
  70. package/agentvibes.org/app/(auth)/signup/page.tsx +104 -0
  71. package/agentvibes.org/app/(default)/layout.tsx +31 -0
  72. package/agentvibes.org/app/(default)/page.tsx +20 -0
  73. package/agentvibes.org/app/api/hello/route.ts +3 -0
  74. package/agentvibes.org/app/css/additional-styles/theme.css +82 -0
  75. package/agentvibes.org/app/css/additional-styles/utility-patterns.css +55 -0
  76. package/agentvibes.org/app/css/style.css +100 -0
  77. package/agentvibes.org/app/layout.tsx +63 -0
  78. package/agentvibes.org/components/cta.tsx +58 -0
  79. package/agentvibes.org/components/features.tsx +256 -0
  80. package/agentvibes.org/components/hero-home.tsx +133 -0
  81. package/agentvibes.org/components/modal-video.tsx +137 -0
  82. package/agentvibes.org/components/page-illustration.tsx +55 -0
  83. package/agentvibes.org/components/spotlight.tsx +77 -0
  84. package/agentvibes.org/components/testimonials.tsx +282 -0
  85. package/agentvibes.org/components/ui/footer.tsx +82 -0
  86. package/agentvibes.org/components/ui/header.tsx +53 -0
  87. package/agentvibes.org/components/ui/logo.tsx +10 -0
  88. package/agentvibes.org/components/workflows.tsx +176 -0
  89. package/agentvibes.org/next.config.js +4 -0
  90. package/agentvibes.org/package-lock.json +1974 -0
  91. package/agentvibes.org/package.json +30 -0
  92. package/agentvibes.org/pnpm-lock.yaml +1141 -0
  93. package/agentvibes.org/postcss.config.js +5 -0
  94. package/agentvibes.org/public/audio/02-sarcastic.mp3 +0 -0
  95. package/agentvibes.org/public/audio/03-angry.mp3 +0 -0
  96. package/agentvibes.org/public/audio/04-grandpa.mp3 +0 -0
  97. package/agentvibes.org/public/audio/05-sarcastic-example2.mp3 +0 -0
  98. package/agentvibes.org/public/audio/french-rachel.mp3 +0 -0
  99. package/agentvibes.org/public/audio/spanish-antoni.mp3 +0 -0
  100. package/agentvibes.org/public/favicon.ico +0 -0
  101. package/agentvibes.org/public/fonts/nacelle-italic.woff2 +0 -0
  102. package/agentvibes.org/public/fonts/nacelle-regular.woff2 +0 -0
  103. package/agentvibes.org/public/fonts/nacelle-semibold.woff2 +0 -0
  104. package/agentvibes.org/public/fonts/nacelle-semibolditalic.woff2 +0 -0
  105. package/agentvibes.org/public/images/blurred-shape-gray.svg +1 -0
  106. package/agentvibes.org/public/images/blurred-shape.svg +1 -0
  107. package/agentvibes.org/public/images/client-logo-01.svg +1 -0
  108. package/agentvibes.org/public/images/client-logo-02.svg +1 -0
  109. package/agentvibes.org/public/images/client-logo-03.svg +1 -0
  110. package/agentvibes.org/public/images/client-logo-04.svg +1 -0
  111. package/agentvibes.org/public/images/client-logo-05.svg +1 -0
  112. package/agentvibes.org/public/images/client-logo-06.svg +1 -0
  113. package/agentvibes.org/public/images/client-logo-07.svg +1 -0
  114. package/agentvibes.org/public/images/client-logo-08.svg +1 -0
  115. package/agentvibes.org/public/images/client-logo-09.svg +1 -0
  116. package/agentvibes.org/public/images/features.png +0 -0
  117. package/agentvibes.org/public/images/footer-illustration.svg +1 -0
  118. package/agentvibes.org/public/images/hero-image-01.jpg +0 -0
  119. package/agentvibes.org/public/images/logo.svg +1 -0
  120. package/agentvibes.org/public/images/page-illustration.svg +1 -0
  121. package/agentvibes.org/public/images/secondary-illustration.svg +1 -0
  122. package/agentvibes.org/public/images/testimonial-01.jpg +0 -0
  123. package/agentvibes.org/public/images/testimonial-02.jpg +0 -0
  124. package/agentvibes.org/public/images/testimonial-03.jpg +0 -0
  125. package/agentvibes.org/public/images/testimonial-04.jpg +0 -0
  126. package/agentvibes.org/public/images/testimonial-05.jpg +0 -0
  127. package/agentvibes.org/public/images/testimonial-06.jpg +0 -0
  128. package/agentvibes.org/public/images/testimonial-07.jpg +0 -0
  129. package/agentvibes.org/public/images/testimonial-08.jpg +0 -0
  130. package/agentvibes.org/public/images/testimonial-09.jpg +0 -0
  131. package/agentvibes.org/public/images/workflow-01.png +0 -0
  132. package/agentvibes.org/public/images/workflow-02.png +0 -0
  133. package/agentvibes.org/public/images/workflow-03.png +0 -0
  134. package/agentvibes.org/public/videos/video.mp4 +0 -0
  135. package/agentvibes.org/tsconfig.json +28 -0
  136. package/agentvibes.org/utils/useMasonry.tsx +67 -0
  137. package/agentvibes.org/utils/useMousePosition.tsx +27 -0
  138. package/docs/REMOTE_TTS_SETUP.md +190 -0
  139. package/package.json +2 -2
  140. package/src/installer.js +191 -7
  141. package/.claude/commands/agent-vibes-bmad.md +0 -132
@@ -0,0 +1,203 @@
1
+ ---
2
+ description: Complete BMAD voice integration for agents
3
+ argument-hint: [command] [args...]
4
+ ---
5
+
6
+ # /agent-vibes:bmad Command
7
+
8
+ Complete BMAD voice integration - assigns unique voices to each BMAD agent AND makes them speak when activated.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ /agent-vibes:bmad <subcommand> [arguments]
14
+ ```
15
+
16
+ ## Subcommands
17
+
18
+ ### `enable`
19
+ Enables voice assignment for BMAD agents AND automatically injects TTS into agent activation instructions.
20
+
21
+ **What it does:**
22
+ 1. ✅ Enables BMAD voice plugin (assigns voices to agents)
23
+ 2. ✅ Backs up current voice/personality settings
24
+ 3. ✅ Injects TTS hooks into all BMAD agent files
25
+ 4. ✅ BMAD agents will now SPEAK when they activate!
26
+
27
+ **Example:**
28
+ ```
29
+ /agent-vibes:bmad enable
30
+ ```
31
+
32
+ **Output:**
33
+ ```
34
+ ✅ BMAD voice plugin enabled
35
+ 💾 Previous settings backed up:
36
+ Voice: Aria
37
+ Personality: normal
38
+
39
+ 📊 BMAD Agent Voice Mappings:
40
+ pm → Matthew Schmitz [professional]
41
+ dev → Jessica Anne Bogart [normal]
42
+ qa → Ralf Eisend [professional]
43
+
44
+ 🎤 Automatically enabling TTS for BMAD agents...
45
+
46
+ ✅ Injected TTS into: pm.md → Voice: Matthew Schmitz
47
+ ✅ Injected TTS into: dev.md → Voice: Jessica Anne Bogart
48
+ ✅ Injected TTS into: qa.md → Voice: Ralf Eisend
49
+
50
+ 🎉 TTS enabled for 10 agents
51
+ 💡 BMAD agents will now speak when activated!
52
+ ```
53
+
54
+ ### `disable`
55
+ Disables BMAD voice plugin AND removes TTS from all BMAD agents.
56
+
57
+ **What it does:**
58
+ 1. ✅ Restores your previous voice/personality settings
59
+ 2. ✅ Removes TTS hooks from all BMAD agent files
60
+ 3. ✅ Disables BMAD voice plugin
61
+ 4. ✅ Agents return to normal (silent) behavior
62
+
63
+ **Example:**
64
+ ```
65
+ /agent-vibes:bmad disable
66
+ ```
67
+
68
+ **Output:**
69
+ ```
70
+ ❌ BMAD voice plugin disabled
71
+ 🔄 Restoring previous settings:
72
+ Voice: Aria
73
+ Personality: normal
74
+
75
+ 🔇 Automatically disabling TTS for BMAD agents...
76
+
77
+ ✅ Removed TTS from: pm.md
78
+ ✅ Removed TTS from: dev.md
79
+ ✅ Removed TTS from: qa.md
80
+
81
+ ✅ TTS disabled for 10 agents
82
+ ```
83
+
84
+ ### `status`
85
+ Shows plugin status and current voice mappings.
86
+
87
+ **Example:**
88
+ ```
89
+ /agent-vibes:bmad status
90
+ ```
91
+
92
+ **Output:**
93
+ ```
94
+ ✅ BMAD voice plugin: ENABLED
95
+
96
+ 📊 BMAD Agent Voice Mappings:
97
+ pm → Matthew Schmitz [professional]
98
+ dev → Jessica Anne Bogart [normal]
99
+ qa → Ralf Eisend [professional]
100
+ ...
101
+ ```
102
+
103
+ ### `list`
104
+ Lists all BMAD agents and their assigned voices.
105
+
106
+ **Example:**
107
+ ```
108
+ /agent-vibes:bmad list
109
+ ```
110
+
111
+ ### `set <agent-id> <voice> [personality]`
112
+ Quickly change voice for specific agent.
113
+
114
+ **Examples:**
115
+ ```
116
+ /agent-vibes:bmad set pm "Aria"
117
+ /agent-vibes:bmad set dev "Cowboy Bob" sarcastic
118
+ /agent-vibes:bmad set qa "Northern Terry" professional
119
+ ```
120
+
121
+ **Arguments:**
122
+ - `agent-id`: BMAD agent identifier (pm, dev, qa, architect, po, analyst, sm, ux-expert, bmad-master, bmad-orchestrator)
123
+ - `voice`: Valid AgentVibes voice name
124
+ - `personality` (optional): Personality to apply (default: normal)
125
+
126
+ ### `edit`
127
+ Opens `.claude/plugins/bmad-voices.md` for manual editing.
128
+
129
+ **Example:**
130
+ ```
131
+ /agent-vibes:bmad edit
132
+ ```
133
+
134
+ **Usage:**
135
+ Edit the markdown table directly to change voice mappings.
136
+
137
+ ## How It Works
138
+
139
+ ### Voice Assignment
140
+ 1. **Plugin File**: `.claude/plugins/bmad-voices.md` contains voice-to-agent mappings
141
+ 2. **Activation Flag**: `.claude/plugins/bmad-voices-enabled.flag` enables/disables the plugin
142
+
143
+ ### TTS Injection (Automatic)
144
+ When you run `/agent-vibes:bmad enable`, the system automatically:
145
+
146
+ 1. **Scans BMAD agents**: Finds all `.md` files in `.bmad-core/agents/` or `bmad-core/agents/`
147
+ 2. **Injects TTS hooks**: Modifies each agent's `activation-instructions` YAML block
148
+ 3. **Assigns voices**: Uses the voice mapping from the plugin file
149
+ 4. **Creates backups**: Saves `.backup-pre-tts` files before modifying
150
+
151
+ **What gets injected:**
152
+ ```yaml
153
+ activation-instructions:
154
+ - STEP 4: Greet user with your name/role and immediately run `*help`
155
+ - # AGENTVIBES-TTS-INJECTION: Speak agent greeting with assigned voice
156
+ - Run this bash command to announce activation: .claude/hooks/play-tts.sh "Agent pm activated and ready" "Matthew Schmitz"
157
+ ```
158
+
159
+ **Result**: When you activate a BMAD agent with `/BMad:agents:pm`, you'll hear:
160
+ 🔊 "Agent pm activated and ready" (spoken in Matthew Schmitz's voice)
161
+
162
+ ### Provider Support
163
+ The TTS injection works with **any configured TTS provider**:
164
+ - ✅ **ElevenLabs** - Uses AI voices with full voice mapping
165
+ - ✅ **Piper TTS** - Uses neural voices (free, offline)
166
+
167
+ The system automatically detects your configured provider via `/agent-vibes:provider info` and uses the appropriate TTS engine. You can switch providers anytime with `/agent-vibes:provider switch` and the BMAD agents will continue speaking using the new provider.
168
+
169
+ ## Available BMAD Agents
170
+
171
+ | Agent ID | Role | Default Voice |
172
+ |----------|------|---------------|
173
+ | pm | Product Manager | Matthew Schmitz |
174
+ | dev | Developer | Jessica Anne Bogart |
175
+ | qa | QA Engineer | Ralf Eisend |
176
+ | architect | Architect | Michael |
177
+ | po | Product Owner | Amy |
178
+ | analyst | Analyst | Lutz Laugh |
179
+ | sm | Scrum Master | Ms. Walker |
180
+ | ux-expert | UX Expert | Aria |
181
+ | bmad-master | BMAD Master | Aria |
182
+ | bmad-orchestrator | Orchestrator | Ms. Walker |
183
+
184
+ ## Implementation Details
185
+
186
+ **For AgentVibes Developers:**
187
+
188
+ The plugin integrates with the Agent Vibes output style through bash hooks:
189
+
190
+ ```bash
191
+ # Check if BMAD agent is active
192
+ BMAD_AGENT_ID=$(echo "$COMMAND" | grep -oP '/BMad:agents:\K[a-z-]+')
193
+
194
+ # Get voice from plugin if enabled
195
+ if [[ -n "$BMAD_AGENT_ID" ]]; then
196
+ MAPPED_VOICE=$(.claude/hooks/bmad-voice-manager.sh get-voice "$BMAD_AGENT_ID")
197
+ if [[ -n "$MAPPED_VOICE" ]]; then
198
+ .claude/hooks/play-tts.sh "message" "$MAPPED_VOICE"
199
+ fi
200
+ fi
201
+ ```
202
+
203
+ !bash .claude/hooks/bmad-voice-manager.sh $ARGUMENTS
@@ -1 +1 @@
1
- 20251009
1
+ 20251010
@@ -0,0 +1,333 @@
1
+ #!/bin/bash
2
+ #
3
+ # @fileoverview BMAD TTS Injection Manager
4
+ # @context Automatically patches BMAD agent files to include AgentVibes TTS hooks
5
+ # @architecture Modifies agent YAML activation-instructions to call play-tts.sh
6
+ # @why Enables BMAD agents to speak their greetings and questions via TTS
7
+ #
8
+
9
+ set -e # Exit on error
10
+
11
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
+ CLAUDE_DIR="$(dirname "$SCRIPT_DIR")"
13
+
14
+ # Colors for output
15
+ GREEN='\033[0;32m'
16
+ YELLOW='\033[1;33m'
17
+ RED='\033[0;31m'
18
+ CYAN='\033[0;36m'
19
+ GRAY='\033[0;90m'
20
+ NC='\033[0m' # No Color
21
+
22
+ # Detect BMAD installation
23
+ detect_bmad() {
24
+ local bmad_core_dir=""
25
+
26
+ # Check current directory first
27
+ if [[ -d ".bmad-core" ]]; then
28
+ bmad_core_dir=".bmad-core"
29
+ # Check parent directory
30
+ elif [[ -d "../.bmad-core" ]]; then
31
+ bmad_core_dir="../.bmad-core"
32
+ # Check for bmad-core (without dot prefix)
33
+ elif [[ -d "bmad-core" ]]; then
34
+ bmad_core_dir="bmad-core"
35
+ elif [[ -d "../bmad-core" ]]; then
36
+ bmad_core_dir="../bmad-core"
37
+ else
38
+ echo -e "${RED}❌ BMAD installation not found${NC}" >&2
39
+ echo -e "${GRAY} Looked for .bmad-core or bmad-core directory${NC}" >&2
40
+ return 1
41
+ fi
42
+
43
+ echo "$bmad_core_dir"
44
+ }
45
+
46
+ # Find all BMAD agents
47
+ find_agents() {
48
+ local bmad_core="$1"
49
+ local agents_dir="$bmad_core/agents"
50
+
51
+ if [[ ! -d "$agents_dir" ]]; then
52
+ echo -e "${RED}❌ Agents directory not found: $agents_dir${NC}"
53
+ return 1
54
+ fi
55
+
56
+ find "$agents_dir" -name "*.md" -type f
57
+ }
58
+
59
+ # Check if agent has TTS injection
60
+ has_tts_injection() {
61
+ local agent_file="$1"
62
+
63
+ if grep -q "# AGENTVIBES-TTS-INJECTION" "$agent_file" 2>/dev/null; then
64
+ return 0
65
+ fi
66
+ return 1
67
+ }
68
+
69
+ # Extract agent ID from file
70
+ get_agent_id() {
71
+ local agent_file="$1"
72
+
73
+ # Look for "id: <agent-id>" in YAML block
74
+ local agent_id=$(grep -E "^ id:" "$agent_file" | head -1 | awk '{print $2}' | tr -d '"' | tr -d "'")
75
+
76
+ if [[ -z "$agent_id" ]]; then
77
+ # Fallback: use filename without extension
78
+ agent_id=$(basename "$agent_file" .md)
79
+ fi
80
+
81
+ echo "$agent_id"
82
+ }
83
+
84
+ # Get voice for agent from BMAD voice mapping
85
+ get_agent_voice() {
86
+ local agent_id="$1"
87
+
88
+ # Use bmad-voice-manager.sh to get voice
89
+ if [[ -f "$SCRIPT_DIR/bmad-voice-manager.sh" ]]; then
90
+ local voice=$("$SCRIPT_DIR/bmad-voice-manager.sh" get-voice "$agent_id" 2>/dev/null || echo "")
91
+ echo "$voice"
92
+ fi
93
+ }
94
+
95
+ # Inject TTS hook into agent activation instructions
96
+ inject_tts() {
97
+ local agent_file="$1"
98
+ local agent_id=$(get_agent_id "$agent_file")
99
+ local agent_voice=$(get_agent_voice "$agent_id")
100
+
101
+ # Check if already injected
102
+ if has_tts_injection "$agent_file"; then
103
+ echo -e "${YELLOW}⚠️ TTS already injected in: $(basename "$agent_file")${NC}"
104
+ return 0
105
+ fi
106
+
107
+ # Create backup
108
+ cp "$agent_file" "$agent_file.backup-pre-tts"
109
+
110
+ # Find the activation-instructions section
111
+ if ! grep -q "activation-instructions:" "$agent_file"; then
112
+ echo -e "${RED}❌ No activation-instructions found in: $(basename "$agent_file")${NC}"
113
+ return 1
114
+ fi
115
+
116
+ # Create TTS injection script for activation
117
+ local activation_injection=""
118
+ local persona_injection=""
119
+
120
+ if [[ -n "$agent_voice" ]]; then
121
+ activation_injection=" - # AGENTVIBES-TTS-INJECTION: STEP 3.5 - Announce activation with TTS and set context
122
+ - STEP 3.5a: Use Bash tool to create context file: echo \"${agent_id}\" > .bmad-agent-context
123
+ - STEP 3.5b: Use Bash tool to speak: .claude/hooks/play-tts.sh \"Agent ${agent_id} activated and ready\" \"${agent_voice}\"
124
+ - AGENTVIBES-TTS-INJECTION: MANDATORY RESPONSE PROTOCOL - Before showing ANY response to user, execute this workflow:
125
+ - AGENTVIBES-TTS-STEP 1: Draft your complete response text
126
+ - AGENTVIBES-TTS-STEP 2: Scan response for questions (lines with ? or numbered lists or phrases like What/Should/Would)
127
+ - AGENTVIBES-TTS-STEP 3: If questions found, use Bash tool to speak them: .claude/hooks/play-tts.sh \"question text\" \"${agent_voice}\"
128
+ - AGENTVIBES-TTS-STEP 4: Show the response text to user
129
+ - AGENTVIBES-TTS-INJECTION: On exit command (*exit), use Bash tool FIRST to cleanup: rm -f .bmad-agent-context"
130
+ persona_injection=" - AGENTVIBES-TTS-INJECTION: Before every response, scan for questions and speak them using Bash tool"
131
+ else
132
+ activation_injection=" - # AGENTVIBES-TTS-INJECTION: STEP 3.5 - Announce activation with TTS and set context
133
+ - STEP 3.5a: Use Bash tool to create context file: echo \"${agent_id}\" > .bmad-agent-context
134
+ - STEP 3.5b: Use Bash tool to speak: .claude/hooks/play-tts.sh \"Agent ${agent_id} activated and ready\"
135
+ - AGENTVIBES-TTS-INJECTION: MANDATORY RESPONSE PROTOCOL - Before showing ANY response to user, execute this workflow:
136
+ - AGENTVIBES-TTS-STEP 1: Draft your complete response text
137
+ - AGENTVIBES-TTS-STEP 2: Scan response for questions (lines with ? or numbered lists or phrases like What/Should/Would)
138
+ - AGENTVIBES-TTS-STEP 3: If questions found, use Bash tool to speak them: .claude/hooks/play-tts.sh \"question text\"
139
+ - AGENTVIBES-TTS-STEP 4: Show the response text to user
140
+ - AGENTVIBES-TTS-INJECTION: On exit command (*exit), use Bash tool FIRST to cleanup: rm -f .bmad-agent-context"
141
+ persona_injection=" - AGENTVIBES-TTS-INJECTION: Before every response, scan for questions and speak them using Bash tool"
142
+ fi
143
+
144
+ # Insert activation TTS call after "STEP 4: Greet user" line
145
+ # Insert persona TTS instruction in core_principles section
146
+ awk -v activation="$activation_injection" -v persona="$persona_injection" '
147
+ /STEP 4:.*[Gg]reet/ {
148
+ print
149
+ print activation
150
+ next
151
+ }
152
+ /^ core_principles:/ {
153
+ print
154
+ print persona
155
+ next
156
+ }
157
+ { print }
158
+ ' "$agent_file" > "$agent_file.tmp"
159
+
160
+ mv "$agent_file.tmp" "$agent_file"
161
+
162
+ echo -e "${GREEN}✅ Injected TTS into: $(basename "$agent_file") → Voice: ${agent_voice:-default}${NC}"
163
+ }
164
+
165
+ # Remove TTS injection from agent
166
+ remove_tts() {
167
+ local agent_file="$1"
168
+
169
+ # Check if has injection
170
+ if ! has_tts_injection "$agent_file"; then
171
+ echo -e "${GRAY} No TTS in: $(basename "$agent_file")${NC}"
172
+ return 0
173
+ fi
174
+
175
+ # Create backup
176
+ cp "$agent_file" "$agent_file.backup-tts-removal"
177
+
178
+ # Remove TTS injection lines
179
+ sed -i.bak '/# AGENTVIBES-TTS-INJECTION/,+1d' "$agent_file"
180
+ rm -f "$agent_file.bak"
181
+
182
+ echo -e "${GREEN}✅ Removed TTS from: $(basename "$agent_file")${NC}"
183
+ }
184
+
185
+ # Show status of TTS injections
186
+ show_status() {
187
+ local bmad_core=$(detect_bmad)
188
+ if [[ -z "$bmad_core" ]]; then
189
+ return 1
190
+ fi
191
+
192
+ echo -e "${CYAN}📊 BMAD TTS Injection Status:${NC}"
193
+ echo ""
194
+
195
+ local agents=$(find_agents "$bmad_core")
196
+ local enabled_count=0
197
+ local disabled_count=0
198
+
199
+ while IFS= read -r agent_file; do
200
+ local agent_id=$(get_agent_id "$agent_file")
201
+ local agent_name=$(basename "$agent_file" .md)
202
+
203
+ if has_tts_injection "$agent_file"; then
204
+ local voice=$(get_agent_voice "$agent_id")
205
+ echo -e " ${GREEN}✅${NC} $agent_name (${agent_id}) → Voice: ${voice:-default}"
206
+ ((enabled_count++))
207
+ else
208
+ echo -e " ${GRAY}❌ $agent_name (${agent_id})${NC}"
209
+ ((disabled_count++))
210
+ fi
211
+ done <<< "$agents"
212
+
213
+ echo ""
214
+ echo -e "${CYAN}Summary:${NC} $enabled_count enabled, $disabled_count disabled"
215
+ }
216
+
217
+ # Enable TTS for all agents
218
+ enable_all() {
219
+ local bmad_core=$(detect_bmad)
220
+ if [[ -z "$bmad_core" ]]; then
221
+ return 1
222
+ fi
223
+
224
+ echo -e "${CYAN}🎤 Enabling TTS for all BMAD agents...${NC}"
225
+ echo ""
226
+
227
+ local agents=$(find_agents "$bmad_core")
228
+ local success_count=0
229
+ local skip_count=0
230
+
231
+ while IFS= read -r agent_file; do
232
+ if has_tts_injection "$agent_file"; then
233
+ ((skip_count++))
234
+ continue
235
+ fi
236
+
237
+ if inject_tts "$agent_file"; then
238
+ ((success_count++))
239
+ fi
240
+ done <<< "$agents"
241
+
242
+ echo ""
243
+ echo -e "${GREEN}🎉 TTS enabled for $success_count agents${NC}"
244
+ [[ $skip_count -gt 0 ]] && echo -e "${YELLOW} Skipped $skip_count agents (already enabled)${NC}"
245
+ echo ""
246
+ echo -e "${CYAN}💡 BMAD agents will now speak when activated!${NC}"
247
+ }
248
+
249
+ # Disable TTS for all agents
250
+ disable_all() {
251
+ local bmad_core=$(detect_bmad)
252
+ if [[ -z "$bmad_core" ]]; then
253
+ return 1
254
+ fi
255
+
256
+ echo -e "${CYAN}🔇 Disabling TTS for all BMAD agents...${NC}"
257
+ echo ""
258
+
259
+ local agents=$(find_agents "$bmad_core")
260
+ local success_count=0
261
+
262
+ while IFS= read -r agent_file; do
263
+ if remove_tts "$agent_file"; then
264
+ ((success_count++))
265
+ fi
266
+ done <<< "$agents"
267
+
268
+ echo ""
269
+ echo -e "${GREEN}✅ TTS disabled for $success_count agents${NC}"
270
+ }
271
+
272
+ # Restore from backup
273
+ restore_backup() {
274
+ local bmad_core=$(detect_bmad)
275
+ if [[ -z "$bmad_core" ]]; then
276
+ return 1
277
+ fi
278
+
279
+ echo -e "${CYAN}🔄 Restoring agents from backup...${NC}"
280
+ echo ""
281
+
282
+ local agents_dir="$bmad_core/agents"
283
+ local backup_count=0
284
+
285
+ for backup_file in "$agents_dir"/*.backup-pre-tts; do
286
+ if [[ -f "$backup_file" ]]; then
287
+ local original_file="${backup_file%.backup-pre-tts}"
288
+ cp "$backup_file" "$original_file"
289
+ echo -e "${GREEN}✅ Restored: $(basename "$original_file")${NC}"
290
+ ((backup_count++))
291
+ fi
292
+ done
293
+
294
+ if [[ $backup_count -eq 0 ]]; then
295
+ echo -e "${YELLOW}⚠️ No backups found${NC}"
296
+ else
297
+ echo ""
298
+ echo -e "${GREEN}✅ Restored $backup_count agents from backup${NC}"
299
+ fi
300
+ }
301
+
302
+ # Main command dispatcher
303
+ case "${1:-help}" in
304
+ enable)
305
+ enable_all
306
+ ;;
307
+ disable)
308
+ disable_all
309
+ ;;
310
+ status)
311
+ show_status
312
+ ;;
313
+ restore)
314
+ restore_backup
315
+ ;;
316
+ help|*)
317
+ echo -e "${CYAN}AgentVibes BMAD TTS Injection Manager${NC}"
318
+ echo ""
319
+ echo "Usage: bmad-tts-injector.sh {enable|disable|status|restore}"
320
+ echo ""
321
+ echo "Commands:"
322
+ echo " enable Inject TTS hooks into all BMAD agents"
323
+ echo " disable Remove TTS hooks from all BMAD agents"
324
+ echo " status Show TTS injection status for all agents"
325
+ echo " restore Restore agents from backup (undo changes)"
326
+ echo ""
327
+ echo "What it does:"
328
+ echo " • Automatically patches BMAD agent activation instructions"
329
+ echo " • Adds TTS calls when agents greet users"
330
+ echo " • Uses voice mapping from AgentVibes BMAD plugin"
331
+ echo " • Creates backups before modifying files"
332
+ ;;
333
+ esac
@@ -111,6 +111,23 @@ EOF
111
111
  [[ -n "$CURRENT_SENTIMENT" ]] && echo " Sentiment: $CURRENT_SENTIMENT"
112
112
  echo ""
113
113
  list_mappings
114
+
115
+ # Automatically inject TTS into BMAD agents
116
+ echo ""
117
+ echo "🎤 Automatically enabling TTS for BMAD agents..."
118
+ echo ""
119
+
120
+ # Get the directory where this script is located
121
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
122
+
123
+ # Check if bmad-tts-injector.sh exists
124
+ if [[ -f "$SCRIPT_DIR/bmad-tts-injector.sh" ]]; then
125
+ # Run the TTS injector
126
+ "$SCRIPT_DIR/bmad-tts-injector.sh" enable
127
+ else
128
+ echo "⚠️ TTS injector not found at: $SCRIPT_DIR/bmad-tts-injector.sh"
129
+ echo " You can manually enable TTS with: /agent-vibes:bmad-tts enable"
130
+ fi
114
131
  }
115
132
 
116
133
  # Disable plugin
@@ -151,6 +168,23 @@ disable_plugin() {
151
168
  fi
152
169
 
153
170
  rm -f "$ENABLED_FLAG"
171
+
172
+ # Automatically remove TTS from BMAD agents
173
+ echo ""
174
+ echo "🔇 Automatically disabling TTS for BMAD agents..."
175
+ echo ""
176
+
177
+ # Get the directory where this script is located
178
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
179
+
180
+ # Check if bmad-tts-injector.sh exists
181
+ if [[ -f "$SCRIPT_DIR/bmad-tts-injector.sh" ]]; then
182
+ # Run the TTS injector disable
183
+ "$SCRIPT_DIR/bmad-tts-injector.sh" disable
184
+ else
185
+ echo "⚠️ TTS injector not found"
186
+ echo " You can manually disable TTS with: /agent-vibes:bmad-tts disable"
187
+ fi
154
188
  }
155
189
 
156
190
  # List all mappings
@@ -69,15 +69,65 @@ fi
69
69
 
70
70
  # Install Piper TTS
71
71
  echo "📥 Installing Piper TTS via pipx..."
72
- pipx install piper-tts
72
+ pipx install piper-tts || pipx install --force piper-tts
73
73
 
74
+ # Ensure pipx's bin directory is in PATH
75
+ echo ""
76
+ echo "🔧 Configuring PATH..."
77
+ pipx ensurepath
78
+
79
+ # Add pipx bin to current session PATH
80
+ PIPX_BIN_DIR="$HOME/.local/bin"
81
+ if [[ -d "$PIPX_BIN_DIR" ]]; then
82
+ export PATH="$PIPX_BIN_DIR:$PATH"
83
+ fi
84
+
85
+ # Check if piper is available now
74
86
  if ! command -v piper &> /dev/null; then
75
- echo ""
76
- echo "❌ Installation completed but piper command not found in PATH"
77
- echo ""
78
- echo " Try running: pipx ensurepath"
79
- echo " Then restart your terminal"
80
- exit 1
87
+ # Try to find piper in the pipx installation directory
88
+ if [[ -f "$PIPX_BIN_DIR/piper" ]]; then
89
+ echo "✅ Piper installed at: $PIPX_BIN_DIR/piper"
90
+
91
+ # Update shell configuration files
92
+ SHELL_CONFIG=""
93
+ if [[ -f "$HOME/.bashrc" ]]; then
94
+ SHELL_CONFIG="$HOME/.bashrc"
95
+ elif [[ -f "$HOME/.zshrc" ]]; then
96
+ SHELL_CONFIG="$HOME/.zshrc"
97
+ fi
98
+
99
+ if [[ -n "$SHELL_CONFIG" ]]; then
100
+ # Check if PATH update already exists
101
+ if ! grep -q "export PATH=\"\$HOME/.local/bin:\$PATH\"" "$SHELL_CONFIG"; then
102
+ echo "" >> "$SHELL_CONFIG"
103
+ echo "# Added by AgentVibes Piper installer" >> "$SHELL_CONFIG"
104
+ echo "export PATH=\"\$HOME/.local/bin:\$PATH\"" >> "$SHELL_CONFIG"
105
+ echo "✅ Updated $SHELL_CONFIG with PATH configuration"
106
+ fi
107
+ fi
108
+
109
+ # Make piper available in current session
110
+ export PATH="$PIPX_BIN_DIR:$PATH"
111
+
112
+ # Verify it's working
113
+ if "$PIPX_BIN_DIR/piper" --version &> /dev/null; then
114
+ echo "✅ Piper is working! You may need to restart your terminal or run:"
115
+ echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
116
+ else
117
+ echo "❌ Piper installed but not executing properly"
118
+ echo " Please restart your terminal and try again"
119
+ exit 1
120
+ fi
121
+ else
122
+ echo ""
123
+ echo "❌ Installation completed but piper command not found"
124
+ echo ""
125
+ echo " Try these steps:"
126
+ echo " 1. Run: pipx ensurepath"
127
+ echo " 2. Restart your terminal"
128
+ echo " 3. Run: export PATH=\"\$HOME/.local/bin:\$PATH\""
129
+ exit 1
130
+ fi
81
131
  fi
82
132
 
83
133
  echo ""
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+
3
+ # Local TTS Wrapper for AgentVibes
4
+ # This script runs on your local Windows WSL and receives audio from remote server
5
+ # Usage: ./play-tts-local-wrapper.sh "Text to speak"
6
+
7
+ # Configuration
8
+ REMOTE_HOST="${AGENTVIBES_REMOTE_HOST:-ubuntu-rdp}"
9
+ REMOTE_SCRIPT=".claude/hooks/play-tts-remote.sh"
10
+
11
+ # Get text from arguments or stdin
12
+ if [ $# -gt 0 ]; then
13
+ TEXT="$*"
14
+ else
15
+ TEXT=$(cat)
16
+ fi
17
+
18
+ # Function to play audio based on what's available
19
+ play_audio() {
20
+ # Try paplay first (WSLg PulseAudio)
21
+ if command -v paplay &> /dev/null; then
22
+ paplay --format=s16le --channels=1 --rate=22050
23
+ # Try aplay next
24
+ elif command -v aplay &> /dev/null; then
25
+ aplay -f S16_LE -c 1 -r 22050
26
+ # Try PowerShell audio playback as last resort
27
+ elif command -v powershell.exe &> /dev/null; then
28
+ # Save to temp file and play with Windows Media Player
29
+ TEMP_FILE="/tmp/tts_audio_$$.wav"
30
+ cat > "$TEMP_FILE"
31
+ powershell.exe -Command "& {(New-Object Media.SoundPlayer '$TEMP_FILE').PlaySync()}" 2>/dev/null
32
+ rm -f "$TEMP_FILE"
33
+ else
34
+ echo "Error: No audio playback method available" >&2
35
+ exit 1
36
+ fi
37
+ }
38
+
39
+ # SSH to remote, generate TTS, and pipe back for local playback
40
+ echo "$TEXT" | ssh "$REMOTE_HOST" "bash $REMOTE_SCRIPT" | play_audio
41
+
42
+ # Alternative method if you want to save the audio file
43
+ # echo "$TEXT" | ssh "$REMOTE_HOST" "bash $REMOTE_SCRIPT" > /tmp/tts_output.wav
44
+ # paplay /tmp/tts_output.wav