
    .cj$	                         d Z ddlZddlmZ ddlmZmZ ddlmZ dZ	de
de
fd	Z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 ed           dS )a[  Reveal/focus a pane in the Hermes desktop GUI.

Gated on ``HERMES_DESKTOP`` (like the other GUI affordances). 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``.
    N)
desktop_ui)registry
tool_errorenv_var_enabled)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       7/home/ice/.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c                       t          d          S )uI   Desktop GUI only — HERMES_DESKTOP is set on the gateway the app spawns.HERMES_DESKTOPr        r   check_focus_pane_requirementsr%   #   s    +,,,r$   
focus_paneug  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 instead.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>r3   C   s    DHHVR4H4HIII r$   u   🪟)r   toolsetschemahandlercheck_fnemoji)__doc__r   toolsr   tools.registryr   r   utilsr   r   strr    boolr%   listFOCUS_PANE_SCHEMAregisterr#   r$   r   <module>rB      s,           / / / / / / / / ! ! ! ! ! !;K# K# K K K K -t - - - - 	O  U6 
 H
 
  .  	II*
     r$   