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:
2026-02-24 11:07:34 -06:00
parent 5bd115e197
commit 2edb3623c8
10 changed files with 23 additions and 333 deletions

View File

@@ -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
}
]

View File

@@ -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
}
]
}
]
}
}