fix(sim): wire btn_approve_script and expose pending_script_approval in hook API

_handle_approve_script existed but was not registered in the click handler dict.
_pending_dialog (PowerShell confirmation) was invisible to the hook API —
only _pending_ask_dialog (MCP tool ask) was exposed.

- gui_2.py: register btn_approve_script -> _handle_approve_script
- api_hooks.py: add pending_script_approval field to mma_status response
- visual_sim_mma_v2.py: _drain_approvals handles pending_script_approval

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 14:31:32 -05:00
parent 5f661f76b4
commit 90fc38f671
3 changed files with 6 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ class HookHandler(BaseHTTPRequestHandler):
result["active_tickets"] = getattr(app, "active_tickets", [])
result["mma_step_mode"] = getattr(app, "mma_step_mode", False)
result["pending_tool_approval"] = getattr(app, "_pending_ask_dialog", False)
result["pending_script_approval"] = getattr(app, "_pending_dialog", None) is not None
result["pending_mma_step_approval"] = getattr(app, "_pending_mma_approval", None) is not None
result["pending_mma_spawn_approval"] = getattr(app, "_pending_mma_spawn", None) is not None
# Keep old fields for backward compatibility but add specific ones above