mcp-voice-hooks 1.0.27 → 1.0.28-beta.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 (2) hide show
  1. package/bin/cli.js +59 -1
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -54,6 +54,9 @@ async function configureClaudeCodeSettings() {
54
54
  const settingsPath = path.join(claudeDir, 'settings.local.json');
55
55
  // This was used in versions <= v1.0.21.
56
56
  const oldSettingsPath = path.join(claudeDir, 'settings.json');
57
+
58
+ // Detect if running on Windows
59
+ const isWindows = process.platform === 'win32';
57
60
 
58
61
  console.log('⚙️ Configuring project Claude Code settings...');
59
62
 
@@ -103,7 +106,62 @@ async function configureClaudeCodeSettings() {
103
106
  }
104
107
 
105
108
  // Add hook configuration with inline commands
106
- const hookConfig = {
109
+ // Windows requires different command syntax
110
+ const hookConfig = isWindows ? {
111
+ // Windows-compatible commands using PowerShell environment variable syntax
112
+ "Stop": [
113
+ {
114
+ "matcher": "",
115
+ "hooks": [
116
+ {
117
+ "type": "command",
118
+ "command": "powershell -Command \"$port = if ($env:MCP_VOICE_HOOKS_PORT) { $env:MCP_VOICE_HOOKS_PORT } else { '5111' }; try { Invoke-RestMethod -Uri \\\"http://localhost:$port/api/hooks/stop\\\" -Method POST } catch { Write-Output '{\\\"decision\\\": \\\"approve\\\", \\\"reason\\\": \\\"voice-hooks unavailable\\\"}' }\""
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ "PreToolUse": [
124
+ {
125
+ "matcher": "^(?!mcp__voice-hooks__).*",
126
+ "hooks": [
127
+ {
128
+ "type": "command",
129
+ "command": "powershell -Command \"$port = if ($env:MCP_VOICE_HOOKS_PORT) { $env:MCP_VOICE_HOOKS_PORT } else { '5111' }; try { Invoke-RestMethod -Uri \\\"http://localhost:$port/api/hooks/pre-tool\\\" -Method POST } catch { Write-Output '{\\\"decision\\\": \\\"approve\\\", \\\"reason\\\": \\\"voice-hooks unavailable\\\"}' }\""
130
+ }
131
+ ]
132
+ },
133
+ {
134
+ "matcher": "^mcp__voice-hooks__speak$",
135
+ "hooks": [
136
+ {
137
+ "type": "command",
138
+ "command": "powershell -Command \"$port = if ($env:MCP_VOICE_HOOKS_PORT) { $env:MCP_VOICE_HOOKS_PORT } else { '5111' }; try { Invoke-RestMethod -Uri \\\"http://localhost:$port/api/hooks/pre-speak\\\" -Method POST } catch { Write-Output '{\\\"decision\\\": \\\"approve\\\", \\\"reason\\\": \\\"voice-hooks unavailable\\\"}' }\""
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "matcher": "^mcp__voice-hooks__wait_for_utterance$",
144
+ "hooks": [
145
+ {
146
+ "type": "command",
147
+ "command": "powershell -Command \"$port = if ($env:MCP_VOICE_HOOKS_PORT) { $env:MCP_VOICE_HOOKS_PORT } else { '5111' }; try { Invoke-RestMethod -Uri \\\"http://localhost:$port/api/hooks/pre-wait\\\" -Method POST } catch { Write-Output '{\\\"decision\\\": \\\"approve\\\", \\\"reason\\\": \\\"voice-hooks unavailable\\\"}' }\""
148
+ }
149
+ ]
150
+ }
151
+ ],
152
+ "PostToolUse": [
153
+ {
154
+ "matcher": "^(?!mcp__voice-hooks__).*",
155
+ "hooks": [
156
+ {
157
+ "type": "command",
158
+ "command": "powershell -Command \"$port = if ($env:MCP_VOICE_HOOKS_PORT) { $env:MCP_VOICE_HOOKS_PORT } else { '5111' }; try { Invoke-RestMethod -Uri \\\"http://localhost:$port/api/hooks/post-tool\\\" -Method POST } catch { Write-Output '{}' }\""
159
+ }
160
+ ]
161
+ }
162
+ ]
163
+ } : {
164
+ // Unix/Mac commands using curl with shell environment variable syntax
107
165
  "Stop": [
108
166
  {
109
167
  "matcher": "",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-voice-hooks",
3
- "version": "1.0.27",
3
+ "version": "1.0.28-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "type": "module",
6
6
  "bin": {