feat: Global hooks approval modal with plan/question/permission modes

- Add PermissionRequest and Stop approval hooks to local Claude config
- Unify PermissionApproval into multi-mode card (permission, plan, question)
- Support allowAlways, deny-with-reason, and AskUserQuestion answering
- Add cross-process broadcast fallback (HTTP to sync server)
- Fix approval scripts to default to .claude/debug/ for local agent
This commit is contained in:
2026-02-19 00:25:08 -06:00
parent a703128964
commit 159a38e3c2
7 changed files with 445 additions and 93 deletions

View File

@@ -3,8 +3,9 @@
# Returns Stop decision JSON per Claude Code docs:
# { "decision": "block", "reason": "..." } to continue implementing
# {} or empty to let Claude stop
param([string]$agent = "ejecutor")
$logFile = "$PSScriptRoot/../.claude-$agent/debug/hooks.log"
param([string]$agent = "")
if ($agent) { $logFile = "$PSScriptRoot/../.claude-$agent/debug/hooks.log" }
else { $logFile = "$PSScriptRoot/../.claude/debug/hooks.log"; $agent = "local" }
$ts = Get-Date -Format "HH:mm:ss.fff"
$b = [Console]::In.ReadToEnd()
Add-Content $logFile "[$ts] [PLAN] Hook fired for agent=$agent stdin_len=$($b.Length)"