
    PL
j!                    t   U d Z ddlmZ ddlmZmZ dddi ddg d	d
dddg dddddddddddddddiddddddg ddddddg dd d!d"d#dd$dd%dd&dd'dddiddd(dd)dddiddd*dd+dg d,d-dd.dd/dd0dd1dd2dd3dd4dd5dd6d7d8dd9d:dd9d;dd<dgd=d>Zd?ed@<   dDdBZdCS )EuN  Schema for the generic `computer_use` tool.

Model-agnostic. Any tool-calling model can drive this. Vision-capable models
should prefer `capture(mode='som')` then `click(element=N)` — much more
reliable than pixel coordinates. Pixel coordinates remain supported for
models that were trained on them (e.g. Claude's computer-use RL).
    )annotations)AnyDictcomputer_useu  Drive the macOS desktop in the background — screenshots, mouse, keyboard, scroll, drag — without stealing the user's cursor, keyboard focus, or Space. Preferred workflow: call with action='capture' (mode='som' gives numbered element overlays), then click by `element` index for reliability. Pixel coordinates are supported for models trained on them. Works on any window — hidden, minimized, on another Space, or behind another app. macOS only; requires cua-driver to be installed.objectactionstring)captureclickdouble_clickright_clickmiddle_clickdragscrolltypekey	set_valuewait	list_apps	focus_appu
  Which action to perform. `capture` is free (no side effects). All other actions require approval unless auto-approved. Use `set_value` for select/popup elements and sliders — it selects the matching option directly without opening the native menu (no focus steal).)r   enumdescriptionmode)somvisionaxu  Capture mode. `som` (default) is a screenshot with numbered overlays on every interactable element plus the AX tree — best for vision models, lets you click by element index. `vision` is a plain screenshot. `ax` is the accessibility tree only (no image; useful for text-only models).appzOptional. Limit capture/action to a specific app (by name, e.g. 'Safari', or bundle ID, 'com.apple.Safari'). If omitted, operates on the frontmost app's window or the whole screen.)r   r   elementintegerzoThe 1-based SOM index returned by the last `capture(mode='som')` call. Strongly preferred over raw coordinates.
coordinatearrayr      zPixel coordinates [x, y] in logical screen space (as returned by capture width/height). Only use this if no element index is available.)r   itemsminItemsmaxItemsr   button)leftrightmiddlezMouse button. Defaults to left.	modifiers)cmdshiftoptionaltctrlfn)r   r   z%Modifier keys held during the action.)r   r#   r   from_elementzSource element index (drag).
to_elementzTarget element index (drag).from_coordinatez3Source [x,y] (drag; use when no element available).to_coordinatez3Target [x,y] (drag; use when no element available).	direction)updownr'   r(   zScroll direction.amountzScroll wheel ticks. Default 3.valuezFor action='set_value': the value to set on the element. For AXPopUpButton / select dropdowns, pass the option's display label (e.g. 'Blue'). For sliders and other AXValue-settable elements, pass the numeric or string value.textz+Text to type (respects the current layout).keyszUKey combo, e.g. 'cmd+s', 'ctrl+alt+t', 'return', 'escape', 'tab'. Use '+' to combine.secondsnumberzSeconds to wait. Max 30.booleanu   Only for action='focus_app'. If true, brings the window to front (DISRUPTS the user). Default false — input is routed to the app without raising, matching the background co-work model.zIf true, take a follow-up capture after the action and include it in the response. Saves a round-trip when you need to verify an action's effect.)raise_windowcapture_after)r   
propertiesrequired)namer   
parametersDict[str, Any]COMPUTER_USE_SCHEMAreturnc                     t           S )z2Return the generic OpenAI function-calling schema.)rF        =/home/kuhnn/.hermes/hermes-agent/tools/computer_use/schema.pyget_computer_use_schemarL      s    rJ   N)rG   rE   )	__doc__
__future__r   typingr   r   rF   __annotations__rL   rI   rJ   rK   <module>rQ      sR     # " " " " "         	; Y
    H% Y
6  ///-	 7Y
N  B OY
b !' cY
r  ),5
 
sY
H  333@ IY
R $KKK   G SY
d Y-KM MeY
h 9+IK KiY
l  ),1T	   mY
x  ),1T	 yY
F  7772 GY
P !? QY
Z  S [Y
n  L oY
v  ; wY
D  9 EY
P "=  "B cY
 Y
 Y
t Jy] ]j' j'  j j j jZ     rJ   