agentvibes 5.1.4 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.agentvibes/config.json +23 -13
  2. package/.claude/commands/agent-vibes/verbosity.md +98 -89
  3. package/.claude/config/audio-effects.cfg +4 -1
  4. package/.claude/hooks/audio-cache-utils.sh +246 -246
  5. package/.claude/hooks/background-music-manager.sh +404 -404
  6. package/.claude/hooks/bmad-speak-enhanced.sh +165 -165
  7. package/.claude/hooks/bmad-speak.sh +290 -290
  8. package/.claude/hooks/bmad-tts-injector.sh +568 -568
  9. package/.claude/hooks/bmad-voice-manager.sh +928 -928
  10. package/.claude/hooks/clawdbot-receiver-SECURE.sh +129 -129
  11. package/.claude/hooks/clawdbot-receiver.sh +107 -107
  12. package/.claude/hooks/clean-audio-cache.sh +22 -22
  13. package/.claude/hooks/cleanup-cache.sh +106 -106
  14. package/.claude/hooks/configure-rdp-mode.sh +137 -137
  15. package/.claude/hooks/download-extra-voices.sh +244 -244
  16. package/.claude/hooks/effects-manager.sh +268 -268
  17. package/.claude/hooks/github-star-reminder.sh +154 -154
  18. package/.claude/hooks/language-manager.sh +362 -362
  19. package/.claude/hooks/learn-manager.sh +492 -492
  20. package/.claude/hooks/macos-voice-manager.sh +205 -205
  21. package/.claude/hooks/migrate-background-music.sh +125 -125
  22. package/.claude/hooks/migrate-to-agentvibes.sh +161 -161
  23. package/.claude/hooks/optimize-background-music.sh +87 -87
  24. package/.claude/hooks/path-resolver.sh +60 -60
  25. package/.claude/hooks/personality-manager.sh +448 -448
  26. package/.claude/hooks/piper-download-voices.sh +233 -225
  27. package/.claude/hooks/piper-installer.sh +292 -292
  28. package/.claude/hooks/piper-multispeaker-registry.sh +171 -171
  29. package/.claude/hooks/piper-voice-manager.sh +125 -0
  30. package/.claude/hooks/play-tts-agentvibes-receiver-for-voiceless-connections.sh +97 -90
  31. package/.claude/hooks/play-tts-enhanced.sh +105 -105
  32. package/.claude/hooks/play-tts-piper.sh +16 -5
  33. package/.claude/hooks/play-tts-ssh-remote.sh +168 -167
  34. package/.claude/hooks/play-tts-termux-ssh.sh +169 -169
  35. package/.claude/hooks/play-tts.sh +35 -14
  36. package/.claude/hooks/prepare-release.sh +54 -54
  37. package/.claude/hooks/provider-commands.sh +617 -617
  38. package/.claude/hooks/provider-manager.sh +399 -399
  39. package/.claude/hooks/replay-target-audio.sh +95 -95
  40. package/.claude/hooks/sentiment-manager.sh +201 -201
  41. package/.claude/hooks/session-start-tts.sh +4 -1
  42. package/.claude/hooks/speed-manager.sh +291 -291
  43. package/.claude/hooks/stop-tts.sh +84 -84
  44. package/.claude/hooks/termux-installer.sh +261 -261
  45. package/.claude/hooks/translate-manager.sh +341 -341
  46. package/.claude/hooks/tts-queue-worker.sh +145 -145
  47. package/.claude/hooks/tts-queue.sh +165 -165
  48. package/.claude/hooks/verbosity-manager.sh +185 -178
  49. package/.claude/hooks/voice-manager.sh +552 -548
  50. package/.claude/hooks-windows/download-extra-voices.ps1 +243 -185
  51. package/.claude/hooks-windows/play-tts-piper.ps1 +7 -2
  52. package/.claude/hooks-windows/play-tts.ps1 +9 -3
  53. package/.claude/hooks-windows/session-start-tts.ps1 +2 -1
  54. package/.claude/hooks-windows/verbosity-manager.ps1 +126 -119
  55. package/README.md +19 -2
  56. package/RELEASE_NOTES.md +74 -0
  57. package/bin/agentvibes-voice-browser.js +1939 -1840
  58. package/bin/mcp-server.sh +206 -206
  59. package/mcp-server/server.py +87 -15
  60. package/package.json +1 -1
  61. package/src/console/tabs/receiver-tab.js +1527 -1483
  62. package/src/console/tabs/settings-tab.js +2 -2
  63. package/src/console/tabs/setup-tab.js +112 -31
  64. package/src/console/tabs/voices-tab.js +130 -13
  65. package/src/i18n/en.js +202 -202
  66. package/src/installer.js +79 -213
  67. package/src/services/llm-provider-service.js +126 -75
  68. package/src/services/verbosity-service.js +159 -157
  69. package/templates/agentvibes-receiver.sh +3 -2
