refactor: unify hook notification system, remove duplicate broadcasts
- Replace forward-hook.ps1 with notify.ps1 (now accepts optional agent param) - Remove ejecutor settings.local.json (redundant status hooks, deriveStatus covers it) - Remove legacy claude-permission system (route, store methods, terminal broadcast) - Remove redundant deriveStatus + /claude-status POST from claude-hook.ts (broadcastClaudeHook → processHookEvent already handles status derivation) - Clean up HookNotifications.vue permission buttons (dead code)
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -38,7 +38,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -50,7 +50,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -62,7 +62,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -73,7 +73,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -84,7 +84,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -96,7 +96,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -108,7 +108,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
@@ -129,7 +129,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -File hooks/forward-hook.ps1 ejecutor",
|
||||
"command": "powershell -NoProfile -File hooks/notify.ps1 ejecutor",
|
||||
"timeout": 10000
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
{
|
||||
"hooks": {
|
||||
"UserPromptSubmit": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"thinking\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": ".*",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"toolUse\\\",\\\"tool\\\":\\\"$CLAUDE_TOOL_NAME\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": ".*",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"thinking\\\",\\\"tool\\\":\\\"$CLAUDE_TOOL_NAME\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"PostToolUseFailure": [
|
||||
{
|
||||
"matcher": ".*",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"error\\\",\\\"tool\\\":\\\"$CLAUDE_TOOL_NAME\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"SessionEnd": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"sessionEnd\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "powershell -NoProfile -Command \"try { Invoke-RestMethod -Uri 'http://localhost:4101/api/claude-status' -Method POST -Body '{\\\"status\\\":\\\"idle\\\",\\\"agent\\\":\\\"ejecutor\\\"}' -ContentType 'application/json' -TimeoutSec 2 | Out-Null } catch {}\"",
|
||||
"timeout": 5000
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user