
    sj                         d Z ddlZddlmZ ddlmZmZ dZdedefdZ	d	d
ddd e
e          ddidgddZ ej        d	ded d           dS )a  Reveal/focus a pane in the Hermes desktop GUI.

Lives in the ``desktop_ui`` toolset (like the other GUI affordances), which the
GUI gateway enables only for desktop-sourced sessions. Emits ``pane.reveal``
through the shared ``desktop_ui`` bridge; the renderer runs each pane's own
reveal path and only acts on the active window (a background turn never moves
the user's focus). To show a URL/file, use ``open_preview``; to close it, use
``close_preview``.
    N)
desktop_ui)registry
tool_error)chatfilesterminalreviewsessionspanereturnc                    | pd                                                                 }|t          vr+t          dd                    t                     d          S 	 t          j        dd|i          }n,# t          $ r}t          d| d|           cY d	}~S d	}~ww xY w|st          d
          S t          j	        d|dd          S )z1Ask the desktop GUI to reveal and focus ``pane``. zpane must be one of: z, .zpane.revealr   zFailed to focus the z pane: Nz7Pane focus is only available in the Hermes desktop app.T)successr   F)ensure_ascii)
striplowerPANESr   joinr   emit	Exceptionjsondumps)r   nameokexcs       9/home/agent/.hermes/hermes-agent/tools/focus_pane_tool.pyfocus_pane_toolr      s    JB%%''D5E$))E2B2BEEEFFFE_]VTN;; E E ECCCcCCDDDDDDDDE USTTT:$55EJJJJs   A6 6
B BBB
focus_paneu  Reveal and focus a pane in the Hermes desktop app when the user asks to see it — e.g. "show me the terminal", "open the file browser", "show the diff". Panes: chat (the conversation), files (project file browser), terminal (embedded shell), review (git diff), sessions (the session list). To show a URL or file in the preview pane, use open_preview; to close it, use close_preview.objectstringzWhich pane to reveal.)typeenumdescription)r"   
propertiesrequired)r   r$   
parametersr   c                 J    t          |                     dd                    S )Nr   r   )r   )r   get)argskws     r   <lambda>r,   @   s    DHHVR4H4HIII     u   🪟)r   toolsetschemahandleremoji)__doc__r   toolsr   tools.registryr   r   r   strr   listFOCUS_PANE_SCHEMAregister r-   r   <module>r:      s            / / / / / / / /;K# K# K K K K" 	  U6 
 H
 
  0  	II
     r-   