agentvibes 5.3.0 → 5.5.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 (222) hide show
  1. package/.agentvibes/LITE-MODE.md +236 -0
  2. package/.agentvibes/README.md +136 -0
  3. package/.agentvibes/backup/session-start-tts.sh.20251210_212814 +141 -0
  4. package/.agentvibes/backups/agents/analyst_20260204_144958.md +78 -0
  5. package/.agentvibes/backups/agents/architect_20260204_144958.md +72 -0
  6. package/.agentvibes/backups/agents/dev_20260204_144958.md +74 -0
  7. package/.agentvibes/backups/agents/pm_20260204_144958.md +72 -0
  8. package/.agentvibes/backups/agents/quick-flow-solo-dev_20260204_144958.md +64 -0
  9. package/.agentvibes/backups/agents/sm_20260204_144958.md +87 -0
  10. package/.agentvibes/backups/agents/tea_20260204_144958.md +79 -0
  11. package/.agentvibes/backups/agents/tech-writer_20260204_144958.md +82 -0
  12. package/.agentvibes/backups/agents/ux-designer_20260204_144958.md +80 -0
  13. package/.agentvibes/bmad/bmad-voices.md +69 -69
  14. package/.agentvibes/config/README-personality-defaults.md +162 -0
  15. package/.agentvibes/config/mode.txt +1 -0
  16. package/.agentvibes/config/personality-voice-defaults.default.json +21 -0
  17. package/.agentvibes/config/save-audio.txt +1 -0
  18. package/.agentvibes/config/voice-metadata.json +160 -0
  19. package/.agentvibes/config.json +24 -15
  20. package/.agentvibes/hooks/help.sh +191 -0
  21. package/.agentvibes/hooks/post-tool-use-lite.sh +111 -0
  22. package/.agentvibes/hooks/save-audio-manager.sh +162 -0
  23. package/.agentvibes/hooks/session-start-full-optimized.sh +102 -0
  24. package/.agentvibes/hooks/session-start-full.sh +142 -0
  25. package/.agentvibes/hooks/session-start-lite-v2.sh +34 -0
  26. package/.agentvibes/hooks/session-start-lite.sh +29 -0
  27. package/.agentvibes/hooks/stop-lite.sh +115 -0
  28. package/.agentvibes/hooks/switch-mode.sh +215 -0
  29. package/.agentvibes/output-styles/audio-summary.md +30 -0
  30. package/.claude/activation-instructions +54 -54
  31. package/.claude/audio/voice-samples/piper/alan.wav +0 -0
  32. package/.claude/audio/voice-samples/piper/amy.wav +0 -0
  33. package/.claude/audio/voice-samples/piper/charlotte.wav +0 -0
  34. package/.claude/audio/voice-samples/piper/joe.wav +0 -0
  35. package/.claude/audio/voice-samples/piper/john.wav +0 -0
  36. package/.claude/audio/voice-samples/piper/katherine.wav +0 -0
  37. package/.claude/audio/voice-samples/piper/kristin.wav +0 -0
  38. package/.claude/audio/voice-samples/piper/linda.wav +0 -0
  39. package/.claude/audio/voice-samples/piper/marcus.wav +0 -0
  40. package/.claude/audio/voice-samples/piper/ryan.wav +0 -0
  41. package/.claude/commands/agent-vibes/add.md +21 -21
  42. package/.claude/commands/agent-vibes/agent-vibes.md +101 -101
  43. package/.claude/commands/agent-vibes/agent.md +79 -79
  44. package/.claude/commands/agent-vibes/background-music.md +111 -111
  45. package/.claude/commands/agent-vibes/bmad.md +198 -198
  46. package/.claude/commands/agent-vibes/clean.md +18 -18
  47. package/.claude/commands/agent-vibes/cleanup.md +18 -18
  48. package/.claude/commands/agent-vibes/commands.json +145 -145
  49. package/.claude/commands/agent-vibes/effects.md +97 -97
  50. package/.claude/commands/agent-vibes/get.md +9 -9
  51. package/.claude/commands/agent-vibes/hide.md +91 -91
  52. package/.claude/commands/agent-vibes/language.md +23 -23
  53. package/.claude/commands/agent-vibes/learn.md +67 -67
  54. package/.claude/commands/agent-vibes/list.md +13 -13
  55. package/.claude/commands/agent-vibes/mute.md +37 -37
  56. package/.claude/commands/agent-vibes/preview.md +17 -17
  57. package/.claude/commands/agent-vibes/provider.md +68 -68
  58. package/.claude/commands/agent-vibes/replay-target.md +14 -14
  59. package/.claude/commands/agent-vibes/sample.md +12 -12
  60. package/.claude/commands/agent-vibes/set-favorite-voice.md +84 -84
  61. package/.claude/commands/agent-vibes/set-pretext.md +65 -65
  62. package/.claude/commands/agent-vibes/set-speed.md +41 -41
  63. package/.claude/commands/agent-vibes/show.md +84 -84
  64. package/.claude/commands/agent-vibes/switch.md +87 -87
  65. package/.claude/commands/agent-vibes/target-voice.md +26 -26
  66. package/.claude/commands/agent-vibes/target.md +30 -30
  67. package/.claude/commands/agent-vibes/translate.md +68 -68
  68. package/.claude/commands/agent-vibes/unmute.md +45 -45
  69. package/.claude/commands/agent-vibes/whoami.md +7 -7
  70. package/.claude/commands/agent-vibes-bmad-voices.md +117 -117
  71. package/.claude/commands/agent-vibes-rdp.md +24 -24
  72. package/.claude/config/audio-effects.cfg +16 -11
  73. package/.claude/config/audio-effects.cfg.sample +52 -52
  74. package/.claude/config/background-music-position.txt +27 -0
  75. package/.claude/config/background-music-volume.txt +1 -1
  76. package/.claude/config/background-music.cfg +1 -0
  77. package/.claude/config/background-music.txt +1 -0
  78. package/.claude/config/tts-speech-rate.txt +1 -4
  79. package/.claude/config/tts-verbosity.txt +1 -0
  80. package/.claude/docs/TERMUX_SETUP.md +408 -408
  81. package/.claude/github-star-reminder.txt +1 -1
  82. package/.claude/hooks/README-TTS-QUEUE.md +135 -135
  83. package/.claude/hooks/audio-cache-utils.sh +0 -0
  84. package/.claude/hooks/audio-processor.sh +60 -14
  85. package/.claude/hooks/background-music-manager.sh +0 -0
  86. package/.claude/hooks/bmad-party-manager.sh +225 -0
  87. package/.claude/hooks/bmad-party-speak.sh +0 -0
  88. package/.claude/hooks/bmad-speak-enhanced.sh +0 -0
  89. package/.claude/hooks/bmad-speak.sh +12 -15
  90. package/.claude/hooks/bmad-tts-injector.sh +0 -0
  91. package/.claude/hooks/bmad-voice-manager.sh +0 -0
  92. package/.claude/hooks/clawdbot-receiver-SECURE.sh +25 -23
  93. package/.claude/hooks/clawdbot-receiver.sh +4 -28
  94. package/.claude/hooks/clean-audio-cache.sh +0 -0
  95. package/.claude/hooks/cleanup-cache.sh +0 -0
  96. package/.claude/hooks/configure-rdp-mode.sh +0 -0
  97. package/.claude/hooks/download-extra-voices.sh +0 -0
  98. package/.claude/hooks/effects-manager.sh +0 -0
  99. package/.claude/hooks/github-star-reminder.sh +0 -0
  100. package/.claude/hooks/language-manager.sh +0 -0
  101. package/.claude/hooks/learn-manager.sh +0 -0
  102. package/.claude/hooks/macos-voice-manager.sh +0 -0
  103. package/.claude/hooks/migrate-background-music.sh +0 -0
  104. package/.claude/hooks/migrate-to-agentvibes.sh +0 -0
  105. package/.claude/hooks/optimize-background-music.sh +0 -0
  106. package/.claude/hooks/personality-manager.sh +0 -0
  107. package/.claude/hooks/piper-download-voices.sh +0 -0
  108. package/.claude/hooks/piper-installer.sh +1 -1
  109. package/.claude/hooks/piper-multispeaker-registry.sh +0 -0
  110. package/.claude/hooks/piper-voice-manager.sh +0 -0
  111. package/.claude/hooks/play-tts-enhanced.sh +0 -0
  112. package/.claude/hooks/play-tts-macos.sh +6 -12
  113. package/.claude/hooks/play-tts-piper.sh +52 -81
  114. package/.claude/hooks/play-tts-soprano.sh +9 -43
  115. package/.claude/hooks/play-tts-ssh-remote.sh +43 -215
  116. package/.claude/hooks/play-tts-termux-ssh.sh +0 -0
  117. package/.claude/hooks/play-tts.sh +41 -20
  118. package/.claude/hooks/post-response.sh +41 -0
  119. package/.claude/hooks/prepare-release.sh +0 -0
  120. package/.claude/hooks/provider-commands.sh +0 -0
  121. package/.claude/hooks/provider-manager.sh +0 -0
  122. package/.claude/hooks/replay-target-audio.sh +0 -0
  123. package/.claude/hooks/requirements.txt +6 -6
  124. package/.claude/hooks/sentiment-manager.sh +0 -0
  125. package/.claude/hooks/session-start-tts.sh +56 -39
  126. package/.claude/hooks/soprano-gradio-synth.py +139 -139
  127. package/.claude/hooks/speed-manager.sh +0 -0
  128. package/.claude/hooks/stop.sh +63 -0
  129. package/.claude/hooks/termux-installer.sh +0 -0
  130. package/.claude/hooks/translate-manager.sh +0 -0
  131. package/.claude/hooks/translator.py +237 -237
  132. package/.claude/hooks/tts-queue-worker.sh +0 -0
  133. package/.claude/hooks/tts-queue.sh +0 -0
  134. package/.claude/hooks/verbosity-manager.sh +0 -0
  135. package/.claude/hooks/voice-manager.sh +26 -4
  136. package/.claude/hooks-windows/audio-cache-utils.ps1 +119 -119
  137. package/.claude/hooks-windows/bmad-party-speak.ps1 +278 -278
  138. package/.claude/hooks-windows/bmad-speak.ps1 +264 -264
  139. package/.claude/hooks-windows/clean-audio-cache.ps1 +53 -53
  140. package/.claude/hooks-windows/effects-manager.ps1 +294 -294
  141. package/.claude/hooks-windows/language-manager.ps1 +193 -193
  142. package/.claude/hooks-windows/learn-manager.ps1 +241 -241
  143. package/.claude/hooks-windows/personality-manager.ps1 +266 -266
  144. package/.claude/hooks-windows/play-tts-soprano.ps1 +5 -5
  145. package/.claude/hooks-windows/play-tts-termux-ssh.ps1 +138 -138
  146. package/.claude/hooks-windows/play-tts-windows-piper.ps1 +178 -0
  147. package/.claude/hooks-windows/play-tts-windows-sapi.ps1 +108 -0
  148. package/.claude/hooks-windows/play-tts.ps1 +265 -507
  149. package/.claude/hooks-windows/provider-manager.ps1 +158 -192
  150. package/.claude/hooks-windows/session-start-tts.ps1 +55 -46
  151. package/.claude/hooks-windows/soprano-gradio-synth.py +153 -153
  152. package/.claude/hooks-windows/speed-manager.ps1 +166 -166
  153. package/.claude/hooks-windows/voice-manager-windows.ps1 +176 -260
  154. package/.claude/output-styles/agent-vibes.md +202 -202
  155. package/.claude/personalities/angry.md +14 -14
  156. package/.claude/personalities/annoying.md +14 -14
  157. package/.claude/personalities/crass.md +14 -14
  158. package/.claude/personalities/dramatic.md +14 -14
  159. package/.claude/personalities/dry-humor.md +50 -50
  160. package/.claude/personalities/flirty.md +20 -20
  161. package/.claude/personalities/funny.md +14 -14
  162. package/.claude/personalities/grandpa.md +32 -32
  163. package/.claude/personalities/millennial.md +14 -14
  164. package/.claude/personalities/moody.md +14 -14
  165. package/.claude/personalities/normal.md +16 -16
  166. package/.claude/personalities/pirate.md +14 -14
  167. package/.claude/personalities/poetic.md +14 -14
  168. package/.claude/personalities/professional.md +14 -14
  169. package/.claude/personalities/rapper.md +55 -55
  170. package/.claude/personalities/robot.md +14 -14
  171. package/.claude/personalities/sarcastic.md +38 -38
  172. package/.claude/personalities/sassy.md +14 -14
  173. package/.claude/personalities/surfer-dude.md +14 -14
  174. package/.claude/personalities/zen.md +14 -14
  175. package/.claude/piper-voices-dir.txt +1 -0
  176. package/.claude/settings.json +25 -15
  177. package/.claude/verbosity.txt +1 -1
  178. package/.clawdbot/README.md +105 -105
  179. package/.clawdbot/skill/SKILL.md +149 -145
  180. package/.mcp.json +30 -11
  181. package/CLAUDE.md +170 -215
  182. package/README.md +207 -521
  183. package/RELEASE_NOTES.md +1172 -1976
  184. package/WINDOWS-SETUP.md +208 -208
  185. package/bin/agent-vibes +0 -0
  186. package/bin/agentvibes-voice-browser.js +64 -1289
  187. package/bin/agentvibes.js +28 -0
  188. package/bin/ensure-soprano-running.sh +43 -0
  189. package/bin/mcp-server.js +121 -121
  190. package/bin/mcp-server.sh +0 -0
  191. package/bin/test-bmad-pr +78 -78
  192. package/mcp-server/QUICK_START.md +203 -203
  193. package/mcp-server/README.md +345 -345
  194. package/mcp-server/WINDOWS_SETUP.md +260 -260
  195. package/mcp-server/docs/troubleshooting-audio.md +313 -313
  196. package/mcp-server/examples/claude_desktop_config.json +11 -11
  197. package/mcp-server/examples/claude_desktop_config_piper.json +9 -9
  198. package/mcp-server/examples/custom_instructions.md +169 -169
  199. package/mcp-server/install-deps.js +130 -130
  200. package/mcp-server/pyproject.toml +52 -52
  201. package/mcp-server/requirements.txt +2 -2
  202. package/mcp-server/server.py +1467 -1578
  203. package/mcp-server/test_server.py +395 -395
  204. package/package.json +1 -3
  205. package/setup-windows.ps1 +815 -815
  206. package/src/console/tabs/music-tab.js +5 -2
  207. package/src/console/tabs/voices-tab.js +71 -37
  208. package/src/installer.js +52 -5
  209. package/src/services/llm-provider-service.js +1 -1
  210. package/templates/agentvibes-receiver.sh +158 -483
  211. package/templates/audio/welcome-music.mp3 +0 -0
  212. package/.agentvibes/bmad-voice-map.json +0 -104
  213. package/.agentvibes/copilot-sessions.log +0 -4
  214. package/.claude/config/audio-effects-bmad.cfg +0 -50
  215. package/.claude/config/intro-text.txt +0 -1
  216. package/.claude/config/personality.txt +0 -1
  217. package/.claude/config/piper-speech-rate.txt +0 -4
  218. package/.claude/config/piper-target-speech-rate.txt +0 -1
  219. package/.claude/config/reverb-level.txt +0 -1
  220. package/.claude/config/tts-target-speech-rate.txt +0 -1
  221. package/voice-assignments.json +0 -8245
  222. /package/{.claude → .agentvibes}/config/agentvibes.json +0 -0
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .agentvibes/hooks/help.sh
4
+ #
5
+ # AgentVibes Help & Diagnostic Tool
6
+ # User-friendly status check with actionable suggestions
7
+ #
8
+
9
+ set -euo pipefail
10
+
11
+ # Fix locale warnings
12
+ export LC_ALL=C
13
+
14
+ # Directories
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ AGENTVIBES_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ CLAUDE_DIR=".claude"
18
+ CONFIG_DIR="$AGENTVIBES_DIR/config"
19
+
20
+ # Files
21
+ MODE_FILE="$CONFIG_DIR/mode.txt"
22
+ SESSION_START_HOOK="$CLAUDE_DIR/hooks/session-start-tts.sh"
23
+ POST_TOOL_USE_HOOK="$CLAUDE_DIR/hooks/post-tool-use.sh"
24
+ PLAY_TTS_SCRIPT="$CLAUDE_DIR/hooks/play-tts.sh"
25
+
26
+ # Colors
27
+ GREEN='\033[0;32m'
28
+ YELLOW='\033[1;33m'
29
+ RED='\033[0;31m'
30
+ BLUE='\033[0;34m'
31
+ GRAY='\033[0;90m'
32
+ NC='\033[0m' # No Color
33
+
34
+ # Get current mode
35
+ get_current_mode() {
36
+ if [[ -f "$MODE_FILE" ]]; then
37
+ cat "$MODE_FILE"
38
+ else
39
+ echo "full"
40
+ fi
41
+ }
42
+
43
+ # Get current voice
44
+ get_current_voice() {
45
+ if [[ -f ".claude/tts-voice.txt" ]]; then
46
+ cat ".claude/tts-voice.txt"
47
+ elif [[ -f "$HOME/.claude/tts-voice.txt" ]]; then
48
+ cat "$HOME/.claude/tts-voice.txt"
49
+ else
50
+ echo "Default"
51
+ fi
52
+ }
53
+
54
+ # Get current provider
55
+ get_current_provider() {
56
+ if [[ -f ".claude/tts-provider.txt" ]]; then
57
+ cat ".claude/tts-provider.txt"
58
+ elif [[ -f "$HOME/.claude/tts-provider.txt" ]]; then
59
+ cat "$HOME/.claude/tts-provider.txt"
60
+ else
61
+ echo "piper"
62
+ fi
63
+ }
64
+
65
+ # Get current verbosity
66
+ get_current_verbosity() {
67
+ if [[ -f ".claude/tts-verbosity.txt" ]]; then
68
+ cat ".claude/tts-verbosity.txt"
69
+ elif [[ -f "$HOME/.claude/tts-verbosity.txt" ]]; then
70
+ cat "$HOME/.claude/tts-verbosity.txt"
71
+ else
72
+ echo "high"
73
+ fi
74
+ }
75
+
76
+ # Check if muted
77
+ is_muted() {
78
+ if [[ -f "$HOME/.agentvibes-muted" ]] || [[ -f ".claude/agentvibes-muted" ]]; then
79
+ return 0 # True - is muted
80
+ else
81
+ return 1 # False - not muted
82
+ fi
83
+ }
84
+
85
+ # Run diagnostics (returns 0 if all good, 1 if issues)
86
+ run_diagnostics() {
87
+ local issues=0
88
+
89
+ # Check session-start hook
90
+ if [[ ! -f "$SESSION_START_HOOK" ]]; then
91
+ echo -e "${RED}✗${NC} Session-start hook missing"
92
+ echo -e "${GRAY} Expected: $SESSION_START_HOOK${NC}"
93
+ ((issues++))
94
+ elif [[ ! -x "$SESSION_START_HOOK" ]]; then
95
+ echo -e "${YELLOW}⚠${NC} Session-start hook not executable"
96
+ echo -e "${GRAY} Run: chmod +x $SESSION_START_HOOK${NC}"
97
+ ((issues++))
98
+ fi
99
+
100
+ # Check play-tts script
101
+ if [[ ! -f "$PLAY_TTS_SCRIPT" ]]; then
102
+ echo -e "${RED}✗${NC} TTS playback script missing"
103
+ echo -e "${GRAY} Expected: $PLAY_TTS_SCRIPT${NC}"
104
+ ((issues++))
105
+ fi
106
+
107
+ # Check if lite mode needs post-tool-use hook
108
+ local current_mode=$(get_current_mode)
109
+ if [[ "$current_mode" == "lite" ]] && [[ ! -f "$POST_TOOL_USE_HOOK" ]]; then
110
+ echo -e "${YELLOW}⚠${NC} Lite mode requires post-tool-use hook"
111
+ echo -e "${GRAY} Run: /agent-vibes:mode lite to reinstall${NC}"
112
+ ((issues++))
113
+ fi
114
+
115
+ return $issues
116
+ }
117
+
118
+ # Main help display
119
+ main() {
120
+ echo ""
121
+ echo "═══════════════════════════════════════════"
122
+ echo " AgentVibes Help & Status"
123
+ echo "═══════════════════════════════════════════"
124
+ echo ""
125
+
126
+ # Run diagnostics silently and capture status
127
+ local diagnostic_output
128
+ diagnostic_output=$(run_diagnostics 2>&1)
129
+ local diagnostic_status=$?
130
+
131
+ # Show status indicator
132
+ if is_muted; then
133
+ echo -e "🔇 ${YELLOW}TTS is currently MUTED${NC}"
134
+ echo ""
135
+ elif [[ $diagnostic_status -eq 0 ]]; then
136
+ echo -e "🟢 ${GREEN}TTS is working normally!${NC}"
137
+ echo ""
138
+ else
139
+ echo -e "⚠️ ${YELLOW}TTS may not be working properly${NC}"
140
+ echo ""
141
+ echo "Issues Found:"
142
+ echo "$diagnostic_output"
143
+ echo ""
144
+ fi
145
+
146
+ # Show current settings
147
+ local current_mode=$(get_current_mode)
148
+ local current_voice=$(get_current_voice)
149
+ local current_provider=$(get_current_provider)
150
+ local current_verbosity=$(get_current_verbosity)
151
+
152
+ echo "Current Settings:"
153
+ if [[ "$current_mode" == "lite" ]]; then
154
+ echo -e " ${BLUE}Mode:${NC} Lite Mode (minimal overhead)"
155
+ else
156
+ echo -e " ${BLUE}Mode:${NC} Full Mode (all features)"
157
+ fi
158
+ echo -e " ${BLUE}Voice:${NC} $current_voice"
159
+ echo -e " ${BLUE}Provider:${NC} $current_provider"
160
+ echo -e " ${BLUE}Verbosity:${NC} $current_verbosity"
161
+ echo ""
162
+
163
+ # Show available commands
164
+ echo "Available Commands:"
165
+ echo -e " ${GREEN}/agent-vibes:mode lite${NC} - Switch to minimal overhead mode"
166
+ echo -e " ${GREEN}/agent-vibes:mode full${NC} - Switch to full features mode"
167
+ echo -e " ${GREEN}/agent-vibes:mute${NC} - Temporarily silence TTS"
168
+ echo -e " ${GREEN}/agent-vibes:unmute${NC} - Re-enable TTS"
169
+ echo -e " ${GREEN}/agent-vibes:voices:list${NC} - See available voices"
170
+ echo ""
171
+
172
+ # Show suggested fixes if issues found
173
+ if [[ $diagnostic_status -ne 0 ]]; then
174
+ echo "Suggested Fixes:"
175
+ echo -e " ${YELLOW}1.${NC} Try reinstalling: ${GREEN}npx agentvibes install${NC}"
176
+ echo -e " ${YELLOW}2.${NC} Restore from backup: ${GREEN}/agent-vibes:mode restore${NC}"
177
+ echo -e " ${YELLOW}3.${NC} Report issue: ${BLUE}https://github.com/paulpreibisch/AgentVibes/issues${NC}"
178
+ echo ""
179
+ fi
180
+
181
+ # Show help resources
182
+ echo "Need Help?"
183
+ echo -e " ${BLUE}•${NC} Documentation: ${BLUE}https://agentvibes.org${NC}"
184
+ echo -e " ${BLUE}•${NC} GitHub Issues: ${BLUE}https://github.com/paulpreibisch/AgentVibes/issues${NC}"
185
+ echo -e " ${BLUE}•${NC} Lite Mode Guide: ${BLUE}.agentvibes/LITE-MODE.md${NC}"
186
+ echo ""
187
+ echo "═══════════════════════════════════════════"
188
+ echo ""
189
+ }
190
+
191
+ main "$@"
@@ -0,0 +1,111 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .agentvibes/hooks/post-tool-use-lite.sh
4
+ #
5
+ # AgentVibes LITE MODE Post-Tool-Use Hook
6
+ # Extracts "Audio Summary:" marker and speaks it via TTS
7
+ # - No acknowledgment TTS (only completion)
8
+ # - Smart verbosity (skip for very short responses)
9
+ # - No .wav file saving (direct TTS)
10
+ # - Silent operation (no stdout)
11
+ #
12
+
13
+ set -euo pipefail
14
+
15
+ # Fix locale warnings
16
+ export LC_ALL=C
17
+
18
+ # Get configuration directory
19
+ CONFIG_DIR="${HOME}/.config/agentvibes"
20
+ if [[ -d ".agentvibes/config" ]]; then
21
+ CONFIG_DIR=".agentvibes/config"
22
+ fi
23
+
24
+ # Read token thresholds
25
+ MIN_TOKENS=${AGENTVIBES_MIN_TOKENS:-50} # Skip TTS below this
26
+ SHORT_TOKENS=${AGENTVIBES_SHORT_TOKENS:-200} # Simplify to "Done" below this
27
+
28
+ # Function to count approximate tokens (words)
29
+ count_tokens() {
30
+ echo "$1" | wc -w
31
+ }
32
+
33
+ # Function to extract Audio Summary from Claude's last message
34
+ extract_audio_summary() {
35
+ local content="$1"
36
+
37
+ # Look for "**Audio Summary:**" marker (case-insensitive)
38
+ if echo "$content" | grep -qi "Audio Summary:"; then
39
+ # Extract text after the marker, removing markdown formatting
40
+ echo "$content" | sed -n 's/.*[Aa]udio [Ss]ummary:[[:space:]]*\*\{0,2\}[[:space:]]*\(.*\)/\1/p' | head -1 | sed 's/\*\{0,2\}[[:space:]]*$//'
41
+ fi
42
+ }
43
+
44
+ # Function to play TTS (direct, no file saving)
45
+ play_tts() {
46
+ local text="$1"
47
+
48
+ # Test mode: Save to file for verification
49
+ if [[ "${AGENTVIBES_TEST_AUDIO:-}" == "true" ]]; then
50
+ local test_file="${AGENTVIBES_TEST_AUDIO_FILE:-/tmp/agentvibes-lite-test.txt}"
51
+ echo "[$(date '+%Y-%m-%d %H:%M:%S')] $text" >> "$test_file"
52
+ echo "✓ TTS Test Mode: Saved to $test_file" >&2
53
+ fi
54
+
55
+ # Try different TTS engines (silent operation)
56
+ if command -v say >/dev/null 2>&1; then
57
+ # macOS
58
+ say "$text" >/dev/null 2>&1 &
59
+ elif command -v espeak >/dev/null 2>&1; then
60
+ # Linux - espeak
61
+ espeak "$text" >/dev/null 2>&1 &
62
+ elif command -v spd-say >/dev/null 2>&1; then
63
+ # Linux - speech-dispatcher
64
+ spd-say "$text" >/dev/null 2>&1 &
65
+ elif [[ -f ".claude/hooks/play-tts.sh" ]]; then
66
+ # Fallback to AgentVibes play-tts.sh (but silent)
67
+ bash .claude/hooks/play-tts.sh "$text" >/dev/null 2>&1 &
68
+ fi
69
+ }
70
+
71
+ # Main logic
72
+ main() {
73
+ # Get Claude's last message from environment or stdin
74
+ local claude_output="${CLAUDE_LAST_MESSAGE:-}"
75
+
76
+ if [[ -z "$claude_output" ]]; then
77
+ # Try reading from stdin if available
78
+ if [[ -p /dev/stdin ]]; then
79
+ claude_output=$(cat)
80
+ else
81
+ exit 0
82
+ fi
83
+ fi
84
+
85
+ # Count tokens in full response
86
+ local token_count=$(count_tokens "$claude_output")
87
+
88
+ # Skip TTS for very short responses (under MIN_TOKENS)
89
+ if [[ $token_count -lt $MIN_TOKENS ]]; then
90
+ exit 0
91
+ fi
92
+
93
+ # Extract Audio Summary
94
+ local summary=$(extract_audio_summary "$claude_output")
95
+
96
+ # If no Audio Summary marker found, exit silently
97
+ if [[ -z "$summary" ]]; then
98
+ exit 0
99
+ fi
100
+
101
+ # For short responses, simplify to "Done"
102
+ if [[ $token_count -lt $SHORT_TOKENS ]]; then
103
+ summary="Done"
104
+ fi
105
+
106
+ # Play TTS in background (completely silent)
107
+ play_tts "$summary"
108
+ }
109
+
110
+ # Run main function
111
+ main "$@"
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .agentvibes/hooks/save-audio-manager.sh
4
+ #
5
+ # AgentVibes Save Audio Manager
6
+ # Configures whether TTS audio files are saved to disk or use temp files
7
+ #
8
+
9
+ set -euo pipefail
10
+
11
+ # Fix locale warnings
12
+ export LC_ALL=C
13
+
14
+ # Directories
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ AGENTVIBES_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ CONFIG_DIR="$AGENTVIBES_DIR/config"
18
+ SAVE_AUDIO_FILE="$CONFIG_DIR/save-audio.txt"
19
+
20
+ # Colors for output
21
+ RED='\033[0;31m'
22
+ GREEN='\033[0;32m'
23
+ YELLOW='\033[1;33m'
24
+ BLUE='\033[0;34m'
25
+ NC='\033[0m' # No Color
26
+
27
+ # Functions
28
+ print_info() {
29
+ echo -e "${BLUE}ℹ${NC} $1"
30
+ }
31
+
32
+ print_success() {
33
+ echo -e "${GREEN}✓${NC} $1"
34
+ }
35
+
36
+ print_warning() {
37
+ echo -e "${YELLOW}⚠${NC} $1"
38
+ }
39
+
40
+ print_error() {
41
+ echo -e "${RED}✗${NC} $1"
42
+ }
43
+
44
+ # Ensure directories exist
45
+ ensure_dirs() {
46
+ mkdir -p "$CONFIG_DIR"
47
+ }
48
+
49
+ # Get current setting
50
+ get_save_audio_status() {
51
+ if [[ -f "$SAVE_AUDIO_FILE" ]]; then
52
+ cat "$SAVE_AUDIO_FILE"
53
+ else
54
+ echo "false"
55
+ fi
56
+ }
57
+
58
+ # Show current status
59
+ show_status() {
60
+ local current_status=$(get_save_audio_status)
61
+ echo ""
62
+ echo "═══════════════════════════════════════════"
63
+ echo " AgentVibes Audio Save Setting"
64
+ echo "═══════════════════════════════════════════"
65
+ echo ""
66
+
67
+ if [[ "$current_status" == "true" ]]; then
68
+ echo -e "${GREEN}●${NC} SAVE AUDIO: ON"
69
+ echo " - Audio files saved to .claude/audio/"
70
+ echo " - Files persist after playback"
71
+ echo " - Useful for: debugging, archiving, replay"
72
+ echo ""
73
+ echo "○ SAVE AUDIO: OFF (temporary files)"
74
+ else
75
+ echo "○ SAVE AUDIO: ON (persistent files)"
76
+ echo ""
77
+ echo -e "${GREEN}●${NC} SAVE AUDIO: OFF (Default)"
78
+ echo " - Audio uses temporary files"
79
+ echo " - Files cleaned up after playback"
80
+ echo " - Saves disk space"
81
+ fi
82
+
83
+ echo ""
84
+ echo "═══════════════════════════════════════════"
85
+ echo ""
86
+ echo "Change setting: /agent-vibes:save-audio [on|off]"
87
+ echo ""
88
+ }
89
+
90
+ # Enable save audio
91
+ enable_save_audio() {
92
+ ensure_dirs
93
+ echo "true" > "$SAVE_AUDIO_FILE"
94
+
95
+ echo ""
96
+ echo "═══════════════════════════════════════════"
97
+ print_success "Audio file saving ENABLED"
98
+ echo "═══════════════════════════════════════════"
99
+ echo ""
100
+ echo "Audio files will be saved to:"
101
+ echo " .claude/audio/tts-{timestamp}.wav"
102
+ echo ""
103
+ echo "Benefits:"
104
+ echo " ✓ Persistent audio files for replay"
105
+ echo " ✓ Useful for debugging TTS output"
106
+ echo " ✓ Build audio archives/logs"
107
+ echo ""
108
+ echo "Note: Files will accumulate - consider periodic cleanup"
109
+ echo ""
110
+ }
111
+
112
+ # Disable save audio
113
+ disable_save_audio() {
114
+ ensure_dirs
115
+ echo "false" > "$SAVE_AUDIO_FILE"
116
+
117
+ echo ""
118
+ echo "═══════════════════════════════════════════"
119
+ print_success "Audio file saving DISABLED"
120
+ echo "═══════════════════════════════════════════"
121
+ echo ""
122
+ echo "Audio files will use temporary storage:"
123
+ echo " - Lite Mode: /tmp/agentvibes-lite-*.wav"
124
+ echo " - Full Mode: \$XDG_RUNTIME_DIR/agentvibes-tts/*.wav"
125
+ echo ""
126
+ echo "Benefits:"
127
+ echo " ✓ Automatic cleanup after playback"
128
+ echo " ✓ Saves disk space"
129
+ echo " ✓ No manual file management needed"
130
+ echo ""
131
+ }
132
+
133
+ # Main
134
+ main() {
135
+ local command="${1:-}"
136
+
137
+ case "$command" in
138
+ on|enable|true)
139
+ enable_save_audio
140
+ ;;
141
+ off|disable|false)
142
+ disable_save_audio
143
+ ;;
144
+ status|"")
145
+ show_status
146
+ ;;
147
+ *)
148
+ print_error "Unknown command: $command"
149
+ echo ""
150
+ echo "Usage: $0 [on|off|status]"
151
+ echo ""
152
+ echo "Commands:"
153
+ echo " on - Enable audio file saving"
154
+ echo " off - Disable audio file saving (default)"
155
+ echo " status - Show current setting"
156
+ echo ""
157
+ exit 1
158
+ ;;
159
+ esac
160
+ }
161
+
162
+ main "$@"
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ #
4
+ # File: .agentvibes/hooks/session-start-full-optimized.sh
5
+ #
6
+ # AgentVibes Full Mode - Optimized (Issue #73)
7
+ # Token target: ~250 (down from ~500)
8
+ #
9
+
10
+ # Fix locale warnings
11
+ export LC_ALL=C
12
+
13
+ # Get script directory and project root
14
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
16
+
17
+ # Check if AgentVibes is installed (skip in test mode)
18
+ if [[ -z "${AGENTVIBES_TEST_MODE:-}" ]] && [[ ! -f "$PROJECT_ROOT/.claude/hooks/play-tts.sh" ]]; then
19
+ exit 0
20
+ fi
21
+
22
+ # Get current settings
23
+ VERBOSITY=$(cat .claude/tts-verbosity.txt 2>/dev/null || cat ~/.claude/tts-verbosity.txt 2>/dev/null || echo "medium")
24
+ SENTIMENT=$(cat .claude/tts-sentiment.txt 2>/dev/null || cat ~/.claude/tts-sentiment.txt 2>/dev/null || echo "")
25
+ PERSONALITY=$(cat .claude/tts-personality.txt 2>/dev/null || cat ~/.claude/tts-personality.txt 2>/dev/null || echo "professional")
26
+
27
+ # Determine style
28
+ if [[ -n "$SENTIMENT" ]]; then
29
+ STYLE="$SENTIMENT"
30
+ else
31
+ STYLE="$PERSONALITY"
32
+ fi
33
+
34
+ # Output optimized protocol
35
+ cat << 'EOF'
36
+ # AgentVibes Full Mode
37
+
38
+ ## Dual TTS (REQUIRED)
39
+ **Execute at TWO points:**
40
+ 1. **Acknowledgment** - Start of task: `Bash: .claude/hooks/play-tts.sh "[action]"`
41
+ 2. **Completion** - End of task: `Bash: .claude/hooks/play-tts.sh "[result + key details]"`
42
+
43
+ **Example:**
44
+ ```
45
+ [Bash: .claude/hooks/play-tts.sh "Creating auth module"]
46
+ [work...]
47
+ [Bash: .claude/hooks/play-tts.sh "Auth module created with JWT and bcrypt"]
48
+ ```
49
+
50
+ EOF
51
+
52
+ # Conditional verbosity (only active level)
53
+ case "$VERBOSITY" in
54
+ low)
55
+ cat << 'EOF'
56
+ ## Verbosity: LOW
57
+ - Acknowledgment: Action only
58
+ - Completion: Result + errors only
59
+ - Skip: Reasoning, decisions
60
+
61
+ EOF
62
+ ;;
63
+
64
+ high)
65
+ cat << 'EOF'
66
+ ## Verbosity: HIGH
67
+ - Acknowledgment: Action + approach + why
68
+ - Completion: Result + decisions + trade-offs
69
+ - Include: Full reasoning, alternatives
70
+
71
+ EOF
72
+ ;;
73
+
74
+ *) # medium
75
+ cat << 'EOF'
76
+ ## Verbosity: MEDIUM
77
+ - Acknowledgment: Action + key approach
78
+ - Completion: Result + important decisions
79
+ - Include: Major choices only
80
+
81
+ EOF
82
+ ;;
83
+ esac
84
+
85
+ # Style info
86
+ cat << EOF
87
+ ## Style: $STYLE
88
+
89
+ EOF
90
+
91
+ # Quick reference
92
+ cat << 'EOF'
93
+ ## Rules
94
+ 1. Never skip acknowledgment TTS
95
+ 2. Never skip completion TTS
96
+ 3. Match verbosity level
97
+ 4. Keep under 150 chars
98
+ 5. Always include errors
99
+
100
+ Quick Ref: low=endpoints | medium=+decisions | high=+reasoning
101
+
102
+ EOF
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .claude/hooks/session-start-tts.sh
4
+ #
5
+ # AgentVibes SessionStart Hook - Injects TTS Protocol Instructions
6
+ #
7
+ # This hook outputs TTS protocol instructions to stdout, which Claude Code
8
+ # adds to the conversation context at session start.
9
+ #
10
+
11
+ # Fix locale warnings
12
+ export LC_ALL=C
13
+
14
+ # Get script directory and project root
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
17
+
18
+ # Check if AgentVibes is installed
19
+ if [[ ! -f "$PROJECT_ROOT/.claude/hooks/play-tts.sh" ]]; then
20
+ # AgentVibes not installed, don't inject anything
21
+ exit 0
22
+ fi
23
+
24
+ # Check for sentiment (priority) or personality (fallback)
25
+ SENTIMENT=$(cat .claude/tts-sentiment.txt 2>/dev/null || cat ~/.claude/tts-sentiment.txt 2>/dev/null || echo "")
26
+ PERSONALITY=$(cat .claude/tts-personality.txt 2>/dev/null || cat ~/.claude/tts-personality.txt 2>/dev/null || echo "normal")
27
+
28
+ # Determine which to use
29
+ if [[ -n "$SENTIMENT" ]]; then
30
+ STYLE_MODE="sentiment"
31
+ STYLE_NAME="$SENTIMENT"
32
+ else
33
+ STYLE_MODE="personality"
34
+ STYLE_NAME="$PERSONALITY"
35
+ fi
36
+
37
+ # Get verbosity level (Issue #32)
38
+ VERBOSITY=$(cat .claude/tts-verbosity.txt 2>/dev/null || cat ~/.claude/tts-verbosity.txt 2>/dev/null || echo "low")
39
+
40
+ # Output TTS protocol instructions to stdout
41
+ # Claude Code will add this to the conversation context
42
+ cat <<'EOF'
43
+
44
+ # AgentVibes TTS Protocol
45
+
46
+ **CRITICAL: You MUST execute TTS at TWO points for EVERY user interaction:**
47
+
48
+ ## 1. ACKNOWLEDGMENT (Start of Every Task)
49
+ Immediately after receiving ANY user message:
50
+ 1. Generate a brief, unique acknowledgment message
51
+ 2. Execute: `Bash: .claude/hooks/play-tts.sh "[your message]"`
52
+ 3. Then proceed with the work
53
+
54
+ ## 2. COMPLETION (End of Every Task)
55
+ After finishing the task:
56
+ 1. Generate a brief, unique completion message
57
+ 2. Execute: `Bash: .claude/hooks/play-tts.sh "[your message]"`
58
+
59
+ ## Rules
60
+ - Use Bash tool to execute play-tts.sh
61
+ - Keep messages under 150 characters
62
+ - Generate unique messages each time
63
+ - Use relative path: .claude/hooks/play-tts.sh
64
+ - This is NOT optional - follow for EVERY interaction
65
+
66
+ ## Example
67
+ ```
68
+ User: "check git status"
69
+ [Bash: .claude/hooks/play-tts.sh "I'll check that for you."]
70
+ [... do work ...]
71
+ [Bash: .claude/hooks/play-tts.sh "Done! All clean."]
72
+ ```
73
+
74
+ EOF
75
+
76
+ # Add verbosity-specific protocol (Issue #32)
77
+ case "$VERBOSITY" in
78
+ low)
79
+ cat <<'EOF'
80
+ ## Verbosity: LOW (Minimal)
81
+ - Speak only at acknowledgment (start) and completion (end)
82
+ - Do NOT speak reasoning, decisions, or findings during work
83
+ - Keep it quiet and focused
84
+
85
+ EOF
86
+ ;;
87
+
88
+ medium)
89
+ cat <<'EOF'
90
+ ## Verbosity: MEDIUM (Balanced)
91
+ - Speak at acknowledgment and completion (always)
92
+ - Also speak major decisions and key findings during work
93
+ - Use emoji markers for automatic TTS:
94
+ 🤔 [decision text] - Major decisions (e.g., "🤔 I'll use grep to search all files")
95
+ ✓ [finding text] - Key findings (e.g., "✓ Found 12 instances at line 1323")
96
+
97
+ Example:
98
+ ```
99
+ User: "Find all TODO comments"
100
+ [TTS: Acknowledgment]
101
+ 🤔 I'll use grep to search for TODO comments
102
+ [Work happens...]
103
+ ✓ Found 12 TODO comments across 5 files
104
+ [TTS: Completion]
105
+ ```
106
+
107
+ EOF
108
+ ;;
109
+
110
+ high)
111
+ cat <<'EOF'
112
+ ## Verbosity: HIGH (Maximum Transparency)
113
+ - Speak acknowledgment and completion (always)
114
+ - Speak ALL reasoning, decisions, and findings as you work
115
+ - Use emoji markers for automatic TTS:
116
+ 💭 [reasoning text] - Thought process (e.g., "💭 Let me search for all instances")
117
+ 🤔 [decision text] - Decisions (e.g., "🤔 I'll use grep for this")
118
+ ✓ [finding text] - Findings (e.g., "✓ Found it at line 1323")
119
+
120
+ Example:
121
+ ```
122
+ User: "Find all TODO comments"
123
+ [TTS: Acknowledgment]
124
+ 💭 Let me search through the codebase for TODO comments
125
+ 🤔 I'll use the Grep tool with pattern "TODO"
126
+ [Grep runs...]
127
+ ✓ Found 12 TODO comments across 5 files
128
+ 💭 Let me organize these results by file
129
+ [Processing...]
130
+ [TTS: Completion]
131
+ ```
132
+
133
+ IMPORTANT: Use emoji markers naturally in your reasoning text. They trigger automatic TTS.
134
+
135
+ EOF
136
+ ;;
137
+ esac
138
+
139
+ # Add current style and verbosity info
140
+ echo "Current Style: ${STYLE_NAME} (${STYLE_MODE})"
141
+ echo "Current Verbosity: ${VERBOSITY}"
142
+ echo ""