@@ -1,167 +1,168 @@
1
- #!/usr/bin/env bash
2
- #
3
- # File: .claude/hooks/play-tts-ssh-remote.sh
4
- #
5
- # AgentVibes - SSH-Remote TTS Provider (v2 — JSON payload)
6
- # Sends text + effects config to remote device via SSH for local playback
7
- #
8
- # The sender reads local audio-effects.cfg and bundles everything into a
9
- # single base64-encoded JSON payload. The receiver is a thin executor.
10
- #
11
- # Copyright (c) 2025 Paul Preibisch
12
- # Licensed under the Apache License, Version 2.0
13
- #
14
-
15
- set -euo pipefail
16
-
17
- TEXT="${1:-}"
18
- VOICE="${2:-en_US-lessac-medium}"
19
- AGENT_NAME="${3:-default}"
20
-
21
- # Validate required input
22
- if [[ -z "$TEXT" ]]; then
23
- echo "Usage: $0 <text> [voice] [agent_name]" >&2
24
- exit 1
25
- fi
26
-
27
- # Get script directory and project root
28
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
29
- PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
30
-
31
- # Derive project name from directory
32
- PROJECT_NAME=$(basename "$PROJECT_ROOT")
33
-
34
- # ---------------------------------------------------------------------------
35
- # Get SSH host from config
36
- # ---------------------------------------------------------------------------
37
-
38
- SSH_HOST=$(cat "$PROJECT_ROOT/.claude/ssh-remote-host.txt" 2>/dev/null || \
39
- cat "$HOME/.claude/ssh-remote-host.txt" 2>/dev/null || echo "")
40
-
41
- if [[ -z "$SSH_HOST" ]]; then
42
- echo "SSH-Remote host not configured" >&2
43
- echo "Set host: echo 'my-host' > .claude/ssh-remote-host.txt" >&2
44
- exit 1
45
- fi
46
-
47
- # SECURITY: Validate SSH_HOST format
48
- if [[ ! "$SSH_HOST" =~ ^[a-zA-Z0-9][a-zA-Z0-9._-]*$ ]]; then
49
- echo "Invalid SSH host format: $SSH_HOST" >&2
50
- exit 1
51
- fi
52
-
53
- # SECURITY: Validate VOICE
54
- if [[ ! "$VOICE" =~ ^[a-zA-Z0-9_-]+$ ]]; then
55
- echo "Invalid voice format: $VOICE" >&2
56
- exit 1
57
- fi
58
-
59
- # SECURITY: Validate AGENT_NAME
60
- if [[ ! "$AGENT_NAME" =~ ^[a-zA-Z0-9_\ -]+$ ]]; then
61
- echo "Invalid agent name format: $AGENT_NAME" >&2
62
- exit 1
63
- fi
64
-
65
- # ---------------------------------------------------------------------------
66
- # Read audio effects config for this agent
67
- # ---------------------------------------------------------------------------
68
-
69
- SOX_EFFECTS=""
70
- BG_FILE=""
71
- BG_VOLUME="0.10"
72
-
73
- EFFECTS_CFG="$PROJECT_ROOT/.claude/config/audio-effects.cfg"
74
- if [[ -f "$EFFECTS_CFG" ]]; then
75
- CONFIG_LINE=$(grep "^${AGENT_NAME}|" "$EFFECTS_CFG" 2>/dev/null || \
76
- grep "^default|" "$EFFECTS_CFG" 2>/dev/null || true)
77
- if [[ -n "$CONFIG_LINE" ]]; then
78
- IFS='|' read -r _ SOX_EFFECTS BG_FILE BG_VOLUME <<< "$CONFIG_LINE"
79
- fi
80
- fi
81
-
82
- # Read pretext if configured
83
- PRETEXT=""
84
- PRETEXT_FILE="$PROJECT_ROOT/.agentvibes/config/pretext.txt"
85
- if [[ -f "$PRETEXT_FILE" ]]; then
86
- PRETEXT=$(cat "$PRETEXT_FILE" 2>/dev/null || true)
87
- fi
88
-
89
- # Read speed if configured
90
- SPEED=""
91
- SPEED_FILE="$PROJECT_ROOT/.agentvibes/config/speed.txt"
92
- if [[ -f "$SPEED_FILE" ]]; then
93
- SPEED=$(cat "$SPEED_FILE" 2>/dev/null || true)
94
- fi
95
-
96
- # Read the TTS provider the RECEIVER should use to generate audio.
97
- # This is separate from the sender's own provider (which is "ssh-remote").
98
- # Check receiver-provider.txt first, then fall back to "piper".
99
- PROVIDER=""
100
- RECEIVER_PROVIDER_FILE="$PROJECT_ROOT/.agentvibes/config/receiver-provider.txt"
101
- if [[ -f "$RECEIVER_PROVIDER_FILE" ]]; then
102
- PROVIDER=$(cat "$RECEIVER_PROVIDER_FILE" 2>/dev/null || true)
103
- fi
104
- # Also check home-level config
105
- if [[ -z "$PROVIDER" ]]; then
106
- RECEIVER_PROVIDER_FILE="$HOME/.agentvibes/config/receiver-provider.txt"
107
- if [[ -f "$RECEIVER_PROVIDER_FILE" ]]; then
108
- PROVIDER=$(cat "$RECEIVER_PROVIDER_FILE" 2>/dev/null || true)
109
- fi
110
- fi
111
- # Validate — only known TTS providers (not transport providers like ssh-remote)
112
- case "${PROVIDER:-}" in
113
- piper|soprano|macos|windows-sapi) ;;
114
- *) PROVIDER="piper" ;;
115
- esac
116
-
117
- # ---------------------------------------------------------------------------
118
- # Build JSON payload
119
- # ---------------------------------------------------------------------------
120
-
121
- # SECURITY: Use jq if available for safe JSON construction, else manual escaping
122
- build_json_payload() {
123
- if command -v jq &>/dev/null; then
124
- jq -n \
125
- --arg text "$TEXT" \
126
- --arg voice "$VOICE" \
127
- --arg effects "$SOX_EFFECTS" \
128
- --arg music "$BG_FILE" \
129
- --arg volume "$BG_VOLUME" \
130
- --arg project "$PROJECT_NAME" \
131
- --arg pretext "$PRETEXT" \
132
- --arg speed "$SPEED" \
133
- --arg provider "$PROVIDER" \
134
- '{text: $text, voice: $voice, effects: $effects, music: $music, volume: $volume, project: $project, pretext: $pretext, speed: $speed, provider: $provider}'
135
- else
136
- # Manual JSON — escape double quotes and backslashes in text
137
- local escaped_text
138
- escaped_text=$(printf '%s' "$TEXT" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g')
139
- local escaped_pretext
140
- escaped_pretext=$(printf '%s' "$PRETEXT" | sed 's/\\/\\\\/g; s/"/\\"/g')
141
- printf '{"text":"%s","voice":"%s","effects":"%s","music":"%s","volume":"%s","project":"%s","pretext":"%s","speed":"%s","provider":"%s"}' \
142
- "$escaped_text" "$VOICE" "$SOX_EFFECTS" "$BG_FILE" "$BG_VOLUME" "$PROJECT_NAME" "$escaped_pretext" "$SPEED" "$PROVIDER"
143
- fi
144
- }
145
-
146
- JSON_PAYLOAD=$(build_json_payload)
147
-
148
- # SECURITY: Base64-encode entire payload — safe for SSH transport
149
- # base64 -w 0 is Linux (GNU coreutils), -b 0 is macOS (BSD)
150
- if base64 --help 2>&1 | grep -q '\-w'; then
151
- ENCODED_PAYLOAD=$(printf '%s' "$JSON_PAYLOAD" | base64 -w 0)
152
- else
153
- ENCODED_PAYLOAD=$(printf '%s' "$JSON_PAYLOAD" | base64 -b 0 2>/dev/null || printf '%s' "$JSON_PAYLOAD" | base64 | tr -d '\n')
154
- fi
155
-
156
- # ---------------------------------------------------------------------------
157
- # Send to receiver via SSH (fire and forget — backgrounded)
158
- # ---------------------------------------------------------------------------
159
-
160
- echo "Sending to $SSH_HOST..." >&2
161
-
162
- # ForceCommand receiver: SSH_ORIGINAL_COMMAND passes the payload directly
163
- ssh "$SSH_HOST" "$ENCODED_PAYLOAD" &
164
- SSH_PID=$!
165
-
166
- echo "Sent to $SSH_HOST (PID: $SSH_PID)" >&2
167
- exit 0
1
+ #!/usr/bin/env bash
2
+ #
3
+ # File: .claude/hooks/play-tts-ssh-remote.sh
4
+ #
5
+ # AgentVibes - SSH-Remote TTS Provider (v2 — JSON payload)
6
+ # Sends text + effects config to remote device via SSH for local playback
7
+ #
8
+ # The sender reads local audio-effects.cfg and bundles everything into a
9
+ # single base64-encoded JSON payload. The receiver is a thin executor.
10
+ #
11
+ # Copyright (c) 2025 Paul Preibisch
12
+ # Licensed under the Apache License, Version 2.0
13
+ #
14
+
15
+ set -euo pipefail
16
+
17
+ TEXT="${1:-}"
18
+ VOICE="${2:-en_US-lessac-medium}"
19
+ AGENT_NAME="${3:-default}"
20
+
21
+ # Validate required input
22
+ if [[ -z "$TEXT" ]]; then
23
+ echo "Usage: $0 <text> [voice] [agent_name]" >&2
24
+ exit 1
25
+ fi
26
+
27
+ # Get script directory and project root
28
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
29
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
30
+
31
+ # Derive project name from directory
32
+ PROJECT_NAME=$(basename "$PROJECT_ROOT")
33
+
34
+ # ---------------------------------------------------------------------------
35
+ # Get SSH host from config
36
+ # ---------------------------------------------------------------------------
37
+
38
+ SSH_HOST=$(cat "$PROJECT_ROOT/.claude/ssh-remote-host.txt" 2>/dev/null || \
39
+ cat "$HOME/.claude/ssh-remote-host.txt" 2>/dev/null || echo "")
40
+
41
+ if [[ -z "$SSH_HOST" ]]; then
42
+ echo "SSH-Remote host not configured" >&2
43
+ echo "Set host: echo 'my-host' > .claude/ssh-remote-host.txt" >&2
44
+ exit 1
45
+ fi
46
+
47
+ # SECURITY: Validate SSH_HOST format
48
+ if [[ ! "$SSH_HOST" =~ ^[a-zA-Z0-9][a-zA-Z0-9._-]*$ ]]; then
49
+ echo "Invalid SSH host format: $SSH_HOST" >&2
50
+ exit 1
51
+ fi
52
+
53
+ # SECURITY: Validate VOICE (allow :: for multi-speaker, . for locale, space for names)
54
+ _voice_re='^[a-zA-Z0-9_.: -]+$'
55
+ if [[ ! "$VOICE" =~ $_voice_re ]]; then
56
+ echo "Invalid voice format: $VOICE" >&2
57
+ exit 1
58
+ fi
59
+
60
+ # SECURITY: Validate AGENT_NAME
61
+ if [[ ! "$AGENT_NAME" =~ ^[a-zA-Z0-9_\ -]+$ ]]; then
62
+ echo "Invalid agent name format: $AGENT_NAME" >&2
63
+ exit 1
64
+ fi
65
+
66
+ # ---------------------------------------------------------------------------
67
+ # Read audio effects config for this agent
68
+ # ---------------------------------------------------------------------------
69
+
70
+ SOX_EFFECTS=""
71
+ BG_FILE=""
72
+ BG_VOLUME="0.10"
73
+
74
+ EFFECTS_CFG="$PROJECT_ROOT/.claude/config/audio-effects.cfg"
75
+ if [[ -f "$EFFECTS_CFG" ]]; then
76
+ CONFIG_LINE=$(grep "^${AGENT_NAME}|" "$EFFECTS_CFG" 2>/dev/null || \
77
+ grep "^default|" "$EFFECTS_CFG" 2>/dev/null || true)
78
+ if [[ -n "$CONFIG_LINE" ]]; then
79
+ IFS='|' read -r _ SOX_EFFECTS BG_FILE BG_VOLUME <<< "$CONFIG_LINE"
80
+ fi
81
+ fi
82
+
83
+ # Read pretext if configured
84
+ PRETEXT=""
85
+ PRETEXT_FILE="$PROJECT_ROOT/.agentvibes/config/pretext.txt"
86
+ if [[ -f "$PRETEXT_FILE" ]]; then
87
+ PRETEXT=$(cat "$PRETEXT_FILE" 2>/dev/null || true)
88
+ fi
89
+
90
+ # Read speed if configured
91
+ SPEED=""
92
+ SPEED_FILE="$PROJECT_ROOT/.agentvibes/config/speed.txt"
93
+ if [[ -f "$SPEED_FILE" ]]; then
94
+ SPEED=$(cat "$SPEED_FILE" 2>/dev/null || true)
95
+ fi
96
+
97
+ # Read the TTS provider the RECEIVER should use to generate audio.
98
+ # This is separate from the sender's own provider (which is "ssh-remote").
99
+ # Check receiver-provider.txt first, then fall back to "piper".
100
+ PROVIDER=""
101
+ RECEIVER_PROVIDER_FILE="$PROJECT_ROOT/.agentvibes/config/receiver-provider.txt"
102
+ if [[ -f "$RECEIVER_PROVIDER_FILE" ]]; then
103
+ PROVIDER=$(cat "$RECEIVER_PROVIDER_FILE" 2>/dev/null || true)
104
+ fi
105
+ # Also check home-level config
106
+ if [[ -z "$PROVIDER" ]]; then
107
+ RECEIVER_PROVIDER_FILE="$HOME/.agentvibes/config/receiver-provider.txt"
108
+ if [[ -f "$RECEIVER_PROVIDER_FILE" ]]; then
109
+ PROVIDER=$(cat "$RECEIVER_PROVIDER_FILE" 2>/dev/null || true)
110
+ fi
111
+ fi
112
+ # Validate — only known TTS providers (not transport providers like ssh-remote)
113
+ case "${PROVIDER:-}" in
114
+ piper|soprano|macos|windows-sapi) ;;
115
+ *) PROVIDER="piper" ;;
116
+ esac
117
+
118
+ # ---------------------------------------------------------------------------
119
+ # Build JSON payload
120
+ # ---------------------------------------------------------------------------
121
+
122
+ # SECURITY: Use jq if available for safe JSON construction, else manual escaping
123
+ build_json_payload() {
124
+ if command -v jq &>/dev/null; then
125
+ jq -n \
126
+ --arg text "$TEXT" \
127
+ --arg voice "$VOICE" \
128
+ --arg effects "$SOX_EFFECTS" \
129
+ --arg music "$BG_FILE" \
130
+ --arg volume "$BG_VOLUME" \
131
+ --arg project "$PROJECT_NAME" \
132
+ --arg pretext "$PRETEXT" \
133
+ --arg speed "$SPEED" \
134
+ --arg provider "$PROVIDER" \
135
+ '{text: $text, voice: $voice, effects: $effects, music: $music, volume: $volume, project: $project, pretext: $pretext, speed: $speed, provider: $provider}'
136
+ else
137
+ # Manual JSON — escape double quotes and backslashes in text
138
+ local escaped_text
139
+ escaped_text=$(printf '%s' "$TEXT" | sed 's/\\/\\\\/g; s/"/\\"/g; s/\t/\\t/g')
140
+ local escaped_pretext
141
+ escaped_pretext=$(printf '%s' "$PRETEXT" | sed 's/\\/\\\\/g; s/"/\\"/g')
142
+ printf '{"text":"%s","voice":"%s","effects":"%s","music":"%s","volume":"%s","project":"%s","pretext":"%s","speed":"%s","provider":"%s"}' \
143
+ "$escaped_text" "$VOICE" "$SOX_EFFECTS" "$BG_FILE" "$BG_VOLUME" "$PROJECT_NAME" "$escaped_pretext" "$SPEED" "$PROVIDER"
144
+ fi
145
+ }
146
+
147
+ JSON_PAYLOAD=$(build_json_payload)
148
+
149
+ # SECURITY: Base64-encode entire payload safe for SSH transport
150
+ # base64 -w 0 is Linux (GNU coreutils), -b 0 is macOS (BSD)
151
+ if base64 --help 2>&1 | grep -q '\-w'; then
152
+ ENCODED_PAYLOAD=$(printf '%s' "$JSON_PAYLOAD" | base64 -w 0)
153
+ else
154
+ ENCODED_PAYLOAD=$(printf '%s' "$JSON_PAYLOAD" | base64 -b 0 2>/dev/null || printf '%s' "$JSON_PAYLOAD" | base64 | tr -d '\n')
155
+ fi
156
+
157
+ # ---------------------------------------------------------------------------
158
+ # Send to receiver via SSH (fire and forget — backgrounded)
159
+ # ---------------------------------------------------------------------------
160
+
161
+ echo "Sending to $SSH_HOST..." >&2
162
+
163
+ # ForceCommand receiver: SSH_ORIGINAL_COMMAND passes the payload directly
164
+ ssh "$SSH_HOST" "$ENCODED_PAYLOAD" &
165
+ SSH_PID=$!
166
+
167
+ echo "Sent to $SSH_HOST (PID: $SSH_PID)" >&2
168
+ exit 0