mcp-voice-hooks 1.0.28-beta.1 → 1.0.28
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.
- package/bin/cli.js +2 -60
- package/package.json +1 -1
package/bin/cli.js
CHANGED
@@ -54,9 +54,6 @@ 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';
|
60
57
|
|
61
58
|
console.log('⚙️ Configuring project Claude Code settings...');
|
62
59
|
|
@@ -106,62 +103,7 @@ async function configureClaudeCodeSettings() {
|
|
106
103
|
}
|
107
104
|
|
108
105
|
// Add hook configuration with inline commands
|
109
|
-
|
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
|
106
|
+
const hookConfig = {
|
165
107
|
"Stop": [
|
166
108
|
{
|
167
109
|
"matcher": "",
|
@@ -204,7 +146,7 @@ async function configureClaudeCodeSettings() {
|
|
204
146
|
],
|
205
147
|
"PostToolUse": [
|
206
148
|
{
|
207
|
-
"matcher": "^(?!mcp__voice-hooks__).*",
|
149
|
+
"matcher": "^(?!mcp__voice-hooks__|ExitPlanMode).*",
|
208
150
|
"hooks": [
|
209
151
|
{
|
210
152
|
"type": "command",
|