@domdhi/claude-code-tts 1.4.0 → 2.0.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.
@@ -1,7 +1,28 @@
1
- Disable TTS voice output by removing the enable file. Run the appropriate command for your OS silently using the Bash tool, then respond with only: "TTS disabled."
1
+ Disable TTS voice output. Run the following Python command using the Bash tool (it stops any playing audio and removes the enable file), then respond with only: "TTS disabled."
2
2
 
3
- Mac/Linux:
4
- rm -f ~/.claude/hooks/tts/on
3
+ ```bash
4
+ python -c "
5
+ import socket, json, hashlib, os
5
6
 
6
- Windows:
7
- del /F "%USERPROFILE%\.claude\hooks\tts\on" 2>nul
7
+ for hook_dir in [
8
+ os.path.join(os.path.expanduser('~'), '.claude', 'hooks', 'tts'),
9
+ os.path.join(os.getcwd(), '.claude', 'hooks', 'tts'),
10
+ ]:
11
+ if not os.path.isdir(hook_dir):
12
+ continue
13
+ port = 49152 + (int(hashlib.md5(hook_dir.encode()).hexdigest(), 16) % 16384)
14
+ try:
15
+ s = socket.socket()
16
+ s.settimeout(1)
17
+ s.connect(('127.0.0.1', port))
18
+ s.sendall(json.dumps({'cmd': 'stop'}).encode() + b'\n')
19
+ s.close()
20
+ except Exception:
21
+ pass
22
+ on_file = os.path.join(hook_dir, 'on')
23
+ try:
24
+ os.remove(on_file)
25
+ except Exception:
26
+ pass
27
+ " 2>/dev/null || true
28
+ ```
package/INSTALL.md CHANGED
@@ -36,11 +36,11 @@ Requires Node.js 16+ and Python 3.10+. No cloning required.
36
36
  The installer automatically:
37
37
  1. Checks Python version (3.10+ required)
38
38
  2. Installs required packages (`edge-tts`, `miniaudio`, `sounddevice`, `cffi`)
39
- 3. Copies hook scripts to `~/.claude/hooks/tts/`
39
+ 3. Copies hook scripts to the install directory (`.claude/hooks/tts/` locally, `~/.claude/hooks/tts/` globally)
40
40
  4. Creates the `on` file (TTS enabled immediately)
41
41
  5. Optionally installs kokoro-onnx offline fallback (~82MB)
42
42
  6. Installs `/voice:*` slash commands
43
- 7. Patches `settings.json` / `settings.local.json` with hook entries (backs up original first)
43
+ 7. Patches `settings.local.json` / `settings.json` with hook entries (backs up original first)
44
44
 
45
45
  **Local vs global:**
46
46
  - Default (no flag): everything goes into `./.claude/` — hook scripts, commands, and `settings.local.json` (gitignored). Good for shipping TTS config alongside a project. Each install gets its own daemon port, so multiple local-installed projects run independently without conflict.
@@ -356,6 +356,11 @@ The daemon auto-restarts on the next Claude response.
356
356
  - kokoro-onnx has a 510-token (~1500 char) hard limit
357
357
  - The daemon chunks text at sentence boundaries automatically — if you're hitting this, check `debug.log` for `IndexError`
358
358
 
359
+ ### Windows: hook command not found / `C:Python313python.exe`
360
+ - Claude Code runs hooks via bash, which cannot resolve `C:\...\python.exe` as a command
361
+ - Hook commands must use `python` (on PATH), not the full Windows executable path
362
+ - The installer handles this automatically; for manual edits use `python "C:\...\script.py"` not `C:\Python313\python.exe "C:\...\script.py"`
363
+
359
364
  ### Windows: DETACHED_PROCESS causes silence
360
365
  - Do not add `DETACHED_PROCESS` to the subprocess flags — it breaks the Windows audio session
361
366
  - `CREATE_NO_WINDOW` only is correct (already set in the hook files)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domdhi/claude-code-tts",
3
- "version": "1.4.0",
3
+ "version": "2.0.1",
4
4
  "description": "Neural TTS hook system for Claude Code. Reads Claude's responses aloud as they finish.",
5
5
  "bin": {
6
6
  "claude-code-tts": "bin/install.js"