agentvibes 2.13.6 → 2.13.7

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 (3) hide show
  1. package/CLAUDE.md +156 -0
  2. package/package.json +1 -1
  3. package/src/installer.js +14 -12
package/CLAUDE.md ADDED
@@ -0,0 +1,156 @@
1
+ # AgentVibes Development Guidelines
2
+
3
+ ## Overview
4
+ AgentVibes is a Text-to-Speech system for AI assistants with personality support.
5
+ This document defines coding standards and quality requirements for all contributions.
6
+
7
+ ## CRITICAL: PR and Commit Workflow
8
+
9
+ **NEVER push to a PR or commit changes without explicit user approval.**
10
+
11
+ When working on PRs or making changes to external repositories:
12
+ 1. **Always describe the changes first** - Explain what you plan to modify
13
+ 2. **Wait for user to test locally** - Do not push until user confirms testing is complete
14
+ 3. **Ask before pushing** - Get explicit "yes, push it" or similar confirmation
15
+ 4. **If user says "let me know before adding to PR"** - This means STOP and WAIT for approval
16
+
17
+ This rule applies to:
18
+ - All commits to any repository
19
+ - All pushes to remote branches
20
+ - All PR updates
21
+ - Any changes to BMAD-METHOD or other external projects
22
+
23
+ ## Sonar Quality Gates (REQUIRED)
24
+
25
+ All code MUST pass SonarCloud quality gates before merging. The following checks are mandatory:
26
+
27
+ ### Security Hotspots
28
+ 1. **No hardcoded credentials** - API keys, passwords, tokens must NEVER be in code
29
+ 2. **Validate all external input** - User input, environment variables, file content
30
+ 3. **Use secure temp directories** - Prefer `$XDG_RUNTIME_DIR` with fallback to user-specific `/tmp`
31
+ 4. **Verify file ownership** - Before processing files from directories that could be influenced externally
32
+ 5. **Prevent path traversal** - Always validate paths are within expected directories
33
+
34
+ ### Shell Script Security (Bash)
35
+ ```bash
36
+ # REQUIRED: Always use strict mode
37
+ set -euo pipefail
38
+
39
+ # REQUIRED: Use secure temp directories
40
+ if [[ -n "${XDG_RUNTIME_DIR:-}" ]] && [[ -d "$XDG_RUNTIME_DIR" ]]; then
41
+ TEMP_DIR="$XDG_RUNTIME_DIR/agentvibes-FEATURE"
42
+ else
43
+ TEMP_DIR="/tmp/agentvibes-FEATURE-$USER"
44
+ fi
45
+
46
+ # REQUIRED: Set restrictive permissions on directories
47
+ mkdir -p "$TEMP_DIR"
48
+ chmod 700 "$TEMP_DIR"
49
+
50
+ # REQUIRED: Verify ownership before processing external files
51
+ if [[ "$(stat -c '%u' "$DIR" 2>/dev/null || stat -f '%u' "$DIR" 2>/dev/null)" != "$(id -u)" ]]; then
52
+ echo "Error: Directory not owned by current user" >&2
53
+ exit 1
54
+ fi
55
+
56
+ # REQUIRED: Use single quotes in trap to defer variable expansion
57
+ trap 'rm -f "$PID_FILE"' EXIT
58
+
59
+ # REQUIRED: Validate numeric input
60
+ if [[ "$VALUE" =~ ^[0-9]+$ ]]; then
61
+ # Safe to use
62
+ fi
63
+
64
+ # REQUIRED: Quote all variables
65
+ echo "$VARIABLE" # Good
66
+ echo $VARIABLE # Bad - word splitting/globbing risk
67
+ ```
68
+
69
+ ### JavaScript/Node.js Security
70
+ ```javascript
71
+ // REQUIRED: Use path.resolve() for path operations
72
+ const safePath = path.resolve(userInput);
73
+
74
+ // REQUIRED: Validate paths are within expected directory
75
+ function isPathSafe(targetPath, basePath) {
76
+ const resolved = path.resolve(targetPath);
77
+ const baseResolved = path.resolve(basePath);
78
+ // Check for exact match OR starts with base + separator
79
+ return resolved === baseResolved || resolved.startsWith(baseResolved + path.sep);
80
+ }
81
+
82
+ // REQUIRED: Never log sensitive data
83
+ console.log('API Key: ***************...'); // Good - masked
84
+ console.log(`API Key: ${apiKey}`); // Bad - exposes credential
85
+
86
+ // REQUIRED: Use try-finally for resource cleanup
87
+ let process;
88
+ try {
89
+ process = spawn(...);
90
+ // ... use process
91
+ } finally {
92
+ if (process && !process.killed) {
93
+ process.kill();
94
+ }
95
+ }
96
+ ```
97
+
98
+ ### Python Security
99
+ ```python
100
+ # REQUIRED: Use try-finally for resource cleanup
101
+ process = None
102
+ try:
103
+ process = subprocess.Popen(...)
104
+ # ... use process
105
+ finally:
106
+ if process and process.poll() is None:
107
+ process.kill()
108
+
109
+ # REQUIRED: Handle file operation errors gracefully
110
+ try:
111
+ content = file_path.read_text()
112
+ except (PermissionError, UnicodeDecodeError, OSError) as e:
113
+ print(f"Warning: Could not read file: {e}", file=sys.stderr)
114
+ return default_value
115
+ ```
116
+
117
+ ## Code Quality Standards
118
+
119
+ ### Reliability
120
+ 1. **Always handle errors** - No silent failures
121
+ 2. **Use defensive programming** - Check preconditions
122
+ 3. **Clean up resources** - Files, processes, connections
123
+ 4. **Avoid race conditions** - Use file locking where needed
124
+
125
+ ### Maintainability
126
+ 1. **Add comments for security-critical code** - Explain why, not what
127
+ 2. **Keep functions focused** - Single responsibility
128
+ 3. **Use meaningful variable names** - Self-documenting code
129
+
130
+ ## Testing Requirements
131
+
132
+ ### Before Committing
133
+ 1. Run existing test suite: `npm test`
134
+ 2. Add tests for new security-critical code
135
+ 3. Manual testing of affected features
136
+
137
+ ### Test Coverage
138
+ - All input validation must have tests
139
+ - All path handling must have tests
140
+ - Edge cases must be covered
141
+
142
+ ## Pre-Release Checklist
143
+
144
+ - [ ] All tests pass (`npm test`)
145
+ - [ ] No new Sonar security hotspots
146
+ - [ ] Credentials are masked in logs
147
+ - [ ] File operations validate paths
148
+ - [ ] Shell scripts use strict mode
149
+ - [ ] Resources are properly cleaned up
150
+ - [ ] Error handling is comprehensive
151
+
152
+ ## References
153
+
154
+ - [SonarCloud Security Rules](https://rules.sonarsource.com/javascript/type/Security_Hotspot)
155
+ - [OWASP Top 10](https://owasp.org/www-project-top-ten/)
156
+ - [Bash Security Best Practices](https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "agentvibes",
4
- "version": "2.13.6",
4
+ "version": "2.13.7",
5
5
  "description": "Now your AI Agents can finally talk back! Professional TTS voice for Claude Code and Claude Desktop (via MCP) with multi-provider support.",
6
6
  "homepage": "https://agentvibes.org",
7
7
  "keywords": [
package/src/installer.js CHANGED
@@ -957,18 +957,20 @@ async function createDefaultBmadVoiceAssignments(bmadPath) {
957
957
  // File doesn't exist, create it
958
958
  }
959
959
 
960
- // Default voice assignments for common BMAD agents
961
- const defaultVoices = `agent,voice
962
- bmad-master,en_US-ryan-high
963
- analyst,en_US-kristin-medium
964
- architect,en_GB-alan-medium
965
- dev,en_US-joe-medium
966
- pm,en_US-lessac-medium
967
- sm,en_US-amy-medium
968
- tea,en_US-kusal-medium
969
- tech-writer,jenny
970
- ux-designer,kristin
971
- frame-expert,en_GB-alan-medium
960
+ // Default voice assignments and intros for common BMAD agents
961
+ // Note: BMAD installer also generates this file - these are fallback defaults
962
+ // if AgentVibes is installed without BMAD or before BMAD
963
+ const defaultVoices = `agent,voice,intro
964
+ bmad-master,en_US-lessac-medium,"Greetings! The BMad Master is here to orchestrate and guide you through any workflow."
965
+ analyst,en_US-kristin-medium,"Hi there! I'm Mary, your Business Analyst. I'll help uncover the real requirements."
966
+ architect,en_GB-alan-medium,"Hello! Winston here, your Architect. I'll ensure we build something scalable and pragmatic."
967
+ dev,en_US-joe-medium,"Hey! Amelia here, your Developer. Ready to turn specs into working code."
968
+ pm,en_US-ryan-high,"Hey team! John here, your Product Manager. Let's make sure we're building the right thing."
969
+ sm,en_US-amy-medium,"Hi everyone! Bob here, your Scrum Master. I'll keep us focused and moving forward."
970
+ tea,en_US-kusal-medium,"Hello! Murat here, your Test Architect. Quality is my obsession."
971
+ tech-writer,jenny,"Hi! I'm Paige, your Technical Writer. I'll make sure everything is documented clearly."
972
+ ux-designer,kristin,"Hey! Sally here, your UX Designer. The user experience is my top priority."
973
+ frame-expert,en_GB-alan-medium,"Hello! Saif here, your Visual Design Expert. I'll help visualize your ideas."
972
974
  `;
973
975
 
974
976
  try {