fix(gui): Restore missing UI handler methods

This commit is contained in:
2026-03-04 11:07:05 -05:00
parent 0152f05cca
commit 8642277ef4

View File

@@ -143,6 +143,64 @@ class App:
self._discussion_names_cache: list[str] = []
self._discussion_names_dirty: bool = True
def _handle_approve_script(self, user_data=None) -> None:
"""Approves the currently pending PowerShell script."""
with self._pending_dialog_lock:
dlg = self._pending_dialog
if dlg:
with dlg._condition:
dlg._approved = True
dlg._done = True
dlg._condition.notify_all()
self._pending_dialog = None
def _handle_reject_script(self, user_data=None) -> None:
"""Rejects the currently pending PowerShell script."""
with self._pending_dialog_lock:
dlg = self._pending_dialog
if dlg:
with dlg._condition:
dlg._approved = False
dlg._done = True
dlg._condition.notify_all()
self._pending_dialog = None
def _handle_approve_tool(self, user_data=None) -> None:
"""UI-level wrapper for approving a pending tool execution ask."""
self._handle_approve_ask()
def _handle_approve_mma_step(self, user_data=None) -> None:
"""UI-level wrapper for approving a pending MMA step."""
self._handle_mma_respond(approved=True)
def _handle_approve_spawn(self, user_data=None) -> None:
"""UI-level wrapper for approving a pending MMA sub-agent spawn."""
self._handle_mma_respond(approved=True)
def _handle_mma_respond(self, approved: bool, payload: str | None = None, abort: bool = False, prompt: str | None = None, context_md: str | None = None) -> None:
"""Delegates MMA approval response to the controller."""
self.controller._handle_mma_respond(approved, payload, abort, prompt, context_md)
def _handle_approve_ask(self, user_data=None) -> None:
"""Delegates tool approval to the controller."""
self.controller._handle_approve_ask()
def _handle_reject_ask(self, user_data=None) -> None:
"""Delegates tool rejection to the controller."""
self.controller._handle_reject_ask()
def _handle_reset_session(self, user_data=None) -> None:
"""Delegates session reset to the controller."""
self.controller._handle_reset_session()
def _handle_md_only(self, user_data=None) -> None:
"""Delegates 'MD Only' logic to the controller."""
self.controller._handle_md_only()
def _handle_generate_send(self, user_data=None) -> None:
"""Delegates 'Gen + Send' logic to the controller."""
self.controller._handle_generate_send()
def __getattr__(self, name: str) -> Any:
if name != 'controller' and hasattr(self, 'controller') and hasattr(self.controller, name):
return getattr(self.controller, name)